. : z _ .
dpr pascal cpp C++
:
Borland Delphi 7.0 | dcc32 cc!.dpr | |
Microsoft Visual C++.NET 2003 | cl!.cpp |
, 2301 . z2301_4.dpr ( Pascal dpr, dpr).
. . .
, , !
, . STL ( ++).
, , . , . , txt! , !
, , .
, ( Windows 7 alt).
, , .
.
. , . . , .
Pascal ABC. , , , , , , strtoint inttostr.
:
16- ;
;
/, , , , , , / ;
|
|
;
GUI (, ..);
(, ..);
, .
, sum.in sum.out .
Pascal | C++ |
Program Summa; Const InFile = sum.in; OutFile = sum.out; Var A, B: LongInt; Begin Assign(InPut, InFile); ReSet(InPut); Assign(OutPut, OutFile); ReWrite(OutPut); Read(A, B); Write(A + B); Close(Output); End. | #include <vector> #include <string> #include <algorithm> #include <iostream> #include <fstream> #include <sstream> #include <cmath> using namespace std; int main() { ifstream infile ("sum.in"); ofstream outfile ("sum.out"); long a, b; infile >> a >> b; outfile << a + b; return 0; } |
1. MCA. 100 .
test.in | |
test.out | |
1 | |
16 |
ACM, . MCA. . . , . , , . , , ( , ). - , . - MCA .
.
T - P - (1 ≤ T ≤ 10, 1 ≤ P ≤ 10). 1 T, P . P [1,100] - , . S (1 ≤ S ≤ 200) - . S
lt; > < > A|R
A (Accepted) , , R (Rejected) , . .
.
. T , .
:
test.in | test.out | test.in | test.out | |
2 2 5 10 1 A A 2 B A | 2 10 1 5 | 2 2 5 10 1 B A 2 B A 1 A R | 2 10 1 10 | |
test.in | test.out | test.in | test.out | |
3 3 5 5 5 1 A A 1 B R 2 B A 2 C R 3 C A | 3 5 1 5 2 5 | 2 3 5 5 10 1 A A 1 B A 2 C A | 2 10 1 10 |
2. . 100 .
|
|
add.in | |
add.out | |
1 | |
16 |
, . . . . , , :
, , , , . , , :
,
, , N N .
.
N (1 ≤ N ≤ 1000). N. 10000.
.
, "YES", "NO".
:
add.in | add.out |
4 -1 6 7 2 9 1 -4 3 | YES |
add.in | add.out |
1 4 3 5 | NO |
add.in | add.out |
3 6 2 5 | YES |
, .
3. . 100 .
number.in | |
number.out | |
1 | |
16 |
. , , . . , , . , . , 1, 22, 30303 , 453 . N . , .
.
N <= 30000.
.
.
:
number.in | number.out |
number.in | number.out |
number.in | number.out |
4. . 100 .
sqr.in | |
sqr.out | |
1 | |
16 |
. n m , . . , 1.
c N M , 0 1 , . , . , . , (2, 20) (20, 2), 2 20.
|
|
.
N M (N,M<= 1000).
N M .
.
.
:
sqr.in | Sqr.out |
3 3 0 1 1 1 1 1 0 1 0 | 1 2 |
5. . 100 .
arh.in | |
arh.out | |
1 | |
16 |
. , , . . - 27 - 28 . :
1. n 28 .
2. , , 1.
3. 1 , ( ) .
, , , n ( ), , . . 28. .
- , .
.
arh.in n (0<n<10) - .
n 28 , .
30. .
.
.
:
arh.in | arh.out |
0 0 0 0 16416 0 0 8192 1 0 0 4 1152 0 2056 0 0 32768 0 4096 0 16 0 0 256 0 578 0 | I LOVE MY MOTHER. |
arh.in | arh.out |
0 0 0 0 2 0 0 1 0 0 0 12 0 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | HELLO. |
. .