ABC111A - AtCoder Beginner Contest 999
問題:A - AtCoder Beginner Contest 999
#include <iostream> #include <string> using namespace std; #define REP(i, n) for (int i = 0; i < (n); ++i) int main(void) { string n; cin.tie(0); ios::sync_with_stdio(false); cin >> n; REP(i, n.length()) { if (n[i] == '1') { n[i] = '9'; } else if (n[i] == '9') { n[i] = '1'; } } cout << n << "\n"; return 0; }