Commit 6804cb8 1 parent 8f218c6 commit 6804cb8 Copy full SHA for 6804cb8
File tree 4 files changed +43
-0
lines changed
4 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ def solve ():
2
+ a , b = input ().split (' ' )
3
+ a , b = int (a ), int (b )
4
+ print (a + b )
5
+ print (a - b )
6
+ print (a * b )
7
+ print (a // b )
8
+ print (a % b )
9
+
10
+ if __name__ == '__main__' :
11
+ solve ()
Original file line number Diff line number Diff line change
1
+ 7 3
Original file line number Diff line number Diff line change
1
+ 10
2
+ 4
3
+ 21
4
+ 2
5
+ 1
Original file line number Diff line number Diff line change
1
+ import sys
2
+ from pathlib import Path
3
+ from unittest import TestCase
4
+ from main import solve
5
+
6
+ def my_solve (testcase_input ):
7
+ sys .stdin = open (testcase_input , 'r' )
8
+ stdout = sys .stdout
9
+ sys .stdout = open ('stdout.txt' , 'w' )
10
+ solve ()
11
+ sys .stdout .close ()
12
+ sys .stdout = stdout
13
+
14
+ class Test (TestCase ):
15
+ def test1_solve (self ):
16
+ my_solve ('test1.txt' )
17
+ self .assertEqual (
18
+ Path ('test1_answer.txt' ).read_text ().strip (),
19
+ Path ('stdout.txt' ).read_text ().strip ())
20
+
21
+ class Test (TestCase ):
22
+ def test1_solve (self ):
23
+ my_solve ('test1.txt' )
24
+ self .assertEqual (
25
+ Path ('test1_answer.txt' ).read_text ().strip (),
26
+ Path ('stdout.txt' ).read_text ().strip ())
You can’t perform that action at this time.
0 commit comments