Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit 01c3e13

Browse files
committedJul 27, 2020
Add problem 1000
0 parents  commit 01c3e13

File tree

9 files changed

+105
-0
lines changed

9 files changed

+105
-0
lines changed
 

‎README.md

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
2+
# Description
3+
4+
<div class="content"><p>输入两个数字,输出它们之和</p></div>
5+
6+
# Input
7+
8+
<div class="content"><p>一行两个数字A,B(0&lt;=A,B&lt;100)</p>
9+
<p></p></div>
10+
11+
# Output
12+
13+
<div class="content"><p>输出这两个数字之和</p>
14+
<p></p></div>
15+
16+
# Sample Input
17+
18+
<div class="content"><span class="sampledata">1 2</span></div>
19+
20+
# Sample Output
21+
22+
<div class="content"><span class="sampledata">3</span></div>
23+
24+
# Hint
25+
26+
<div class="content"><p></p><p>Q: Where are the input and the output? A: Your program shall always <font color="#ff0000">read input from stdin (Standard Input) and write output to stdout (Standard Output)</font>. For example, you can use &#39;scanf&#39; in C or &#39;cin&#39; in C++ to read from stdin, and use &#39;printf&#39; in C or &#39;cout&#39; in C++ to write to stdout. You <font color="#ff0000">shall not output any extra data</font> to standard output other than that required by the problem, otherwise you will get a &#34;Wrong Answer&#34;. User programs are not allowed to open and read from/write to files. You will get a &#34;Runtime Error&#34; or a &#34;Wrong Answer&#34; if you try to do so. Here is a sample solution for problem 1000 using C++/G++:</p><br/>
27+
<pre><br/>
28+
#include <iostream></iostream><br/>
29+
using namespace std;<br/>
30+
int main()<br/>
31+
{<br/>
32+
int a,b;<br/>
33+
cin &gt;&gt; a &gt;&gt; b;<br/>
34+
cout &lt;&lt; a+b &lt;&lt; endl;<br/>
35+
return 0;<br/>
36+
}</pre><br/>
37+
<p>It&#39;s important that the return type of main() must be int when you use G++/GCC,or you may get compile error. Here is a sample solution for problem 1000 using C/GCC:</p><br/>
38+
<pre><br/>
39+
#include <stdio.h></stdio.h><br/>
40+
<br/>
41+
int main()<br/>
42+
{<br/>
43+
int a,b;<br/>
44+
scanf(&#34;%d %d&#34;,&amp;a, &amp;b);<br/>
45+
printf(&#34;%d\n&#34;,a+b);<br/>
46+
return 0;<br/>
47+
}</pre><br/>
48+
<p>Here is a sample solution for problem 1000 using PASCAL:</p><br/>
49+
<pre><br/>
50+
program p1000(Input,Output); <br/>
51+
var <br/>
52+
a,b:Integer; <br/>
53+
begin <br/>
54+
Readln(a,b); <br/>
55+
Writeln(a+b); <br/>
56+
end.</pre><br/>
57+
<p>Here is a sample solution for problem 1000 using JAVA: Now java compiler is jdk 1.5, next is program for 1000</p><br/>
58+
<pre><br/>
59+
import java.io.*;<br/>
60+
import java.util.*;<br/>
61+
public class Main<br/>
62+
{<br/>
63+
public static void main(String args[]) throws Exception<br/>
64+
{<br/>
65+
Scanner cin=new Scanner(System.in);<br/>
66+
int a=cin.nextInt(),b=cin.nextInt();<br/>
67+
System.out.println(a+b);<br/>
68+
}<br/>
69+
}</pre><br/>
70+
<p>Old program for jdk 1.4</p><br/>
71+
<pre><br/>
72+
import java.io.*;<br/>
73+
import java.util.*;<br/>
74+
<br/>
75+
public class Main<br/>
76+
{<br/>
77+
public static void main (String args[]) throws Exception<br/>
78+
{<br/>
79+
BufferedReader stdin = <br/>
80+
new BufferedReader(<br/>
81+
new InputStreamReader(System.in));<br/>
82+
<br/>
83+
String line = stdin.readLine();<br/>
84+
StringTokenizer st = new StringTokenizer(line);<br/>
85+
int a = Integer.parseInt(st.nextToken());<br/>
86+
int b = Integer.parseInt(st.nextToken());<br/>
87+
System.out.println(a+b);<br/>
88+
}<br/>
89+
}</pre><p></p></div>
90+
91+
# Source
92+
93+
<div class="content"><p><a href="problemset.php?search="></a></p></div>
94+

‎main.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"time":1000,"memory":5,"title":"A+B Problem","judge":"传统","url":"https://lydsy.com/JudgeOnline/problem.php?id=1000","description_type":"html"}

‎problem.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: A+B Problem
2+
source: bzoj (OI-Archive)
3+
time_limit: 1000
4+
space_limit: 5

‎testcase/1.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1 3

‎testcase/1.out

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4

‎testcase/2.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3 3

‎testcase/2.out

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6

‎testcase/3.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1 2

‎testcase/3.out

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3

0 commit comments

Comments
 (0)