A. Chewbaсca and Number【1200 / 贪心】
作者:互联网
https://codeforces.com/problemset/problem/514/A
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
string s; cin>>s;
for(int i=0;i<s.size();i++)
{
int a=s[i]-'0',b=9-a;
if(min(a,b)==0&&!i) continue;
s[i]='0'+min(a,b);
}
cout<<s;
return 0;
}
标签:Chewba,cout,min,int,ca,Number,1200 来源: https://blog.csdn.net/bettle_king/article/details/121526775