上一页 1 2 3 4 5 6 ··· 8 下一页
摘要: #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 阅读(94) 评论(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 阅读(97) 评论(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 阅读(96) 评论(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 阅读(108) 评论(0) 推荐(0)
摘要: #includeint main(void){ double r,s; printf("Enter r:\n"); scanf("%LF",&r); if(rint main(void){ double r,h,v; printf("Enter r,h:"); scanf("%lf%lf",&r,&h); if(r<0,h<0){ printf("sorry you enter is wrony!\n"); } else{ v=3.1415926*r*r*h; 阅读全文
posted @ 2013-10-14 09:48 wuyanlong 阅读(122) 评论(0) 推荐(0)
摘要: #includeint main(void){ int i,k; char str1[80],str2[80]; long number; printf("Enter a string:"); i=0; while((str1[i]=getchar())!='\n') i++; str1[i]='\0'; k=0; for(i=0;str1[i]!='\0';i++) if (str1[i]>='0'&&str1[i]='a'&&str1[i]='A 阅读全文
posted @ 2013-10-03 19:14 wuyanlong 阅读(154) 评论(0) 推荐(0)
摘要: #includeint main(void){ int count,i; char str[80]; printf("Enter a string:"); i=0; while((str[i]=getchar())!='\n') i++; str[i]='\0'; count=0; for(i=0;str[i]!='\0';i++) if(str[i]='0') count++; printf("count=%d\n",count); return 0;} 阅读全文
posted @ 2013-10-03 18:38 wuyanlong 阅读(111) 评论(0) 推荐(0)
摘要: #includeint main(void){ int i,number; char str[10]; printf("Enter a string:"); i=0; while((str[i]=getchar())!='\n') i++; str[i]='\0'; number=0; for(i=0;str[i]!='\0';i++) if(str[i]>='0'&& str[i]<='9') number=number*10+str[i]-'0'; 阅读全文
posted @ 2013-10-03 18:29 wuyanlong 阅读(121) 评论(0) 推荐(0)
摘要: #includeint main(void){ int i,n,m; char s[10]; printf("Enter a string:"); i=0; while((s[i]=getchar())!='\n') i++; s[i]='\0'; for(n=0,m=i-1;n=m) printf("It is a plalindrome\n"); else printf("It is not a plalindrome\n"); return 0;} 阅读全文
posted @ 2013-10-03 18:16 wuyanlong 阅读(87) 评论(0) 推荐(0)
摘要: #include 阅读全文
posted @ 2013-10-03 18:07 wuyanlong 阅读(117) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 8 下一页