上一页 1 ··· 8 9 10 11 12 13 14 下一页
摘要: /* F1=1 (n=1) F2=1 (n=2) Fn=Fn-1+Fn-2(n>=3) */ #include <stdio.h>int main(){ int f1=1,f2=1,f3; int i,a=0; printf("%12d\n%12d\n",f1,f2); for(i=1;i<=38; 阅读全文
posted @ 2020-05-07 11:12 采姑娘的小蘑菇a 阅读(2470) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>int main(){ char c; c=getchar(); while(c!='\n') { if((c>='A'&&c<='Z')||(c>='a'&&c<='z')) { if((c>='A'&&c<='V')||(c>='a'&&c<='v')) c= 阅读全文
posted @ 2020-05-05 17:10 采姑娘的小蘑菇a 阅读(2386) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <math.h>int main(){ int k,i,n,m=0; for (n=101;n<=200;n=n+2)//由常识知,偶数不是素数,所以不必对偶数进行判定 { k=sqrt(n);//sqrt求平方根的函数,要求参数为双精度数。执行 阅读全文
posted @ 2020-05-05 16:43 采姑娘的小蘑菇a 阅读(870) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //让n被i除(i的值从2到n-1)int main(){ int n,i; printf("please enter a integer number,n=?"); scanf("%d",&n); for(i=2;i<=n-1;i++) if(n%i==0) 阅读全文
posted @ 2020-05-05 11:51 采姑娘的小蘑菇a 阅读(2735) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <math.h>int main(){ int sign=1,a=0;//sign表数值符号 double n=1;//分母 依次为前一个+2 double sum=0,x=1;//总和最初为0,将第一项设为x while(fabs(x)>=1e 阅读全文
posted @ 2020-05-05 11:35 采姑娘的小蘑菇a 阅读(1372) 评论(0) 推荐(0) 编辑
摘要: /* 1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 4 8 12 16 20 */ #include <stdio.h>int main(){ int i,j,n=0; for(i=1;i<=4;i++) for(j=1;j<=5;j++,n++) { if(n%5==0)pri 阅读全文
posted @ 2020-04-29 19:15 采姑娘的小蘑菇a 阅读(1415) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>int main(){ int n=100; for(n=100;n<=200;n++) { if(n%3==0) continue; printf("%d ",n); } return 0;} ********************************** 阅读全文
posted @ 2020-04-29 18:22 采姑娘的小蘑菇a 阅读(1609) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#define SUM 100000int main(){ float amount,aver,total; int i; for(i=1,total=0;i<=1000;i++) { printf("please enter amount:"); scanf(" 阅读全文
posted @ 2020-04-28 19:14 采姑娘的小蘑菇a 阅读(2174) 评论(0) 推荐(0) 编辑
摘要: //一般情况下 二者结果相同 但当while后表达式第一次为假时 二者结果不同 #include <stdio.h>int main(){ int i,sum=0; printf("please enter i,i=?"); scanf("%d",&i); while(i<=10) { sum = 阅读全文
posted @ 2020-04-28 18:36 采姑娘的小蘑菇a 阅读(240) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>int main(){ int sum=0; int i=1; while(i<=100) { sum=sum+i; i++; } printf("sum=%d",sum); return 0;} ********************************* 阅读全文
posted @ 2020-04-27 16:30 采姑娘的小蘑菇a 阅读(893) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 下一页
求投食~(点图即可)