- 博客(14)
- 收藏
- 关注
原创 zzuli新生训练学习第二天
C - 水仙花数 #include<bits/stdc++.h> using namespace std; int main() { int m,n,cnt,k; int a,b,c; int count[1000]; while(scanf("%d%d",&m,&n)!=EOF)//多实例; { cnt=0;k=0; for(int i=m;i&...
2019-12-10 21:33:40
197
原创 zzuli新生训练学习第二天
B - 求数列的和 #include<bits/stdc++.h> using namespace std; int main() { int m,n; double q;//替换n; double sum; while(scanf("%d%d",&n,&m)!=EOF) { sum=0; q=n; for(int i=1;i<=m;i++...
2019-12-10 21:24:54
147
原创 zzuli新生训练学习第二天
A - 数值统计 #include<bits/stdc++.h> using namespace std; int main() { int n; double m;//输入为实数; while(scanf("%d",&n),n!=0) { int sum1=0,sum2=0,sum3=0;//每次重置; for(int i=0;i<n;i++) { ...
2019-12-10 21:07:20
124
原创 zzuli新生训练学习第一天
G - 求奇数的乘积 #include<bits/stdc++.h> using namespace std; int main() { int n,sum,m; while(scanf("%d",&n)!=EOF)//多实例; { sum=1;//每次初始1; for(int i=0;i<n;i++) { scanf("%d",&m); ...
2019-12-10 20:46:28
150
原创 zzuli新生训练学习第一天
E - 成绩转换 #include<bits/stdc++.h> using namespace std; int main() { int t; while(scanf("%d",&t)!=EOF)//多实例 { if(t<0||t>100) printf("Score is error!\n"); else { if(t>=9...
2019-12-10 20:15:46
152
原创 zzuli新生训练学习第一天
D - 求绝对值 #include<bits/stdc++.h> using namespace std; int main() { double n,m;//实数 while(scanf("%lf",&n)!=EOF)//多实例 { m=fabs(n);//求绝对值公式 printf("%.2f\n",m);//保留两位小数 } return 0; } ...
2019-12-10 20:04:14
138
原创 zzulioj
1169: 大整数(指针专题) #include<bits/stdc++.h> using namespace std; int cmp(char *a,char *b) { int l1,l2; l1=strlen(a); l2=strlen(b); if(l1>l2) return 1; else if(l1<l2) return -1; else ...
2019-12-10 17:52:40
504
原创 zzulioj
1168: 账单(指针专题) #include<bits/stdc++.h> using namespace std; int main() { int ncase,q; cin>>ncase; char str[100][200],p[100][200]; for(int i=0;i<ncase;i++) { int n,m,l; cin>&...
2019-12-10 17:04:45
2750
原创 zzulioj
1154: 校门外的树 #include<bits/stdc++.h> using namespace std; int main() { int x, y,m, n, l; int a[10001]; cin>>n; while(n>0) { for(int i = 0; i <= 10000; i++) a[i] = 1; cin...
2019-12-09 21:28:31
211
原创 zzulioj
1167: 逆转数(指针专题) #include<bits/stdc++.h> using namespace std; void reverse(char *str) { int l; char p; l=strlen(str); int m=l-1; int n=0; for(int i=l-1;i>=0;i--) { if(str[i]!='0') {...
2019-12-09 21:15:49
352
原创 zzulioj
1166: 实数取整(指针专题) #include<bits/stdc++.h> using namespace std; char *rounding(char *p) { int l; l=strlen(p); int n=l-1; int m=0; for(int i=l-1;i>=0;i--) { if(*(p+i)=='.') { *(p+i)...
2019-12-09 21:04:03
535
原创 zzuli新生训练学习第一天
A - ASCII码排序 #include<bits/stdc++.h> using namespace std; int main() { char s1,s2,s3; while(scanf("%c%c%c",&s1,&s2,&s3)!=EOF) { if(s1>s2) swap(s1,s2); if(s2>s3) swap...
2019-12-09 20:53:39
135
原创 zzuli新生训练学习第一天
C - 计算球体积 #include<bits/stdc++.h> using namespace std; #define PI 3.1415926 int main() { double r,v;//输入为实数; while(scanf("%lf",&r)!=EOF)//多实例; { v=4.0/3PIrrr;//公式计算; printf("%.3f\n",v);//换行;...
2019-12-09 20:24:40
197
1
原创 zzuli新生训练学习第一天
##B - 计算两点间的距离 #include<bits/stdc++.h> using namespace std; int main() { double l,x1,x2,y1,y2; //注意,输入的为实数 ; while(scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2)!=EOF) //多实例...
2019-12-09 20:17:11
145
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅