上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页

2022年11月8日

摘要: 输入: 一行输入一个整数n 接下去每组数据中,第一个输入整数m 下一行输入m个整数 输出: 输出每组大于6000的数的个数 #include<stdio.h> main() { int n,m,i,j,a,s=0; scanf("%d",&n); for(i=1;i<=n;i++) { scanf( 阅读全文

posted @ 2022-11-08 23:17 lachesism 阅读(513) 评论(0) 推荐(0)

摘要: 输入: 数一个整数n 第二行开始,再输入n个整数 输出: 最大值 平均值(保留两位小数) #include<stdio.h> main() { int a[100],n,i,max=0,sum=0; float ave; scanf("%d",&n); for(i=0;i<n;i++) scanf( 阅读全文

posted @ 2022-11-08 23:15 lachesism 阅读(735) 评论(0) 推荐(0)

摘要: #include<stdio.h> main() { int a[100],i,n,sum=0,over_ave=0,below_ave=0; float ave,g,h; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&a[i]); sum=sum+a 阅读全文

posted @ 2022-11-08 23:14 lachesism 阅读(987) 评论(0) 推荐(0)

2022年10月12日

摘要: #include<stdio.h> main() { int n,t; int sum;; sum=0; scanf("%d",&n); for(t=1;t<=n;t+=2) { sum=sum+t; } printf("%d",sum); } 阅读全文

posted @ 2022-10-12 21:32 lachesism 阅读(294) 评论(0) 推荐(0)

摘要: #include<stdio.h> main() { int n,a; a=1; scanf("%d",&n); while(n>10) { n=n/10; a++; } printf("%d",a); } 阅读全文

posted @ 2022-10-12 19:50 lachesism 阅读(115) 评论(0) 推荐(0)

摘要: #include<stdio.h> main() { int n; scanf("%d",&n); while(n>10) { n=n/10; } printf("%d",n); } 阅读全文

posted @ 2022-10-12 19:48 lachesism 阅读(148) 评论(0) 推荐(0)

摘要: #include<stdio.h> main() { int n,a; scanf("%d",&n); a=0; while(n>10) { a=n%10; n=n/10; if(a==0) { continue; } else printf("%d",a); } printf("%d",n); } 阅读全文

posted @ 2022-10-12 19:46 lachesism 阅读(254) 评论(0) 推荐(0)

2022年10月10日

摘要: 删除非法字符: 输入一个字符串,将不属于英文字母的符号删除 s=input('','s'); s(find(s>='0'&s<='9')) = ''; disp(char(s)); 阅读全文

posted @ 2022-10-10 19:16 lachesism 阅读(89) 评论(0) 推荐(0)

摘要: 输入一个字符串,取循环子字符串 如abcdef, 给定起始位置及长度,取子字符串, 4,5 ,则输出defab a=input('','s'); b=input(''); c=input(''); l=length(a); d=l-b; f=c-d-1; s=a(b:l); m=a(1:f); z= 阅读全文

posted @ 2022-10-10 19:15 lachesism 阅读(60) 评论(0) 推荐(0)

摘要: a=input('','s'); b=a(end:-1:1); disp(b); 阅读全文

posted @ 2022-10-10 19:14 lachesism 阅读(156) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页