uva 591 Box of Bricks
来源:互联网 发布:oracle nvl 转 mysql 编辑:程序博客网 时间:2024/05/11 04:45
平均数简单题目
#include <stdio.h>#defineMAX_LEN51int h[MAX_LEN];int case_count;void func(int n){int i;int sum, aver;sum = 0;for(i=0; i<n; i++)sum += h[i];aver = sum/n;sum = 0;for(i=0; i<n; i++){if(h[i] > aver)sum += h[i]-aver;}printf("Set #%d\n", case_count);printf("The minimum number of moves is %d.\n", sum);printf("\n");}int main(void){int n, i;case_count = 0;while(1){scanf("%d", &n);if(!n)break;for(i=0; i<n; i++){scanf("%d", h+i);}case_count ++;func(n);}}
- UVa 591 - Box of Bricks
- uva 591 - Box of Bricks
- Uva 591 - Box of Bricks
- uva 591 Box of Bricks
- uva 591 - Box of Bricks
- UVa 591 - Box of Bricks
- UVA 591 - Box of Bricks
- uva 591Box of Bricks
- UVa 591 - Box of Bricks
- UVA 591 Box of Bricks
- uva 591 - Box of Bricks
- uva 591 Box of Bricks
- UVa 591 - Box of Bricks
- UVA 591 Box of Bricks
- UVa 591 - Box of Bricks
- Uva 591 Box of Bricks
- UVA - 591 Box of Bricks
- UVa:591 - Box of Bricks
- Alibaba 阿里巴巴2014笔试题
- 姐不干开发2个月了
- java中的多线程
- android 2.3 开始主线程不能访问网络
- java 小数点保留位数
- uva 591 Box of Bricks
- Linux kernel crash analysis example (2)
- 顺序栈
- 物化视图无法删除的解决方法
- jquery使用及语法实例(一)
- Solve equation
- 乐视腾讯深度合作 超级电视26日易迅网首发
- ext4文件系统翻译之第二篇
- OCP-1Z0-051-V9.02-115题