- 博客(23)
- 收藏
- 关注
原创 21天养成良好习惯-21
#include <stdio.h>#include <stdlib.h>int main(){int N,m,i,x,y,z;scanf("%d",&N);for(x=1,y=0,z=0,i=1;x+y+z<N;i++){m=x;z=z+y;y=m;x=z;}printf("%d",i);return 0;}#include <stdio.h>#include <stdlib.h>int main(){i
2021-11-14 20:36:06
332
原创 21天养成良好习惯-20
#include <stdio.h>int main(){int sum = 0, m;while(m!=0){printf(“Input m:\n”);scanf("%d", &m);if(m==0)break;if(m!=0){sum = sum + m;printf(“sum = %d\n”, sum);}}return 0;}#include <stdio.h>int main(){int x, y, z;for (x=0;
2021-11-14 20:34:55
479
原创 21天养成良好习惯-19
#include <stdio.h>#include <stdlib.h>int main(){ long int x,m; int n; scanf("%ld",&x); n=x/10000; if(n>=0&&n<=10) { m=x*0.1;printf(“bonus=%ld\n”,m); } else if(n>10&&n<=20) {
2021-11-14 20:32:43
320
原创 21天养成良好习惯-18
#include <stdio.h>#include <stdlib.h>int main(){int i,a,b,A,B,y;float x;scanf("%d %d",&A,&B);y=A,a=A,b=B;for(x=0,i=0;a<=b;a++){printf("%5d",a);x=x+a;i++;if(i%50||iB-A+1)printf("\n");}printf("Sum = %.0f",x);return 0;
2021-11-14 20:31:47
462
原创 2021-11-09
21天养成良好习惯-17#include <stdio.h>#include <stdlib.h>int main(){int n,m;printf(“Please enter the number:\n”);scanf("%d",&n);if(n>0&&n<9)printf("%d: 0-9",n);else if(n>=10&&n<=99)printf("%d: 10-99",n);else
2021-11-09 23:29:30
32
原创 2021-11-09
21天养成良好习惯-16#include <stdio.h>#include <stdlib.h>int main(){float a,b,c,s;printf(“Input percent of A and B:”);scanf("%f %f",&a,&b);c=a10+b6,s=a8+b10;printf(“compete = %.4f\nstandard = %.4f\n”,c,s);if(c>s)printf(“The Best Re
2021-11-09 23:28:28
56
原创 2021-11-07
21天养成良好习惯-15#include <stdio.h>#include <stdlib.h>int main(){int a,b;char ch;scanf("%d %c %d",&a,&ch,&b);switch(ch){case ‘+’:printf("%d",a+b);break;case ‘-’:printf("%d",a-b);break;case '’:printf("%d",ab);break;case ‘/’:p
2021-11-07 19:37:11
57
原创 2021-11-06
21天养成良好习惯-14#include <stdio.h>#include <stdlib.h>#include <math.h>int main(){ double rate,capital,deposit; int year; char x; printf(“Input rate, year, capital:”); scanf("%lf,%d,%lf",&rate,&year,&capital); pr
2021-11-06 00:11:20
55
原创 2021-11-06
21天养成良好习惯-13int main(){ int n; float x,y; scanf("%d,%f",&n,&x); switch(n) { case 0: y=7+((int)x+1)*3; printf(“Price: %.2f”,y); break; case 1: y=6+((int)x+1)*4; printf(“Price: %.2f”,y);
2021-11-06 00:10:27
65
原创 2021-11-06
21天养成良好习惯-12#include <stdio.h>#include <stdlib.h>int main(){float A,B,n;scanf("%f %f",&A,&B);n=A/B;if(B>0)printf("%.0f/%.0f=%.2f",A,B,n);else if(B<0)printf("%.0f/(%.0f)=%.2f",A,B,n);elseprintf("%.0f/%.0f=Error",A,B);
2021-11-06 00:07:33
70
原创 2021-11-03
21天养成良好习惯-12#include<stdio.h> int main() { int score; char grade; printf(“Please input score:\n”); scanf("%d", &score); if (score < 0 || score > 100) printf(“Input error!\n”); else
2021-11-03 23:38:09
92
原创 2021-11-02
21天养成良好习惯-11#include <stdio.h>#include <stdlib.h>#include <math.h>int main(){float x,y;scanf("%f",&x);if(x>=0){y=sqrt(x);}else{y=pow((x+1),2)+2*x+1/x;}printf(“f(%.2f) = %.2f”,x,y);return 0;}#include <stdio.h>
2021-11-02 23:58:49
33
原创 2021-11-01
21天养成良好习惯-10#include <stdio.h>#include <stdlib.h>int main(){float x,z;int y;scanf("%f %d",&x,&y);if(x<=3){z=10+y/5*2;}else if(x>3&&x<=10){z=10+(x-3)2+y/52;}else{z=10+14+(x-10)3+y/52;}printf("%.0f",z);r
2021-11-01 23:59:57
31
原创 2021-11-01
21天养成良好习惯-9#include <stdio.h>#include <stdlib.h>int main(){int x,y;scanf("%d",&x);y=x/9*2;printf("%d",y);return 0;}#include <stdio.h>#include <stdlib.h>int main(){int key;char x,y,z;scanf("%c %d",&x,&key
2021-11-01 22:17:04
33
原创 2021-10-30
21天养成良好习惯-8#include <stdio.h>#include <stdlib.h>int main(){float p,q;printf(“Input payment p:”);scanf("%f",&p);q=p*0.92;printf(“price = %.1f\n”,q);return 0;}#include <stdio.h>#include <stdlib.h>int main(){int a,b
2021-10-30 23:20:15
37
原创 2021-10-30
21天养成良好习惯-7#include <stdio.h>#include <stdlib.h>int main(){int a1,a2,n,d,y;a1>=-100,a2<=100,0<n&&n<=1000;scanf("%d %d %d",&a1,&a2,&n);d=a2-a1,y=a1+(n-1)*d;printf("%d",y);return 0;}#include <stdio.h
2021-10-30 23:14:22
40
原创 2021-10-28
21天养成良好习惯-6#include <stdio.h>#include <stdlib.h>int main(){float a,d;int b;char c;scanf("%f %d %c %f",&a,&b,&c,&d);printf("%c %d %.2f %.2f",c,b,a,d);return 0;}#include <stdio.h>#include <stdlib.h>int ma
2021-10-28 23:47:20
37
原创 2021-10-27
21天养成良好习惯-5#include <stdio.h>#include <stdlib.h>int main(){int a,b,c;scanf("%d-%d-%d",&a,&b,&c);printf("%d-%03d-%0d",c,a,b);return 0;}
2021-10-27 20:44:01
28
原创 2021-10-27
21天养成良好习惯-4#include <stdio.h>#include <stdlib.h>#include<math.h>int main(){float x,y;scanf("%f",&x);y=log10(fabs(sin(x)-cos(x/2)+sqrt(x+168)));printf("%.4f",y);return 0;}
2021-10-27 00:29:51
53
原创 2021-10-25
21天养成良好习惯-3#include <stdio.h>#include <stdlib.h>int main(){int a,b,x,y;scanf("%d %d",&a,&b);y=b/2-a;x=a-y;printf("%d %d",x,y);return 0;}
2021-10-25 22:22:26
41
原创 2021-10-24
21天养成良好习惯-2#include <stdio.h>#include <stdlib.h>int main(){int a,b,c,d,e;float f;scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);f=(b+c+d)/3.00;printf("%.2f",f);return 0;}#include <stdio.h>#include <stdlib.h>
2021-10-24 21:25:07
30
原创 2021-10-24
#include <stdio.h>#include <stdlib.h>int main(){int a,b,c,d,e;float f;scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);f=(b+c+d)/3.00;printf("%.2f",f);return 0;}#include <stdio.h>#include <stdlib.h>int main().
2021-10-24 21:00:53
40
原创 2021-10-23
21天养成良好习惯-1#include <stdio.h>#include <stdlib.h>int main(){int N,n;scanf("%d",&N);n=(N+1)/2;printf("%d",n);return 0;}#include <stdio.h>#include <stdlib.h>int main(){int g=10,h,t=3;h=0.5gt*t;printf(“height = %.2f
2021-10-23 20:54:45
27
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人