实验二_牛二实验
实验二由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“牛二实验”。
北京理工大学珠海学院实验报告
ZHUHAI CAMPAUS OF BEIJING INSTITUTE OF TECHNOLOGY 班级:10自动化 学号:100104031036 姓名:傅万年 指导教师:雷剑刚 成绩: 实验题目:练习选择结构 实验时间:2011-4-19
题目一:1.编程判断输入整数的正负性和奇偶性。代码:#include void main(){ int a;printf(“please input an integer:”);scanf(“%d”,&a);if(a>0)printf(“the number is positive!n”);else if(a
题目二:2.有3个整数a、b、c,由键盘输入,输出其中最大的数。代码:#include void main(){ int a,b,c,max;printf(“please input three integers:”);scanf(“%d%d%d”,&a,&b,&c);max=a;if(max
题目三:3.分别使用if语句和switch语句,以10分为一段,分别输出实际成绩和所在分数段。
代码:#include void main(){ int score;
printf(“please input the score:”);scanf(“%d”,&score);if(score>=90)printf(“good”);else if(score>=80&&score=70&&score=60&&score
实验小结:通过本次实验我知道了路径问题将影响实验,所以实验前一定要设好路径。
《实验二.docx》
将本文的Word文档下载,方便收藏和打印
推荐度:
点击下载文档
[其他范文]热门文章