上一页 1 ··· 6 7 8 9 10 11 下一页
摘要: #includeint main(void){ int i,n,sum; printf("Enter n:"); scanf("%d",&n); sum=0; for(i=1;i<=n;i++){ sum=sum+i; } printf("Sum of numbers from 1 to%dis%d\n",n,sum); return 0;} 阅读全文
posted @ 2013-10-03 10:01 plusfancy 阅读(87) 评论(0) 推荐(0)
摘要: #includeint main(void){ int fahr,lower,upper; double celsius; printf("Enter lower:"); scanf("%d",&lower); printf("Enter upper:"); scanf("%d",&upper); printf("fahr celsius\n"); for(fahr=lower;fahr<=upper;fahr++){ celsius=(5.0/9.0)*(fahr-32) 阅读全文
posted @ 2013-10-03 07:48 plusfancy 阅读(205) 评论(0) 推荐(0)
摘要: #include#includeint main(void){ int money,year; double rate,sum; printf("Enter money:"); scanf("%d",&money); printf("Enter year:"); scanf("%d",&year); printf("Enter rate:"); scanf("%lf",&rate); sum=money*pow(1+rate,year); printf 阅读全文
posted @ 2013-10-03 07:28 plusfancy 阅读(101) 评论(0) 推荐(0)
摘要: #includeint main(void){ double x,y; printf("Enter x(x>=0):\n"); scanf("%lf",&x); if(x<=15){ y=4*x/3; } else{ y=2.5*x-10.5; } printf("y=f(%f)=%.2f\n",x,y); return 0;} 阅读全文
posted @ 2013-10-03 07:20 plusfancy 阅读(79) 评论(0) 推荐(0)
摘要: #includeint main(void){ int celsius,fahr; fahr=100; celsius=5*(fahr-32)/9; printf("fahr=%d,celsius=%d\n",fahr,celsius); return 0;} 阅读全文
posted @ 2013-10-02 22:54 plusfancy 阅读(115) 评论(0) 推荐(0)
摘要: #includeint main(void){ printf("Programming is fun.\n"); printf("And programming in C is even more fun!\n"); return 0;} 阅读全文
posted @ 2013-10-02 22:46 plusfancy 阅读(123) 评论(0) 推荐(0)
摘要: #includeint main(void){ printf("Hello World!\n"); return 0;} 阅读全文
posted @ 2013-10-02 22:40 plusfancy 阅读(88) 评论(0) 推荐(0)
摘要: #includeint main(void){ int n; int factorial(int n); scanf("%d",&n);2 printf("%d\n",factorial(n)); return 0;}int factorial(int n){ int i,fact=1; for(i=1;i<=n;i++) fact=fact*i; return fact;} 阅读全文
posted @ 2013-10-02 22:34 plusfancy 阅读(109) 评论(0) 推荐(0)
摘要: #include#includechar* month_str[]={"一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"};intmon_day[][12]={{31,28,31,30,31,30,31,31,30,31,30,31},{31,29,31,30,31,30,31,31,3 阅读全文
posted @ 2013-10-02 09:32 plusfancy 阅读(102) 评论(0) 推荐(0)
摘要: #include/打印一颗心的图案*/int main(){ printf(" *** ***\n"); printf(" * * * *\n"); printf("* * *\n"); printf(" * *\n"); printf(" * *\n"); printf(" * *\n"); printf(" * *\n"); ... 阅读全文
posted @ 2013-09-30 12:53 plusfancy 阅读(82) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 下一页