基于c语言 语句的作用是提前,c综合应用新题精选.ppt

c综合应用新题精选

练习题 2012-11 【程序填空1】 题目:从键盘上输入三角形的三边长,判断是否能构成三角形。 #include "stdio.h" main() { /***********SPACE***********/ 【?】 a,b,c; /***********SPACE***********/ scanf("%d%d%d",【?】,&b,&c); /***********SPACE***********/ if(a+b>c【?】b+c>a&&a+c>b) printf("yes\n"); /***********SPACE***********/ 【?】 printf("no\n"); } 【程序填空2】 题目:从键盘输入n个数并求和。请填空,完善程序。 #include main() { /***********SPACE***********/ int a,s,i,【?】; /***********SPACE***********/ 【?】 i=1; scanf(“%d”,&n) ; /***********SPACE***********/ 【?】 (i<=n) { scanf("%d",&a); s=s+a; /***********SPACE***********/ 【?】 } printf("%d\n",s); } 【程序填空3】 题目:输入10个数,求其中的最大值与最小值。 #include "stdio.h" main( ) { int x, max, min,i; scanf("%d",&x); max=x; /***********SPACE***********/ 【?】 i=1; /***********SPACE***********/ while(【?】) { scanf("%d",&x); /***********SPACE***********/ if(x>max) 【?】; if(x main( ) { /***********SPACE***********/ int 【?】,s, j; for(n=1;n<=1000;n++) { /***********SPACE**********/ 【?】; /***********SPACE***********/ for(j=1; j<=n/2;j++) if(【?】) s=s+j; /***********SPACE***********/ if(【?】) printf("%d\n",n); } } 【程序改错1】 -------------------------------------------------------- 题目:给定一个三位正整数,输出其百位数字、十位数字和个位数字。 #include main() { int n,ge,shi,bai; /*********found*******/ scanf("%d",n); /*********found*******/ bai=n%100; shi=

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值