标签:
看一眼就知道的题目往往还要再看看题意....不然白白WA后悔死了
#include<cstdio> #include<cstring> #include <iostream> #include<queue> #include <cmath> using namespace std; const int maxn=65000+10; const int INF=1<<30; typedef long long LL; int main() { string str; while(cin>>str) { int len = str.length(); for(int i = 0; i < len; i++) { if(i == 0 && str[i] == '9') continue; if(str[i]-'0' > 9 - (str[i] - '0')) str[i] = '9' - (str[i] - '0'); } cout<<str<<endl; } return 0; }
Codeforces Round #291 (Div. 2)(A)
标签:
原文地址:http://blog.csdn.net/u013445530/article/details/43844577