2 solutions
-
2
本题代码如下,先写出所有的可能性的判断语句,然后还有一个重点就是当n等于0时,它要输出1。希望给一个赞。不像某些人,要写小文章去我的资料写!
#include <bits/stdc++.h> using namespace std; int main() { int R; cin >> R; if (R == 0) cout << 1; else if (1 <= R && R < 99) cout << 100 - R; else if (100 <= R && R < 199) cout << 200 - R; else if (200 <= R && R < 299) cout << 300 - R; return 0; }
Information
- ID
- 18091
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 2
- Tags
- # Submissions
- 95
- Accepted
- 62
- Uploaded By