Codeforces 1173A Nauuo and Votes

曾经终败给现在 2021-12-02 00:06 349阅读 0赞

题目链接:http://codeforces.com/problemset/problem/1173/A

1696897-20190713222231173-551875776.png

1696897-20190713222240400-2144277891.png


思路:模拟。

AC代码:

  1. 1 #include<bits/stdc++.h>
  2. 2 using namespace std;
  3. 3 int main()
  4. 4 {
  5. 5 int x,y,z;
  6. 6 while(cin >> x >> y >> z)
  7. 7 {
  8. 8 if(x == y)
  9. 9 {
  10. 10 if(z == 0) cout << 0 << endl;
  11. 11 else cout << "?" << endl;
  12. 12 }
  13. 13 else if(x > y)
  14. 14 {
  15. 15 if(x - y > z) cout << "+" << endl;
  16. 16 else cout << "?" << endl;
  17. 17 }
  18. 18 else
  19. 19 {
  20. 20 if(y - x > z) cout << "-" << endl;
  21. 21 else cout << "?" << endl;
  22. 22 }
  23. 23 }
  24. 24 return 0;
  25. 25 }

转载于:https://www.cnblogs.com/Carered/p/11182374.html

发表评论

表情:
评论列表 (有 0 条评论,349人围观)

还没有评论,来说两句吧...

相关阅读