UVa 12403 - Save Setu
题目:有两种操作:1.当前数值添加。2.输出当前数值。
分析:简单题。模拟就可以。
说明:A+B。
#include <iostream>
#include <cstdlib>
#include <string> using namespace std; string s; int main()
{
int n,sum,add;
while (cin >> n) {
sum = 0;
while (n --) {
cin >> s;
if (s[0] == 'd') {
cin >> add;
sum += add;
}else
cout << sum << endl;
}
}
return 0;
}
UVa 12403 - Save Setu的更多相关文章
- UVA - 11986 Save from Radiation
Description J Save from Radiation Most of you are aware of Nuclear Power Plant Explosion at Fukushim ...
- uva 10894 - Save Hridoy
#include <iostream> #include <string> #include <cstring> #include <cmath> us ...
- UVA 1291 十四 Dance Dance Revolution
Dance Dance Revolution Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Su ...
- UVA 322 ships (POJ 1138)
题目地址: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem ...
- UVA它11292 - Dragon of Loowater
Problem C: The Dragon of Loowater Once upon a time, in the Kingdom of Loowater, a minor nuisance tur ...
- UVA 257 - Palinwords(弦HASH)
UVA 257 - Palinwords 题目链接 题意:输出一个文本里面的palinword,palinword的定义为.包括两个不同的回文子串,而且要求回文子串不能互相包括 思路:对于每一个单词推 ...
- UVA 11292 Dragon of Loowater(简单贪心)
Problem C: The Dragon of Loowater Once upon a time, in the Kingdom of Loowater, a minor nuisance tur ...
- UVA 1341 - Different Digits(数论)
UVA 1341 - Different Digits 题目链接 题意:给定一个正整数n.求一个kn使得kn上用的数字最少.假设同样,则输出值最小的 思路: 首先利用鸽笼原理证明最多须要2个数字去组成 ...
- Risk UVA - 12264 拆点法+最大流+二分 最少流量的节点流量尽量多。
/** 题目:Risk UVA - 12264 链接:https://vjudge.net/problem/UVA-12264 题意:给n个点的无权无向图(n<=100),每个点有一个非负数ai ...
随机推荐
- Images for Journals
Images for publication Table of Contents 1. Images for publication 1.1. image format : vector image ...
- Postfix mail for azengna.com loops back to myself -solve
设置 /etc/postfix/main.cf 原配置 mydestination = $myhostname, localhost.$mydomain, localhost 改为 mydestina ...
- 【HDU 6153】A Secret (KMP)
Problem Description Today is the birthday of SF,so VS gives two strings S1,S2 to SF as a present,whi ...
- ArrayList练习之存储字符串并遍历
在myArrayList项目下 新建一个包 在这个包中新建一个类:ArrayListDemo4.java ArrayListDemo4.java import java.util.ArrayList; ...
- Oracle数据库之初步接触
每个Oracle数据库都是数据的集合,这些数据包含在一个或多个文件中.数据库有物理和逻辑两种结构.在开发应用程序的过程中,会创建诸如表和索引这样的结构,这些结构用于数据行的存储和查询.可以为对象的名称 ...
- coraldraw快捷键
显示导航窗口(Navigator window) [N] 运行 Visual Basic 应用程序的编辑器 [Alt]+[F11] 保存当前的图形 [Ctrl]+[S] 打开编辑文本对话框 ...
- 大数据学习——redis安装
用源码工程来编译安装 / 到官网下载最新stable版 / 解压源码并进入目录 .tar.gz -C ./redis-src/ / make 如果报错提示缺少gcc,则安装gcc : yum inst ...
- Java日志实战及解析 - 引导
日志是什么? 程序日志的作用 记录程序运行情况,程序员观察和调试使用 统计分析 日后审计 程序员,开发工程师,架构师等天天打交道. 实际中有4%的代码是日志! http://logging.apach ...
- 【搜索】codeforces C. The Tag Game
http://codeforces.com/contest/813/problem/C [题意] 给定一棵有n个结点的树,初始时Alice在根结点1,Bob在非根结点x; Alice和Bob轮流走,每 ...
- [转]制作一个64M的U盘启动盘(mini linux + winpe +dos toolbox)
自己动手定制winpe+各类dos工具箱U盘启动盘+minilinux 由于一个64M老U盘,没什么用,拿来发挥余热.如果U盘够大,可以使用功能更强大的mini linux和带更多工具的winpe.这 ...