上一页 1 2 3 4 5 6 7 ··· 9 下一页
摘要: #includeint main(void){ double x,y; printf("Enter x:\n"); scanf("%lf",&x); if(x <= 50){ y = x * 0.53; } else{ y = 26.5 + (x - 50)*0.58; } printf("y=%.2f\n",x,y); return 0;} 阅读全文
posted @ 2013-10-19 23:58 shadowtly 阅读(106) 评论(1) 推荐(0)
摘要: #includeint main(void){ int num1,num2; double x,y; double z,k; printf("Enter num1:"); scanf("%d",&num1); printf("Enter num2:"); scanf("%d",&num2); x = num1+num2; y = num1-num2; z = num1*num2; k = num1/num2; printf("x=%.0f\n",x); printf(" 阅读全文
posted @ 2013-10-19 23:20 shadowtly 阅读(191) 评论(1) 推荐(0)
摘要: #includeint main(){ char c1,c2,c3,c4; scanf("%c%c",&c1,&c2); printf("%c %c\n",c1,c2); getchar(); c3 = getchar(); c4 = getchar(); printf("%c %c\n",c3,c4); printf("%c %c %c %c\n",c1,c2,c3,c4); return 0;} 阅读全文
posted @ 2013-10-17 15:28 shadowtly 阅读(112) 评论(0) 推荐(0)
摘要: #includeint main(){ char c1,c2,c3,c4; scanf("%d%d",&c1,&c2); printf("%d\n",c1+c2); getchar(); c3 = getchar(); c4 = getchar(); printf("%d\n",c3+c4); return 0;} 阅读全文
posted @ 2013-10-17 15:12 shadowtly 阅读(92) 评论(0) 推荐(0)
摘要: #includeint main(void){ int i,n; double r,h,v; double cylinder(double r,double h); printf("Enter n:"); scanf("%d",&n); for(i = 1;i <= n;i++){ printf("Enter r and h:\n"); scanf("%lf%lf",&r,&h); v = cylinder(r,h); printf("v = %.2f\n",v); 阅读全文
posted @ 2013-10-17 10:00 shadowtly 阅读(131) 评论(0) 推荐(0)
摘要: #includeint main(void){ double s,r; printf("Enter r:\n"); scanf("%Lf",&r); if(r >= 0){ s = r * r * 3.14; printf("%.2f",s); } else printf("Enter error!\n"); return 0;} 阅读全文
posted @ 2013-10-14 09:24 shadowtly 阅读(124) 评论(1) 推荐(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'&&str 阅读全文
posted @ 2013-10-07 16:27 shadowtly 阅读(148) 评论(1) 推荐(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-07 15:56 shadowtly 阅读(99) 评论(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 阅读全文
posted @ 2013-10-07 15:49 shadowtly 阅读(101) 评论(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-07 15:40 shadowtly 阅读(88) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 9 下一页