代码改变世界

3-1

2013-10-18 23:54 by css1993, 120 阅读, 0 推荐, 收藏, 编辑
摘要:#includeint main(void){ int x,y; printf("Enter x,y:"); scanf("%d",&x); if(x<0){ y=-1; } if(x=0){ y=0; } else { y=1; } printf("%d\n",y); return 0;} 阅读全文

n户电量求和

2013-10-17 14:38 by css1993, 181 阅读, 0 推荐, 收藏, 编辑
摘要:#includeint main(void){ int i,n; double x,y; double fee(double x); printf("Enter n:"); scanf("%d",&n); for(i=1;i<=n;i++){ printf("Enter x:"); scanf("%lf",&x); if(x<=0) printf("error"); else{ y=fee(x); } printf("y=%.3f\... 阅读全文

n个圆柱体体积

2013-10-17 13:56 by css1993, 179 阅读, 0 推荐, 收藏, 编辑
摘要:#include int main(void) { int i,n; double r,h,v; printf("Enter n:"); scanf("%d",&n); for(i=0;i0&&h>0){ v=3.14*r*r*h; printf("%.2f",v); } else{ ... 阅读全文

求n个圆柱体的体积

2013-10-15 15:06 by css1993, 187 阅读, 0 推荐, 收藏, 编辑
摘要:#includeint main(void){ int n,i; double H,R,v,V; printf("Enter R,H,n,v,V:"); scanf("%d",&n); if(R>0&&H>0){ v==3.14*R*R*H; for(i=1;i<=n;i++) V=v*i; printf("V=%.3f\n",V); } else{ printf("error"); } return 0; } 阅读全文

求圆面积

2013-10-14 09:24 by css1993, 173 阅读, 0 推荐, 收藏, 编辑
摘要:#includeint main(void){ double R,S; printf("Enter R:"); scanf("%Lf",&R); if(R>0){ S=3.14*R*R; printf("%.2f",S); } else printf("error"); return 0;} 阅读全文

opp

2013-10-10 09:50 by css1993, 117 阅读, 0 推荐, 收藏, 编辑
摘要:#includeint main(){ int a,b,c; a=89; b=11; c=a+b; printf("a+b=%d\n",c); return 0;} 阅读全文

qaz

2013-10-09 13:16 by css1993, 431 阅读, 0 推荐, 收藏, 编辑
摘要:#includeint main(void){ double value1,value2; char op; printf("Type in an expression:"); scanf("%1f%c%1f",&value1,&op,&value2); if(op=='+') printf("=%.2f\n",value1+value2); else if(op=='-') printf("=%.2f\n",value1-value2); else if(o 阅读全文