prompt
string
response
string
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include <bits/stdc++.h> using namespace std; //Compiler version g++ 6.3.0 int main() { int a; cin >> a; cout << 1110-a << endl; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // 整数の入力 String a = sc.next().replaceAll("1", "a").replaceAll("9", "1").replaceAll("a", "9"); System.out.println(a); } }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); String s=sc.next(); System.out.println(s.replace('9','o').replace('1', '9').replace('o', '1')); } }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; public class Main{ public static int Int(int a) { int i=0; if(a==9) { i=1; } else { i=9; } return i; } public static void main(String[] args) { Scanner scan = new Scanner(System.in); int a=scan.nextInt(); int b=Int(a%10); a/=10; int c=Int(a%10); a/=10; int d=...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import sys from collections import deque import copy def get_read_func(fileobject): if fileobject == None : return raw_input else: return fileobject.readline def is_all_same(S): pre_s = S[0] for s in (S): if s != pre_s: return False return True def main(): ...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include <iostream> using namespace std; int main() { char s[5]; cin>>s; for(int i=0;i<3;i++) s[i] = s[i] == '9' ? '1' : '9'; puts(s); return 0; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; public class Main { /** 数字の和 */ private static final int SUM = 999 + 111; public static void main(String[] args) { try (Scanner scanner = new Scanner(System.in)) { int n = scanner.nextInt(); System.out.println(SUM - n); } } }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
print(input().replace("1","a").replace("9","1").replace("a","9"))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include <bits/stdc++.h> using namespace std; int main() { int nb; cin >> nb; cout << 1110 - nb << endl; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include<iostream> using namespace std; int main() { int n,x[3]; cin>>n; for(int i=0;i<3;i++) { x[i]=n%10; n/=10; } for(int i=2;i>=0;i--) cout<<10-x[i]; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
print(input().replace("9", "t").replace("1", "9").replace("t", "1"))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include<iostream> using namespace std; int main(){ int a; cin>>a; cout<<1110-a<<endl; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include <cstdio> int main(void){ int n; scanf("%d", &n); printf("%d\n", 1110 - n); }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String a = sc.next(); int ans = 0; int q = 0; for(int i = 0; i < 3; i++){ System.out.print(10 - Character.getNumericValue(a.charAt(i))); } } }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
S = int(input()) print(1110-S)
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
print(input().replace('1','2').replace('9','1').replace('2','9'))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
print(input().replace('1','X').replace('9','1').replace('X', '9'))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
print(input().replace('9', 't').replace('1','9').replace('t','1'))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int ans = 1110 - n; cout << ans << endl; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#import<iostream> int main(){int a;std::cin>>a;std::cout<<1110-a;}
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
n = raw_input() result = [] for i in range(0, len(n)): if(n[i] == '1'): result.append('9') elif(n[i] == '9'): result.append('1') else: result.append(n[i]) ans = ''.join(result) print (ans)
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
print(''.join(['1' if i == '9' else '9' for i in input()]))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#copy n = int(input()) print(1110 - n) #あたまいいすごい
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.*; import static java.lang.System.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(in); String s=sc.next(); s=s.replace("9","-"); s=s.replace("1","9"); s=s.replace("-","1"); out.pr...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
print(input().replace("9","2").replace("1","9").replace("2","1"))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; public class Main { public static void main(String args[]) { System.out.println(new Scanner(System.in).nextLine().replace("1", "T").replace("9", "1").replace("T", "9")); } }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String n = sc.next(); String ans = ""; for(int i = 0; i < 3; i++) { if(n.charAt(i) == '1') ans += '9'; else ans += '1'; } System.out.println...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
print(input().replace("1","t").replace("9","1").replace("t","9"))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
n = raw_input() l = [] for i in n: if i == '1': l.append('9') elif i == '9': l.append('1') else: l.append(i) print(''.join(l))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main{ public static void main(String[] args)throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = br.readLine(); s = s.replace('1','x'); s = s.replace('9','1'); s = s.replace('x','9...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); String n = sc.next(); char c[] = n.toCharArray(); sc.close(); for (int i = 0; i < 3; i++) { if (c[i] == '1') { c[i] = '9'; } else if (c[i] == '9') { c[i] = '1'; } } ...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
print(''.join(['9' if n == '1' else '1' for n in list(input())]))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include<iostream> using namespace std; int main(int argc, char const *argv[]) { int a; cin>>a; cout<<1110-a; return 0; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include<bits/stdc++.h> using namespace std; int main(){ int s; cin >> s; s=1110-s; cout << s << endl; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int i = 1; int ans = 0; while (n != 0) { ans += i*(n % 10 == 1 ? 9 : 1); n /= 10; i *= 10; } System.out.println(ans); }...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int ans = 0; int conf = 0; for (int i = 0; i < 3; i++) { if ((n / (int)Math.pow(10, i)) % 10 == 1) { ans += 9 * Math.pow(10, i); }...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
n = int(input()) print(1110-n)
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include<bits/stdc++.h> using namespace std; int main(){ int a;cin>>a; cout<<1110-a;}
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.next(); int length = str.length(); for (int i = 0; i < length; i++) { if(str.charAt(i) == '1') System.out.print(9); els...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); sc.close(); String num = Integer.toString(n); String[] line = num.split(""); for(int i = 0; i < num.length(); i++) { if(line[i].equals("1"))...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
print(input().replace('1', '_').replace('9', '1').replace('_', '9'))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
print("".join({"1": "9", "9": "1"}[i] for i in input()))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); char a[] = sc.nextLine().toCharArray(); for(int i = 0;i<a.length; i++) { if(a[i] == '9') a[i] = '1'; else a[i] = '9'; } System.out.println(a); ...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; import java.util.Comparator; import java.util.PriorityQueue; import java.util.Arrays; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); char[] a = sc.next().toCharArray(); String Ans = ""; for (int i=0;i<3;i++){...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String a = sc.next(); for(int i = 0; i < 3; i++){ System.out.print(10 - Character.getNumericValue(a.charAt(i))); } } }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String[] n=sc.next().split(""); for(int i=0;i<3;i++) { System.out.print(Integer.valueOf(n[i])==1?"9":"1"); } } }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include <iostream> using namespace std; int main(){ string c; cin>>c; for(int i=0;i<3;i++){ if(c.at(i)=='1') cout<<9; else cout<<1; }}
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String s = scanner.next(); s = s.replace('1', '0'); s = s.replace('9', '1'); s = s.replace('0', '9'); System.out.println(s); } }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.*; import static java.lang.Math.*; import java.math.BigInteger; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // 入力 String n = sc.next(); // 計算 // 出力 for(int i = 0; i < n.length(); i++){ if(n.charAt(i) == '1' ) System.out....
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; cout << 1110 - N << endl; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
n = input() print("".join([str(10 - int(i)) for i in n]))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; public class Main { @SuppressWarnings("resource") public static void main(String args[]) { Scanner scanner = new Scanner(System.in); String s=String.valueOf(scanner.nextInt()); String ans=""; for(int i=0;i<3;i++) { char c=s.charAt(i); if(c=='1')ans+="9"; else ans+="1"; ...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include <cstdio> int main() { int n; scanf("%d", &n); printf("%d\n", 1110 - n); return 0; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String input = scan.nextLine(); String replace = ""; String m; for(int i=0; i<input.length(); i++) { if(input.charAt(i) == '1') { m = "9"; } else { m = "1"; } r...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include <cstdio> #include <iostream> using namespace std; int main() { int n; cin>>n; cout<<1110-n<<endl; return 0; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
print(input().translate({49:57,57:49}))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include<bits/stdc++.h> using namespace std; int main(){ int a; scanf("%d",&a); printf("%d\n",1110-a); return 0; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
a,b,c = input() d = {"1":"9", "9":"1"} print(d[a]+d[b]+d[c])
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include<iostream> int main() { int i; std::cin >> i; std::cout << 1110 - i << std::endl; return 0; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.*; public class Main{ public static void main(String[]args){ Scanner sc = new Scanner(System.in); String S = sc.nextLine(); char[] n = new char[3]; for(int i =0;i<3;i++){ n[i]=S.charAt(i); } for(int i =0;i<3;i++){ if(n[i]=='1'){ n[i...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
K = int(input()) print(1110-K)
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); if(n / 100 == 9) n -= 800; else n += 800; if((n%100) / 10 == 9) n -= 80; else n += 80; if((n%10) / 1 == 9) n -= 8; ...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
# coding:utf-8 a = int(raw_input()) #print a a1 = a/100 #100の位 a = a%100 a2 = a/10 #10の位 a = a%10 a3 = a #1の位 # print a # print a1 # print a2 # print a3 if a1 == 1: a1 = 9 else: if a1 == 9: a1 = 1 if a2 == 1: a2 = 9 else: if a2 == 9: a2 = 1 if a3 == 1: a3 = 9 else: i...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String strN = scan.next(); char[] nArray = strN.toCharArray(); for (int i=0;i<nArray.length;i++) { if (nArray[i] == '1') { nArray[i] = '9'; } else { nArray[i] = '1'; }...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; for(int i=0;i<3;i++){ if(s[i]=='1')cout<<9; else cout<<1; } cout<<"\n"; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
n = input() for c in n: print(10-int(c),end='') print()
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int s=sc.nextInt(); System.out.println(1110-s); } }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
a=input() print(a.translate(str.maketrans({'9': '1', '1': '9'})))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
n = raw_input() ans = '' for i in range(0, 3): if n[i] == '1': ans = ans + '9' else: ans = ans + '1' print ans
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
print(input().replace('1', 'a').replace('9', '1').replace('a', '9'))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
str1 = raw_input().replace("\n", "") str2 = str1.replace("1", "A").replace("9", "B") str3 = str2.replace("A", "9").replace("B", "1") print str3
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
d={'1':'9', '9':'1'} print(''.join(d[c] for c in input()))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
print(input().translate(str.maketrans({'1': '9', '9': '1'})))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.*; import java.math.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // 整数の入力 int n = sc.nextInt(); int result =0; result += n/100==1? 900:100; result += (n/10)%10==1? 90:10; result += n%10==1? 9:1; System.out.println(result); } ...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); String[] a = sc.next().split(""); for (int i = 0; i < a.length; i++) { if (a[i].equals("1")) { a[i] = "9"; } else { ...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
print(input().replace("1","x").replace("9","1").replace("x","9"))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s=sc.nextLine(); char c[]=s.toCharArray(); for(int i=0;i<3;i++){ if(c[i]=='1'){ c[i]='9'; }else{ c[i]='1'; } } for(int i=0;i<=2;i++){ System.out.print(c[i]); } System.out.printl...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include <cstdio> using namespace std; int main() { char c,d,e; scanf("%c%c%c",&c,&d,&e); c^=8;d^=8;e^=8; printf("%c%c%c",c,d,e); return 0; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
print(''.join(map(lambda x: str(10 - int(x)), input())))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); String N = sc.next(); for (int i = 0; i < 3; i++) { if (N.charAt(i) == '1') { System.out.print(9); } else if (N.charAt(i) == '9') { System.out.p...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); String s=sc.next(); for(int i=0;i<3;i++){ if(s.charAt(i)=='1'){ System.out.print(9); }else if(s.charAt(i)=='9'){ System.out.print(1); }else{ Syste...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); String n = scan.next(); String ans = ""; for(int i = 0; i < 3; i++){ if(n.charAt(i) == '9'){ ans += "1"; }else{ ans += "9"; } } System.out.println(ans); }...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int a=n/100; //百の位 int b=n/10-a*10; //十の位 int c=n-a*100-b*10; //一の位 if(a==9){ a=1; }else{ a=9; } if(b==9){ b=1; }else{ b=9; } if(c==9){ c=1...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); System.out.println(1110 - n); sc.close(); } }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include <iostream> using namespace std; int main(){ int n; cin >> n; cout << (1110 - n) << endl; return 0; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
s = input() print(int(''.join(['1' if c=='9' else '9' for c in s])))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String n = sc.nextLine(); n = n.replaceAll("1","a"); n = n.replaceAll("9","b"); n = n.replaceAll("a","9"); n = n.replaceAll("b","1"); System.out.p...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
print(*["1" if s == "9" else "9" for s in input()], sep='')
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String replace = String.valueOf(n); replace = replace.replace("1", "x"); replace = replace.replace("9", "1"); replace = replace.replace("x", "9"); System...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
n = input() print("".join("1" if s=='9' else "9" for s in n))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
n = input() print(''.join('9' if c == '1' else '1' for c in n))
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include<iostream> #include<cstdio> using namespace std; int main(){ int n; cin>>n; int a=n/100; int b=n/10%10; int c=n%10; cout<<10-a<<10-b<<10-c<<endl; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include <iostream> using namespace std; int main() { int n; cin >> n; cout << 1110 - n << endl; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int ans = 111+999-n; cout << ans << endl; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.Scanner; import java.util.List; import java.util.ArrayList; import java.util.Collections; import java.util.List; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String a = sc.next(); a=a.replace("1","q"); a=a.replace("9","l"); a=a.replace("q","9"...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include <bits/stdc++.h> using namespace std; int main(void) { int n; cin >> n; cout << 10 - (n / 100) << 10 - (n / 10 % 10) << 10 - n % 10 << endl; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (int)n; i++) using namespace std; int main() { int n; cin >> n; cout << 1110 - n << endl; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
#include <bits/stdc++.h> #define rep(i,n) for (int (i) = 0; (i) < (n); (i)++) using namespace std; int main() { int n; cin >> n; cout << 1110 - n << endl; }
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.*; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String text = scanner.nextLine(); StringBuilder result = new StringBuilder(); for (int ix = 0; ix < text.length(); ix++) { if (text.charAt(ix) == '9') { result.ap...
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around. You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n. Constraints * 111 \leq n \l...
import java.util.*; import java.math.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); String ans = ""; String s = String.valueOf(N); for(int i=0;i<s.length();i++) { if(s.charAt(i)=='1') ans = ans+'9'; if(s.charAt(i) == ...