poj 3507
来源:互联网 发布:软件界面开发工具 编辑:程序博客网 时间:2024/05/02 01:54
//poj 3507 居然还有求平均数的水题 看测试没有注意到去掉最高分和最低分 wa了一场 #include <iostream>#include <string>using namespace std;int main(){int a[6];bool ok = true;while(ok){ok = false;int sum = 0;int max = 0;int min = 11; for(int i = 0; i < 6; i++) {cin>>a[i];sum += a[i];if(a[i] > max)max = a[i];if(a[i] < min)min = a[i];if(a[i] != 0)ok = true;}if(ok){sum = sum - min - max;if(sum % 4 == 0)cout<<sum / 4 <<endl;elsecout<<sum * 1.0 / 4<<endl;}}return 0;}
0 0
- poj 3507
- POJ 3507
- poj 3507
- poj 3507 Judging Olympia
- POJ
- poj
- POJ
- POJ
- poj
- poj
- POJ
- POJ
- poj
- POJ
- POJ
- POJ
- POJ
- POJ
- 同一tomcat下不同web项目session共享方法
- HQL: Hibernate查询语言
- poj3619
- [LeetCode] Remove Duplicates from Sorted Array II
- poj 3589
- poj 3507
- JAVA深复制(深克隆)与浅复制(浅克隆)
- spring中使用DBUtils
- 推荐几个偷网站的小工具
- poj 3299
- 15款值得学习的小型开源项目,带你快速步入开源世界
- 九度 题目1026:又一版 A+B java
- new 、 delete 、 malloc 、 free
- LeetCode 124 Binary Tree Maximum Path Sum