随笔分类 -  C

摘要:#include<stdio.h>#include<math.h>int main(void){ int m,n,i,s,b,b1,g1,s1,p,count=0; scanf("%d%d",&m,&n); for(i=m;i<=n;i++){ b1=i/100; b=i%100; s1=b/10; 阅读全文
posted @ 2013-12-12 08:51 韵文 阅读(127) 评论(0) 推荐(0)
摘要:#include<stdio.h>int main(void){ int n,i; double m,h,s; scanf("%lf %d",&m,&n); s=0; for(i=0;i<n;i++){ h=m/2; m=h; s=s+2*h; } printf("%.2lf ",h); print 阅读全文
posted @ 2013-12-09 09:56 韵文 阅读(100) 评论(0) 推荐(0)
摘要:#include int main(void) { int i,n; char str[120]; i=0; while((str[i]=getchar())!='\n') i++; str[i]='\0'; n=i; printf("%d\n",i); for(i=0;str[i]!='\0';i++) ... 阅读全文
posted @ 2013-12-09 09:01 韵文 阅读(91) 评论(0) 推荐(0)
摘要:#include<stdio.h>#include<math.h>double fact(int n){ int i; double product; product=1; for(i=1;i<=n;i++){ product=product*i; } return 0;}int main(void 阅读全文
posted @ 2013-12-02 09:55 韵文 阅读(102) 评论(0) 推荐(0)
摘要:/* 密码变换问题 */ #include #include #define MAXLINE 80 void encrypt(char*); int main(void) { char line[MAXLINE]; printf("输入字符串"); gets(line); encrypt(line); printf("%s%s\n","After bein... 阅读全文
posted @ 2013-11-14 09:02 韵文 阅读(119) 评论(0) 推荐(0)
摘要:# include<stdio.h> int main(void) { int mynumber=38; int yournumber; printf("Input your number:"); scanf("%d",&yournumber); if(yournumber==mynumber) p 阅读全文
posted @ 2013-10-02 11:05 韵文 阅读(124) 评论(0) 推荐(0)
摘要:#include double fact(int n); int main(void) { int i,n; double result; printf("Enter n:"); scanf("%d",&n); for(i=0;i<=n;i++){ result=fact(i); printf("%d!=%.0f\n",i,... 阅读全文
posted @ 2013-10-01 21:32 韵文 阅读(92) 评论(0) 推荐(0)
摘要:#include<stdio.h> #include<math.h> int main(void) { int i,n; double power; printf("Enter n:"); scanf("%d",&n); for(i=0;i<=n;i++){ power=pow(2,i); prin 阅读全文
posted @ 2013-10-01 20:44 韵文 阅读(91) 评论(0) 推荐(0)
摘要:/*显示"Hello World!"*/ #include<stdio.h> int main(void) { printf("Hello World!"); return 0; } 阅读全文
posted @ 2013-10-01 13:18 韵文 阅读(54) 评论(0) 推荐(0)
摘要:1.1 阅读全文
posted @ 2013-10-01 10:49 韵文 阅读(61) 评论(0) 推荐(0)
摘要:#include /*打印一颗心的图案*/ int main() { printf(" *** ***\n"); printf(" * * * *\n"); printf("* * *\n"); printf(" * *\n"); printf(" * *\n"); printf(" * *\n"); prin... 阅读全文
posted @ 2013-10-01 10:34 韵文 阅读(95) 评论(0) 推荐(0)
摘要:<!--StartFragment --> 阅读全文
posted @ 2013-09-30 09:43 韵文 阅读(80) 评论(0) 推荐(0)