2013年10月6日
摘要: #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-06 01:30 yy99 阅读(176) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int blank,digit,other; char ch; int i; blank=digit=other=0; printf("Enter 10 charactrs:"); for(i=1;i<=10;i++){ ch=getchar(); switch(ch){ case' ': case'\n': blank++; break; case'0':case'1':case'2':case'... 阅读全文
posted @ 2013-10-06 01:12 yy99 阅读(135) 评论(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); b 阅读全文
posted @ 2013-10-06 00:42 yy99 阅读(113) 评论(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-06 00:18 yy99 阅读(148) 评论(0) 推荐(0) 编辑