2022年5月15日
摘要: 【题目描述】 输入一些整数,求出它们的最小值、最大值和平均值(保留3位小数)。输入保证这些数都是不超过1000的整数。 【输入】 一行,若干个整数。 【输出】 一行,即,最小值、最大值和平均值(保留3位小数)。 【输入样例】 1 2 3 【输出样例】 1 3 2.000 【提示】 【数据范围】 数据 阅读全文
posted @ 2022-05-15 14:26 禹城我的家 阅读(1613) 评论(0) 推荐(0)
摘要: #include <stdio.h> int main() { int i=1,m; double s=0; scanf("%d",&m); while(s<m) { s+=1.0/i; i++; } printf("%d\n",--i); return 0; } 阅读全文
posted @ 2022-05-15 14:25 禹城我的家 阅读(1065) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; int main() { int i,n,s1=0,s2=0; scanf("%d",&n); for(i=1;i<=n;i++) { if(i%2==0) s1+=i; else s2+=i; } print 阅读全文
posted @ 2022-05-15 14:23 禹城我的家 阅读(455) 评论(0) 推荐(0)
摘要: #include<cstdio> using namespace std; int main() { long long s=1; int n; scanf("%d",&n); for(int i=1;i<=n;++i) s*=i; printf("%lld\n",s); return 0; } 阅读全文
posted @ 2022-05-15 14:23 禹城我的家 阅读(529) 评论(0) 推荐(0)
  2022年5月13日
摘要: #include<iostream> #include<cmath> #include<cstdio> using namespace std; const double eps = 1e-6; int main(){ double a,b,c,dis,x1,x2; cin>>a>>b>>c; di 阅读全文
posted @ 2022-05-13 15:29 禹城我的家 阅读(165) 评论(0) 推荐(0)
摘要: #include <stdio.h> int main() { int a,b,c; int x,y; scanf("%d",&x); c=x/4; y=x%4; switch(y) { case 0: a=0; b=0; break; case 1: a=0; b=1; c--; break; c 阅读全文
posted @ 2022-05-13 15:27 禹城我的家 阅读(908) 评论(0) 推荐(0)
摘要: 【题目描述】 一个最简单的计算器支持+,-,*,/四种运算。输入只有一行:两个参加运算的数和一个操作符(+,-,*,/)。输出运算表达式的结果。考虑下面两种情况: (1)如果出现除数为0的情况,则输出:Divided by zero! (2)如果出现无效的操作符(即不为+,-,*,/之一),则输出: 阅读全文
posted @ 2022-05-13 15:26 禹城我的家 阅读(1541) 评论(0) 推荐(0)
摘要: 【题目描述】 乘坐飞机时,当乘客行李小于等于20公斤时,按每公斤1.68元收费,大于20公斤时,按每公斤1.98元收费,编程计算收费(保留2位小数)。 【输入】 行李重量。 【输出】 费用(保留2位小数)。 【输入样例】 20.00 【输出样例】 33.60 #include <bits/stdc+ 阅读全文
posted @ 2022-05-13 15:25 禹城我的家 阅读(1043) 评论(0) 推荐(0)
摘要: 【题目描述】 输入三个整数,按从大到小的顺序输出。 【输入】 输入三个整数 【输出】 按从大到小的顺序输出。 【输入样例】 3 2 1 【输出样例】 3 2 1 #include <stdio.h> int main() { int a,b,c,t; scanf("%d%d%d",&a,&b,&c) 阅读全文
posted @ 2022-05-13 15:24 禹城我的家 阅读(1351) 评论(0) 推荐(0)
摘要: 【题目描述】 歌手大奖赛上6名评委给一位参赛者打分,6个人打分的平均分为9.6分;如果去掉一个最高分,这名参赛者的平均分为9.4分;如果去掉一个最低分,这名参赛者的平均分为9.8分;如果去掉一个最高分和一个最低分,这名参赛者的平均是多少? 【输入】 (无) 【输出】 使用%5.2f按实数格式输出,保 阅读全文
posted @ 2022-05-13 15:23 禹城我的家 阅读(1457) 评论(0) 推荐(0)