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的更多相关文章

  1. UVa 414 - Machined Surfaces

    https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=s ...

  2. 414 - Machined Surfaces

    Sample Input (character "B" for ease of reading. The actual input file will use the ASCII- ...

  3. UVA_414:Machined Surfaces

    Language : C++ 4.8.2 #include<stdio.h> #include<string.h> int main(void) { int n; int su ...

  4. UVA题目分类

    题目 Volume 0. Getting Started 开始10055 - Hashmat the Brave Warrior 10071 - Back to High School Physics ...

  5. 【索引】Volume 0. Getting Started

    AOAPC I: Beginning Algorithm Contests (Rujia Liu) Volume 0. Getting Started 10055 - Hashmat the Brav ...

  6. POJ题目细究

    acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP:  1011   NTA                 简单题  1013   Great Equipment     简单题  102 ...

  7. HOJ题目分类

    各种杂题,水题,模拟,包括简单数论. 1001 A+B 1002 A+B+C 1009 Fat Cat 1010 The Angle 1011 Unix ls 1012 Decoding Task 1 ...

  8. 【转】POJ百道水题列表

    以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...

  9. <<Differential Geometry of Curves and Surfaces>>笔记

    <Differential Geometry of Curves and Surfaces> by Manfredo P. do Carmo real line Rinterval I== ...

随机推荐

  1. 算法笔记_076:蓝桥杯练习 结点选择(Java)

    目录 1 问题描述 2 解决方案   1 问题描述 问题描述 有一棵 n 个节点的树,树上每个节点都有一个正整数权值.如果一个点被选择了,那么在树上和它相邻的点都不能被选择.求选出的点的权值和最大是多 ...

  2. oracle将一个表中字段的值赋值到另一个表中字段(批量)

    面积表中数据错误,现将面积表中的sfmj字段的值改为居民信息表中匹配字段的值 update (select s.name name1,s2.name name2 from simple s,simpl ...

  3. (二)Solr——Solr界面介绍

    1. Dashboard 仪表盘,显示了该Solr实例开始启动运行的时间.版本.系统资源.jvm等信息. 2. Logging Solr运行日志信息 3. Cloud Cloud即SolrCloud, ...

  4. AnjularJS小项目,小案例,练手,猜数字

    之前自己就学了点AnjularJS,都是在菜鸟教程里面将基础的只是大致过了一遍,没怎么自己动手做什么东西练练手,但还是觉得纸上得来终觉浅,得知此事要躬行啊,今天就做了个猜数字的小游戏,觉得效果还不错, ...

  5. 用Fiddler 发送post请求

    在调试web api的时候,若是get 请求,可以直接在浏览器里查看结果,如果是put,或者post请求在浏览器地址栏里就没有办法了. 下面介绍一下,如何利用fiddler模拟post请求. 也可以用 ...

  6. canvas学习笔记(下篇) -- canvas入门教程--保存状态/变形/旋转/缩放/矩阵变换/综合案例(星空/时钟/小球)

    [下篇] -- 建议学习时间4小时  课程共(上中下)三篇 此笔记是我初次接触canvas的时候的学习笔记,这次特意整理为博客供大家入门学习,几乎涵盖了canvas所有的基础知识,并且有众多练习案例, ...

  7. C# DateTime的11种构造函数 [Abp 源码分析]十五、自动审计记录 .Net 登陆的时候添加验证码 使用Topshelf开发Windows服务、记录日志 日常杂记——C#验证码 c#_生成图片式验证码 C# 利用SharpZipLib生成压缩包 Sql2012如何将远程服务器数据库及表、表结构、表数据导入本地数据库

    C# DateTime的11种构造函数   别的也不多说没直接贴代码 using System; using System.Collections.Generic; using System.Glob ...

  8. stm32中的数据类型定义

    STM32F10X.H #include "core_cm3.h" #include "system_stm32f10x.h" #include <std ...

  9. Java Jar maven 下载地址

    Java Jar maven 下载地址 https://repo1.maven.org/maven2/ 根据maven artifactid 查找相关jar

  10. ClientViaBehavior行为

    ClientViaBehavior行为: 紧接红框:方式,也支持配置的应用方式