摘要: #include<stdio.h>int main(){char string[99];int i,word=0,num=0; gets(string);for(i=0;(string[i])!='\0';i++) if(string[i]==' ')word=0;else if(word==0){ 阅读全文
posted @ 2019-05-23 15:21 李天贤 阅读(78) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> int main(){ int a[3][3]; int i,j,s=0; for(i=0;i<3;i++) { for(j=0;j<3;j++) { scanf("%d",&a[i][j]); } } s=a[0][0]+a[0][2]+a[1][1]+a[2] 阅读全文
posted @ 2019-05-23 14:57 李天贤 阅读(81) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>int main(){ int a[10]; int i,j,t; printf("input 10 numbers:\n"); for(i=0;i<10;i++) scanf("%d",&a[i]); printf("\n"); for(j=0;j<9;j++) 阅读全文
posted @ 2019-05-23 14:29 李天贤 阅读(91) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>int main(){int a,b,c,s,x=0;for(a=1;a<=5;a++){ for(b=1;b<=5;b++) { if(a==b) continue; for(c=1;c<=5;c++) { if((c==a)||(c==b)) continue; 阅读全文
posted @ 2019-05-09 15:31 李天贤 阅读(94) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>int main(){ int a,b,c=0,x,y,z; for(a=100;a<=999;a++) { x=a/100; y=(a/10)%10; z=a%10; b=x*x*x+y*y*y+z*z*z; if(a==b){ printf("%d\n",a); 阅读全文
posted @ 2019-05-09 15:09 李天贤 阅读(165) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>int main(){int a;long s=0;for(a=22;a<=1002;a=20+a)s=s+a;printf("%d",s); return 0;} #include<stdio.h>int main(){int a=22;long s=0;whil 阅读全文
posted @ 2019-05-09 14:47 李天贤 阅读(175) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> void main() { double a,rate,tax,profit; int b; printf("请输入奖金数:"); scanf("%lf",&a); b=a/500; switch(b) { case 0:rate=0.00;break; cas 阅读全文
posted @ 2019-04-25 16:16 李天贤 阅读(93) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<math.h> int main(){ int a,b,c,y; scanf("%d,%d,%d",&a,&b,&c); if(a>b){ y=a; a=b; b=y; } if(a>c){ y=a; a=c; c=y; } if(b>c){ y 阅读全文
posted @ 2019-04-25 15:24 李天贤 阅读(116) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>int main(){ int year; printf("input the year"); scanf("%d",&year); if((year%400==0)||(year%4==0&&year%100!=0)) { printf("year:%d,mont 阅读全文
posted @ 2019-04-25 14:59 李天贤 阅读(90) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> int main(){ char a,b,c,d,e; a=getchar(); b=getchar(); c=getchar(); d=getchar(); e=getchar(); putchar(a); putchar(b); putchar(c); put 阅读全文
posted @ 2019-04-25 14:12 李天贤 阅读(102) 评论(0) 推荐(0) 编辑