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 ...
随机推荐
- ATS项目更新(4) 更新DLL到远程服务器
rem by jin tao rem upload dll to ta1bbn01 rem rem @echo off echo %time% set time1 = %,%%,%%,% rem ** ...
- OpenGL(二十) glutSpecialFunc响应键盘方向控制键
OpenGL的glut中使用glutMouseFunc函数注册鼠标响应事件,使用glutKeyboardFunc函数注册键盘响应事件,对键盘上特殊的4个方向按键的响应函数是glutSpecialFun ...
- 微信小程序之商品属性分类
所提及的购物数量的加减,现在说说商品属性值联动选择. 为了让同学们有个直观的了解,到电商网截了一个图片,就是红圈所示的部分 现在就为大家介绍这个小组件,在小程序中,该如何去写 下图为本项目的图: wx ...
- 卷积、卷积矩阵(Convolution matrix)与核(Kernel)
在图像处理领域,Kernel = convolution matrix = mask,它们一般都为一个较小的矩阵: 用于:Sharpen,Blur, Edge enhance,Edge detect, ...
- 用WPF轻松打造iTunes CoverFlow效果
原文:用WPF轻松打造iTunes CoverFlow效果 用WPF轻松打造iTunes CoverFlow效果 ...
- [视频]产品营销之拍出好电子产品,Peter Belanger是如何为苹果产品拍照的
Peter Belanger –他就是那些颠覆你想象的苹果产品照片的摄影师.作为旧金山的顶级产品图片设计师的 Peter,他还拥有 eBay, Nike, Pixer 和 Square 等客户. 让我 ...
- dedecms织梦出现“Upload filetype not allow”原因和解决方案
资源:武汉科技有限公司倍频猫 我最近升级DEDE5.6出现此问题后.和解决的方法. 假设有同学是按某些朋友用删除代码的方法解决这个问题的话,建议你修正此做法,毕竟这是有非常大安全风险的.而DEDE本身 ...
- WPF - Group分组对ListBox等列表样式的约束
原文:WPF - Group分组对ListBox等列表样式的约束 在做WPF主题支持时,出现一个分组引起的莫名错误,可是折腾了我一番.在没有使用样式时,列表分组很正常,使用了别人写的ListBox列表 ...
- 【C#】【WPF】如何读写app.config文件
WPF生成的项目中会有.exe.config.一般是系统默认配置的 格式是xml格式,C#的项目可以直接读写这些文件.方法代码如下. public static string GetConnectio ...
- JS 数组两种定义方式
<!DOCTYPE html><html lang="en" xmlns="http://www.w3.org/1999/xhtml"> ...