Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
24283 | xiaochengyi | [acwing]下一个 | C++ | 解答错误 | 0 MS | 252 KB | 396 | 2023-07-22 15:23:39 |
#include<bits/stdc++.h> using namespace std; int main(){ int x,x1,x2,x3,x4; cin>>x; x1=x%1000%100%10; x2=(x-x1)%1000%100/10; x3=(x-x1-x2)%1000/100; x4=(x-x1-x2-x3)/1000; if(x3==9&&x1!=0&&x2!=0){ cout<<x4+1<<0<<0<<0; } else if(x4==9&&x1!=0&&x2!=0&&x3!=0) cout<<10000; else if(x4!=9&&x3!=9&&x2==9&&x1!=9) cout<<x4+1<<x3+1<<00; else cout<<x4+1<<x3+1<<x2+1<<x1+1; }