2013年10月8日
摘要: #includeint main(void){ int count[9]; int i,response; for(i=1;i8) printf("this is a bad response :%d\n",response); else count[response]++; } printf("result:\n"); for(i=1;i<=8;i++) printf("%4d%4d\n",i,count[i]); return 0;} 阅读全文
posted @ 2013-10-08 06:44 yy99 阅读(105) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int i; char ch_lower,ch_upper; for(i=1;i='a'&&ch_lower%c->%d\n",ch_lower,ch_upper,ch_upper%10); } return 0;} 阅读全文
posted @ 2013-10-08 06:43 yy99 阅读(106) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int i,flag,x; int a[5]; printf("Enter 5 integers:"); for(i=0;i<5;i++) scanf("%d",&a[i]); printf("Enter x:"); scanf("%d",&x); flag=0; for(i=0;i<5;i++) if(a[i]==x){ printf("Index is %d\n",i); flag=1; break; ... 阅读全文
posted @ 2013-10-08 06:42 yy99 阅读(107) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int i; int fib[10]={1,1}; for(i=2;i<10;i++) fib[i]=fib[i-1]+fib[i-2]; for(i=0;i<10;i++){ printf("%6d",fib[i]); if((i+1)%5==0) printf("\n"); } return 0;} 阅读全文
posted @ 2013-10-08 06:42 yy99 阅读(94) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ int i,index,n; int a[10]; printf("Enter n:"); scanf("%d",&n); printf("Enter %d integers:",n); for(i=0;i<n;i++) scanf("%d",&a[i]); index=0; for(i=1;i<n;i++) if(a[i]<a[index]) index=i; printf("min is %d\tsub is %d\n& 阅读全文
posted @ 2013-10-08 06:42 yy99 阅读(147) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ char ch='w'; int a=2,b=3,c=1,d,x=10; printf("%d",a>b==c); printf("%d",d=a>b); printf("%d",ch>'a'+1); printf("%d",d=a+b>c); printf("%d",b-1==a!=c); printf("%d",3<=x<=5); return 0; } 阅读全文
posted @ 2013-10-08 06:42 yy99 阅读(113) 评论(0) 推荐(0) 编辑
摘要: #includedouble fact_s(int n);int main(void){ int i,n; printf("Input n:"); scanf("%d",&n); for(i=1;i<=n;i++) printf("%3d!=%.0f\n",i,fact_s(i)); return 0;}double fact_s(int n){ static double f=1; f=f*n; return(f);} 阅读全文
posted @ 2013-10-08 06:42 yy99 阅读(104) 评论(0) 推荐(0) 编辑
摘要: #includeint x;int f( );int main(void){ int a=1; x=a; a=f( ); { int b=2; b=a+b; x=x+b; } printf("%d%d",a,x); return 0;}int f( ){ int x=4; return x;} 阅读全文
posted @ 2013-10-08 06:42 yy99 阅读(159) 评论(0) 推荐(0) 编辑
摘要: #includefloat cash;int main(void){ int choice; float value; void income(float number),expend(float number); cash=0; printf("Enter operate choice(0--end,1--income,2--expend):"); scanf("%d",&choice); while(choice!=0){ if(choice==1||choice==2){ printf("Enter cash ... 阅读全文
posted @ 2013-10-08 06:41 yy99 阅读(145) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void){ char ch='w'; int a=2,b=0,c=0; float x=3.0; printf("%d",a&&b); printf("%d",a||b&&c); printf("%d",!a&&b); printf("%d",a||3+10&&2); printf("%d",!(x==2)); printf("%d",!x==2); print 阅读全文
posted @ 2013-10-08 06:41 yy99 阅读(104) 评论(0) 推荐(0) 编辑