Advertisement
NLinker

python parsing stuff

Jul 26th, 2017
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. import re
  2.  
  3. if __name__ == "__main__":
  4.     with open("i.in") as fin:
  5.         s = fin.read()
  6.     xs = re.compile("\s+").split(s)
  7.     [a, b] = list(map(int, filter(empty, xs)))
  8.     x = a + b
  9.     with open("i.out", "w") as fout:
  10.         fout.write(str(x))
  11.  
  12.  
  13. if __name__ == "__main__":
  14.     a = int(input())
  15.     b = int(input())
  16.     print(a + b)
  17.  
  18.  
  19. package com.vertigo.crawler;
  20.  
  21. import java.util.Scanner;
  22.  
  23. public class Main {
  24.     public static void main(String... args) {
  25.         Scanner in = new Scanner(System.in);
  26.         int a = in.nextInt();
  27.         int b = in.nextInt();
  28.         System.out.println(a + b);
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement