uva414 - Machined Surfaces
/*
水题,值得一提的是,getline使用时注意不能让它多吃回车键,处理方法可以用getchar。
*/
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main()
{
int n; while (cin >> n, n)
{
getchar(); //第一个回车键会被getline拿去,所以要用getchar处理这个回车 定义在cstdio string s[n]; int black[n], sum = ; for (int i = ; i < n; ++i)
{
getline(cin, s[i]); int temp = ; for (int j = ; j < s[i].size(); ++j)
{
if (s[i][j] == 'X')
temp--;
} black[i] = temp; sum += black[i];
} cout << sum - *min_element(black, black+n)*n << endl;
}
}
uva414 - Machined Surfaces的更多相关文章
- UVa 414 - Machined Surfaces
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=s ...
- 414 - Machined Surfaces
Sample Input (character "B" for ease of reading. The actual input file will use the ASCII- ...
- UVA_414:Machined Surfaces
Language : C++ 4.8.2 #include<stdio.h> #include<string.h> int main(void) { int n; int su ...
- UVA题目分类
题目 Volume 0. Getting Started 开始10055 - Hashmat the Brave Warrior 10071 - Back to High School Physics ...
- 【索引】Volume 0. Getting Started
AOAPC I: Beginning Algorithm Contests (Rujia Liu) Volume 0. Getting Started 10055 - Hashmat the Brav ...
- POJ题目细究
acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP: 1011 NTA 简单题 1013 Great Equipment 简单题 102 ...
- HOJ题目分类
各种杂题,水题,模拟,包括简单数论. 1001 A+B 1002 A+B+C 1009 Fat Cat 1010 The Angle 1011 Unix ls 1012 Decoding Task 1 ...
- 【转】POJ百道水题列表
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...
- <<Differential Geometry of Curves and Surfaces>>笔记
<Differential Geometry of Curves and Surfaces> by Manfredo P. do Carmo real line Rinterval I== ...
随机推荐
- win7之64位下安装oracle11g遇到问题和不能删除干净的问题
今天在win7下装了oracle11g 删了又卸 来来回回重启了4.5次,结合网上是解释归纳下几点: 一.win64_11gR2_database_1of2.zip和win64_11gR2_datab ...
- 【转】myeclipse中连接mysql数据库
1. 环境配置 下载地址: http://www.mysql.com/downloads/mysql/ 真麻烦,下载的话还需要注册和登录以及填个表.上面的信息还挺全的,乱填的信息也是可以接受的~~ ...
- [Exception IOS 4] - could not build module 'foundation'
出现这个问题首先百度找到的是:http://www.cocoachina.com/bbs/read.php?tid=188086 然后在blog中能找到链接:http://stackoverflow. ...
- Android之Handler用法总结/安卓中只有主线程可以修改UI
Handler传递消息的方式可以实现实时刷新以及长按连续响应事件. 按钮响应 btnadd_fcl.setOnTouchListener(new View.OnTouchListener() { pr ...
- 增强for循环、Map接口遍历、可变參数方法
增强for循环 1.for循环能做得事情.增强for循环大部分都能做(假设要想获得下标的时候就必须使用简单for循环了) 2.增强for有时候可以方便的处理集合遍历的问题,可是集合的标准遍历是使用迭代 ...
- 修改select下拉框的下拉按钮
ie上的下拉框下拉按钮真是太丑了,如何把他自定义一下呢? 首先,把浏览器自带的下拉框去掉: select::-ms-expand { display: none; } 接下来,用自己喜欢的下拉图片去 ...
- xcode7 断点失效
今天下了个别人的demo,运行发现断点不起作用,开始以为是xcode7的问题,因为自升级到xcode7后没怎么用,但后来尝试其它项目,发现是可以断点的,所以才认定不是xcode的问题,而是项目配置的问 ...
- swift -变量的定义与使用
使⽤用let来声明常量,使⽤用var来声明变量. ⼀一个常量的值在编译时并不须要获取,可是你仅仅能为它赋值⼀一次.也就是说你能够⽤用常量来表⽰示这样⼀一个值:你仅仅须要决定⼀一次,可是须要使⽤用非常多 ...
- Nginx日志深入详解
一.日志分类 Nginx日志主要分为两种:访问日志和错误日志.日志开关在Nginx配置文件(/etc/nginx/nginx.conf)中设置,两种日志都可以选择性关闭,默认都是打开的.1.访问日志 ...
- [svc][op]pip安装ansible && yum安装python34
相对yum安装,pip安装的好处是jinjia版本到了2.8 pip安装ansible Successfully installed MarkupSafe-1.0 PyYAML-3.12 ansibl ...