Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
33156 | 武云帆 | 【J】T2 | C++ | 通过 | 100 | 4 MS | 892 KB | 521 | 2024-10-04 16:06:15 |
#include<bits/stdc++.h> using namespace std; string s; int a[100010]; int main(){ //freopen("number.in","r",stdin); //freopen("number.out","w",stdout); ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin>>s; s=' '+s; int t=9-(s[1]-'0'); a[1]=9; int w=1; cout<<a[1]; for(int i=2;i<s.size();i++){ a[i]=s[i]-'0'; a[i]+=t; a[i]%=10; if(a[i]!=9&&w==1){ a[i]+=1; w=-1; } cout<<a[i]; } }