Problem L. Omar’s Bug【分类讨论】
题意
题解
AC-Code
#include using namespace std;int main() { int T; cin >> T; while (T--) { int n, x, y; cin >> n >> x >> y; if (x <= n && y == 1) { for (int i = 1; i <= x - 1; ++i) cout << i << " "; for (int i = x + 1; i <= n; ++i) cout << i << " "; cout << n + 1; } else if (x > n && y == 1) { for (int i = 1; i <= n - 1; ++i) cout << i << " "; cout << n; } else if (x <= n && y == 2) { for (int i = 1; i <= n - 1; ++i) cout << i << " "; cout << n; } else if (x > n && y == 2) { for (int i = 1; i <= n - 1; ++i) cout << i << " "; cout << x; } cout << endl; } return 0;}
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
暂时没有评论,来抢沙发吧~