上一页 1 ··· 3 4 5 6 7 8 9 下一页
摘要: #includeint main(void){ double value1,value2; char op; printf("Type in an expression:"); scanf("%lf%c%lf",&value1,&op,&value2); if(op=='+') printf("=%.2f\n",value1+value2); else if(op=='-') printf("=%.2f\n",value1-value2); else if(o 阅读全文
posted @ 2013-10-05 13:50 执于一念 阅读(134) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int blank,digit,other; char ch; int i; blank=digit=other=0; printf("Enter 10 characters:"); for(i=1;i<=10;i++){ ch=getchar(); switch(ch){ case' ': case'\n': blank++; break; case'0':... 阅读全文
posted @ 2013-10-05 13:39 执于一念 阅读(127) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ double value1,value2; char op; printf("Type an expression:"); scanf("%lf%c%lf",&value1,&op,&value2); switch(op){ case'+': printf("=%.2lf\n",value1+value2); break; case'-': printf("=%.2lf\n",value1-value2... 阅读全文
posted @ 2013-10-05 13:02 执于一念 阅读(75) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int i,choice; double price; for(i=1;i<=5;i++){ printf("[1]select crisps\n"); printf("[2]select popcorn\n"); printf("[3]select chocolate\n"); printf("[4]select cola\n"); printf("[0]exit\n"); printf("Enter choice:") 阅读全文
posted @ 2013-10-05 12:12 执于一念 阅读(113) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int dight,letter,other; char ch; int i; dight=letter=other=0; printf("Enter 10 characters:"); for(i=1;i='a'&&ch='A'&&ch='0'&&ch<='9') dight++; else other++; } printf("letter=%d,dight=%d,other=%d",l 阅读全文
posted @ 2013-10-05 11:56 执于一念 阅读(131) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ double value1,value2; char op; printf("Type in an expression:"); scanf("%lf%c%lf",&value1,&op,&value2); if(op=='+') printf("=%.2f\n",value1+value2); else if(op=='-') printf("=%.2f\n",value1-value2); else if(o 阅读全文
posted @ 2013-10-05 11:35 执于一念 阅读(107) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ double x,y; printf("Enter x:"); scanf("%lf",&x); if(x<0){ y=0; } else if(x<=15){ y=4*x/3; } else{ y=2.5*x-10.5; } printf("f(%.2f)=%2f\n",x,y); return 0;} 阅读全文
posted @ 2013-10-05 11:21 执于一念 阅读(107) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int count,i,n; double grade,total; printf("Enter n:"); scanf("%d",&n); total=0; count=0; for(i=1;i<=n;i++){ printf("Enter grade #%d ",i); scanf("%lf",&grade); total=total+grade; if(grade<60){ count++; } ... 阅读全文
posted @ 2013-10-03 22:36 执于一念 阅读(111) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int number; printf("Enter a number:"); scanf("%d",&number); if(number%2==0){ printf("The number is even.\n"); } else{ printf("The number is odd.\n"); } return 0;} 阅读全文
posted @ 2013-10-03 13:15 执于一念 阅读(93) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int mynumber=38; int yournumber; printf("Input yournumber:"); scanf("%d",&yournumber); if(yournumber==mynumber) printf("OK! you are right!\n"); else if(yournumber>mynumber) printf("Sorry!yournumber is bigger than mynumber!\n"); . 阅读全文
posted @ 2013-10-03 13:06 执于一念 阅读(82) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 下一页