UVALive 4853 Emoogle Balance
来源:互联网 发布:sql删除重复字段数据 编辑:程序博客网 时间:2024/06/05 17:53
题意:题目很长,其实主要就是题中加粗的那个公式和输入输出。给n个数,用非零数的个数减去零的个数。
水题啦~
#include <cstdio>#include <cstring>#include <algorithm>using namespace std;int a[1005];int main(){ int ans, cnt = 1, n; while(~scanf("%d", &n)) { ans = 0; if(n == 0) break; int b; for(int i = 0; i < n; i++) { scanf("%d", &b); if(b == 0) ans--; else ans++; } printf("Case %d: %d\n", cnt++, ans); }}
0 0
- UVALive 4853 Emoogle Balance
- Emoogle Balance
- 12279 - Emoogle Balance
- UVa 12279 - Emoogle Balance
- UVALive 7003 A Balance Game on Trees 树形dp
- UVALive 7003 A Balance Game on Trees(树形dp)
- Balance
- balance
- Balance
- uva11916 Emoogle Grid
- UVA11916 Emoogle Grid
- UVALive
- UVALive
- UVALive
- UVALive
- UVALive
- UVALive
- UVALive
- 程序员写好简历的五大技巧
- Mac OS X 10.9 启用 Web 服务器(默认预装 Apache+PHP 5.4.17)
- 单播、多播和广播
- 40个Java集合面试问题和答案
- C#集合类(数据结构)
- UVALive 4853 Emoogle Balance
- 移动设备上音频文件不能播放怎么办?
- 2014广州站 I - Little Zu Chongzhi's Triangles(贪心)
- python + opencv 学习系列 2 : Getting Started with Videos
- 第8章 应用协议
- hdu 2795 Billboard(线段树 单点更新)
- 我所具备的
- 总结
- HDU 3829 Cat VS Dog