摘要:
#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-02 17:46
韵文
阅读(123)
评论(0)
推荐(0)
摘要:
#includeint main(void){ double value1,value2; char op; printf("Type in an expression:"); scanf("%lf%c%lf",&value1,&op,&value2); switch(op){ case'+': printf("=%.2f\n",value1+value2); break; case'-': printf("=%.2f\n",value1-value2); . 阅读全文
posted @ 2013-10-02 17:35
韵文
阅读(122)
评论(0)
推荐(0)
摘要:
#includeint main(void){ int choice,i; 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-02 16:39
韵文
阅读(158)
评论(0)
推荐(0)
摘要:
#includeint main(void){ int digit,letter,other; char ch; int i; digit=letter=other=0; printf("Enter 10 characters:"); for(i=1;i='a'&&ch='0'&&ch<='9') digit++; else other++; } printf("letter=%d,digit=%d,other=%d\n",letter,digit,other); re 阅读全文
posted @ 2013-10-02 16:17
韵文
阅读(118)
评论(0)
推荐(0)
摘要:
#includeint main(void){ double valuel,value2; char op; printf("Type in an expression:"); scanf("%lf%c%lf",&valuel,&op,&value2); if(op=='+') printf("=%.2f\n",valuel+value2); else if(op=='-') printf("=%.2f\n",valuel-value2); else if(o 阅读全文
posted @ 2013-10-02 15:56
韵文
阅读(132)
评论(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-02 12:27
韵文
阅读(144)
评论(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-02 12:18
韵文
阅读(128)
评论(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 add.\n"); } return 0;} 阅读全文
posted @ 2013-10-02 11:12
韵文
阅读(112)
评论(0)
推荐(0)
摘要:
# include<stdio.h> int main(void) { int mynumber=38; int yournumber; printf("Input your number:"); scanf("%d",&yournumber); if(yournumber==mynumber) p 阅读全文
posted @ 2013-10-02 11:05
韵文
阅读(121)
评论(0)
推荐(0)

浙公网安备 33010602011771号