fork(2) download
  1. #include <iostream>
  2. #include <fstream>
  3. #include <vector>
  4. #include <string>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. const int n = 50;
  10. string a[n];
  11. string b[n];
  12.  
  13. for(int i = 0; i < n; ++i)
  14. {
  15. cin >> a[i] >> b[i];
  16. }
  17.  
  18. for(int i = 0; i < n; ++i)
  19. {
  20. cout << i << " " << stoi(a[i], 0, 2) << " " << stoi(b[i], 0, 2) << endl;
  21. }
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0s 3464KB
stdin
1100 0
100101 0
111101 0
1010101 0
1101101 0
10000100 1
10011100 1
10110101 10
11001100 10
11100100 11
11111100 100
100010101 100
100101100 100
101000101 100
101011101 100
101110100 100
110001101 11
110100100 10
110111100 0
111010100 -1
111101100 -11
1000000100 -100
1000011100 -101
1000110100 -110
1001001100 -111
1001100100 -1000
1001111101 -1000
1010010100 -1000
1010101101 -1001
1011000100 -1001
1011011100 -1010
1011110101 -1010
1100001100 -1010
1100100100 -1010
1100111101 -1010
1101010100 -1011
1101101101 -1010
1110000101 -1000
1110011100 -110
1110110100 -100
1111001100 -10
1111100101 -10
1111111101 -1
10000010101 0
10000101100 1
10001000100 10
10001011100 10
10001110100 10
10010001100 10
10010100100 10
stdout
0 12 0
1 37 0
2 61 0
3 85 0
4 109 0
5 132 1
6 156 1
7 181 2
8 204 2
9 228 3
10 252 4
11 277 4
12 300 4
13 325 4
14 349 4
15 372 4
16 397 3
17 420 2
18 444 0
19 468 -1
20 492 -3
21 516 -4
22 540 -5
23 564 -6
24 588 -7
25 612 -8
26 637 -8
27 660 -8
28 685 -9
29 708 -9
30 732 -10
31 757 -10
32 780 -10
33 804 -10
34 829 -10
35 852 -11
36 877 -10
37 901 -8
38 924 -6
39 948 -4
40 972 -2
41 997 -2
42 1021 -1
43 1045 0
44 1068 1
45 1092 2
46 1116 2
47 1140 2
48 1164 2
49 1188 2