-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
92 lines (71 loc) · 1.88 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<style>body{width:60em; margin:2em auto;} h1,h2,h3,li{font-family: sans-serif;} li{margin:1em;} pre{margin:0; padding:1em; background:#e0e0e0; width:60em;}</style>
<h1>Contest Documentation</h1>
<h2>Languages and Standard Libraries</h2>
<ul>
<li><a href="c_cpp/en/index.html">C/C++</a></li>
<li><a href="java/api/index.html">Java</a></li>
<li><a href="python2/index.html">Python 2</a></li>
<li><a href="python3/index.html">Python 3</a></li>
</ul>
<h2>Sample Code</h2>
<h3>C</h3>
<pre><code>#include <stdio.h>
int main(void) {
// Read from stdin and parse the line
int a, b;
scanf("%d %d", &a, &b);
// Write to stdout
printf("%d", a + b);
return 0;
}
</code></pre>
<h3>C++</h3>
<pre><code>#include <iostream>
using namespace std;
int main() {
// Read from stdin and parse line
int a, b;
cin >> a >> b;
// Write to stdout
cout << a + b << endl;
return 0;
}
</code></pre>
<h3>Java</h3>
<pre><code>import java.io.*;
import java.util.*;
// If the class is public, its name should match the filename (e.g. "Program" in "Program.java")
class Program {
public static void main(String[] args) throws Exception {
// Read from stdin
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = in.readLine();
// Parse the line
String[] lineParts = line.split(" ");
int a = Integer.parseInt(lineParts[0]);
int b = Integer.parseInt(lineParts[1]);
// Write to stdout
System.out.println(a + b);
}
}
</code></pre>
<h3>Python 2</h3>
<pre><code># Read from stdin
line = raw_input()
# Parse the line
line_parts = line.split(" ")
a = int(line_parts[0])
b = int(line_parts[1])
# Print to stdout
print a + b
</code></pre>
<h3>Python 3</h3>
<pre><code># Read from stdin
line = input()
# Parse the line
line_parts = line.split(" ")
a = int(line_parts[0])
b = int(line_parts[1])
# Print to stdout
print(a + b)
</code></pre>