摘要: #includeint main(void){ int choice,i; double price; for(i=1;i<=5;i++){ printf("[1] Select apples \n"); printf("[2] Select pears \n"); printf("[3] Select oranges \n"); printf("[4] Select grapes \n"); printf("[0] exit \n"); printf("Enter choice 阅读全文
posted @ 2013-10-19 23:01 wuyanlong 阅读(85) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ char ch; printf("Input Grade: "); ch=getchar(); switch(ch){ case 'A': printf("%c 90-100\n",ch); break; case 'B': printf("%c 80-89\n",ch); break; case 'C': printf("%c 70-79\n",ch); ... 阅读全文
posted @ 2013-10-19 22:59 wuyanlong 阅读(122) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int n,m; double grade,total; n=0; m=0; total=0; printf("Enter grades:"); scanf_s("%lf",&grade); while(grade>=0){ total=total+grade; m++; if(grade<60) n++; scanf_s("%lf",&grade); } if(m!=0){ printf("Gr... 阅读全文
posted @ 2013-10-19 22:58 wuyanlong 阅读(98) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int x,y; printf("Enter x:\n"); scanf_s("%d",&x); if(x<0){ y = -1; } else if(x==0){ y=0; } else{ y=1; } printf("y=%d\n",y); return 0;} 阅读全文
posted @ 2013-10-19 22:57 wuyanlong 阅读(89) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int i,n,year; printf("Enter n:"); scanf_s("%d",&n); for(i=1;i<=n;i++){ printf("Enter year:"); scanf_s("%d",&year); if((year%4==0&&year%100!=0)||(year%400==0)){ printf("这是闰年"); } else{ printf("这不是闰年" 阅读全文
posted @ 2013-10-19 22:57 wuyanlong 阅读(91) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int yinwen,shuzi,koge,other; char ch; int i; yinwen=shuzi=koge=other=0; printf("Enter 15 characters:"); for(i=1;i='a'&&ch='A'&&ch='0'&&ch=' '&&ch<='\n') koge++; else other++; } printf("y 阅读全文
posted @ 2013-10-19 22:56 wuyanlong 阅读(94) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int i,n; double x,y; double fee(double x); printf("Enter n:"); scanf("%d",&n); for(i=1;iint main(){ int i,n; double r,v,h; double cylinder(double r,double h); printf("enter n:"); scanf("%d",&n); for(i=1;iint main(){ int n,i; dou 阅读全文
posted @ 2013-10-19 21:40 wuyanlong 阅读(105) 评论(0) 推荐(0) 编辑