Codeforces Round #564 (Div. 2)A
A. Nauuo and Votes
题目链接:http://codeforces.com/contest/1173/problem/A
题目
Nauuo is a girl who loves writing comments.
One day, she posted a comment on Codeforces, wondering whether she would get upvotes or downvotes.
It's known that there were xpersons who would upvote, yy y persons who would downvote, and there were also another z persons who would vote, but you don't know whether they would upvote or downvote. Note that each of the x+y+z people would vote exactly one time.
There are three different results: if there are more people upvote than downvote, the result will be "+"; if there are more people downvote than upvote, the result will be "-"; otherwise the result will be "0".
Because of the z z unknown persons, the result may be uncertain (i.e. there are more than one possible results). More formally, the result is uncertain if and only if there exist two different situations of how the z z persons vote, that the results are different in the two situations.
Tell Nauuo the result or report that the result is uncertain.
Input
The only line contains three integers x,y,z(0=<x,y,z<=100) x, corresponding to the number of persons who would upvote, downvote or unknown.
Output
If there is only one possible result, print the result : "+", "-" or "0".
Otherwise, print "?" to report that the result is uncertain.
Example
intput
3 7 0
output
-
题意
There are there numbers , they are x , y and z. you can give z to x and y,
if x are the most ,you can output "+",
if y are the most ,you can output "-",
if you are not sure which are the most,you should output "?".
思路
it's a easy problem,you can compare a and b+c,b and a+c.
#include<bits/stdc++.h>
using namespace std;
int main()
{ int a,b,c;
while(cin>>a>>b>>c)
{
if(a==b&&c==)
cout<<<<endl;
else if(a>b+c)
cout<<"+"<<endl;
else if(b>a+c)
cout<<"-"<<endl;
else
cout<<"?"<<endl;
}
return ;
}
Codeforces Round #564 (Div. 2)A的更多相关文章
- Codeforces Round #564 (Div. 1)
Codeforces Round #564 (Div. 1) A Nauuo and Cards 首先如果牌库中最后的牌是\(1,2,\cdots, k\),那么就模拟一下能不能每次打出第\(k+i\ ...
- Codeforces Round #564 (Div. 2) C. Nauuo and Cards
链接:https://codeforces.com/contest/1173/problem/C 题意: Nauuo is a girl who loves playing cards. One da ...
- Codeforces Round #564 (Div. 2) B. Nauuo and Chess
链接:https://codeforces.com/contest/1173/problem/B 题意: Nauuo is a girl who loves playing chess. One da ...
- Codeforces Round #564 (Div. 2) A. Nauuo and Votes
链接:https://codeforces.com/contest/1173/problem/A 题意: Nauuo is a girl who loves writing comments. One ...
- Codeforces Round #564 (Div. 2)B
B. Nauuo and Chess 题目链接:http://codeforces.com/contest/1173/problem/B 题目 Nauuo is a girl who loves pl ...
- Codeforces Round #564 (Div. 2) D. Nauuo and Circle(树形DP)
D. Nauuo and Circle •参考资料 [1]:https://www.cnblogs.com/wyxdrqc/p/10990378.html •题意 给出你一个包含 n 个点的树,这 n ...
- Codeforces Round #564 (Div. 2)
传送门 参考资料 [1]: the Chinese Editoria A. Nauuo and Votes •题意 x个人投赞同票,y人投反对票,z人不确定: 这 z 个人由你来决定是投赞同票还是反对 ...
- Codeforces Round #366 (Div. 2) ABC
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate ...
- Codeforces Round #354 (Div. 2) ABCD
Codeforces Round #354 (Div. 2) Problems # Name A Nicholas and Permutation standard input/out ...
随机推荐
- 追本溯源 —— 句型、表达、模式,pattern,著名的话
** 时候,做了 ** 事,是我 **,做得最对的一件事: "Winning that ticket was the best thing that ever happened to me& ...
- WPF(C#)中Bitmap与BitmapImage相互转换
原文:WPF(C#)中Bitmap与BitmapImage相互转换 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/wangshubo1989/art ...
- zcelib - One cplusplus C++ crossplatform library use for develop server,similar to ACE.
zcelib - One cplusplus C++ crossplatform library use for develop server,similar to ACE.OS适配层,为了适应WIN ...
- 关于C#的可变长参数
可变参数 params===>> params int[] list,传入参数的类型必须是一种类型 static void Main(string[] args) { , , , ); C ...
- 数据绑定(十一)多路绑定MultiBinding
原文:数据绑定(十一)多路绑定MultiBinding 有时候UI要显示的信息又不止一个数据来源决定,就需要使用MultiBinding,MultiBinding具有一个名为Bindings的属性,其 ...
- 以双斜杠//开头的URL – 依赖协议的URL
原文:以双斜杠//开头的URL – 依赖协议的URL 不知道大家有没有见过下面这种 url 写法: <img src="//domain.com/img/logo.png"& ...
- 对c&c++源文件和头文件分开的好处的一点认识
对c&c++程序来说,基本上来说都是要把源文件和头文件分别编写.一般都是代表一个基本功能的源文件引用相应的头文件. 一个 相关功能的模块可能有若干对源文件和头文件组成.这是基于组件编程的核心. ...
- 给 Web 开发人员推荐的通用独立 UI 组件(二)
现代 Web 开发在将体验和功能做到极致的同时,对于美观的追求也越来越高.在推荐完图形库之后,再来推荐一些精品的独立 UI 组件.这些组件可组合在一起,形成美观而交互强大的 Web UI . 给 We ...
- QT 那些事
一直做的是windows开发,有2个小项目想做到手机.看来看去,选择了QT.本文介绍自己的学习的一些心得,希望对你有帮助.1.选择QT2.安卓的一些事3.QML调用C++4.资源集成(比较有用,网上资 ...
- 基于 libevent 开发的 C++ 11 高性能网络服务器 evpp(360的作品)
evpp是一个基于libevent开发的现代化C++11高性能网络服务器,自带TCP/UDP/HTTP等协议的异步非阻塞式的服务器和客户端库. 特性: 现代版的C++11接口 非阻塞异步接口都是C++ ...