Відповідь:
Пояснення:
//Реализация задачи №1 "A+B" на C
#include < stdio.h >
long a,b;
int main(){
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
scanf("%ld%ld",&a,&b);
printf("%ld",a+b);
return 0;
}
7
{Реализация задачи №1 "A+B" на Pascal}
var a, b : longint;
begin
assign(input, 'input.txt'); reset(input);
assign(output, 'output.txt'); rewrite(output);
read(a, b);
write(a + b);
end.
//Реализация задачи №1 "A+B" на Java
import java.util.*;
import java.io.*;
public class Main{ //имя класса должно быть Main
public static void main(String[] argv) throws IOException{
new Main().run();
}
PrintWriter pw;
Scanner sc;
public void run() throws IOException{
sc = new Scanner(new File("input.txt"));
int a=sc.nextInt(), b=sc.nextInt();
pw = new PrintWriter(new File("output.txt"));
pw.print(a+b);
pw.close();
}
}
'Реализация задачи №1 "А+В" на Basic
open "input.txt" for input as #1
open "output.txt" for output as #2
input #1,a#,b#
print #2,a#+b#
close #1
close #2
n=5;
Var
ar:array[1..n] of integer;
ar2:array[1..n] of integer;
i,k:integer;
function prost(a:integer):boolean;
var i:integer;
b:boolean;
begin
b:=true;
for i:=2 to a div 2 do
if a mod i=0 then
begin;
b:=false;
break;
end;
if a=1 then b:=false;
prost:=b;
end;
begin;
randomize;
k:=0;
for i:=1 to n do
begin;
ar[i]:=random(101);
write(ar[i]:4);
end;
writeln;
for i:=1 to n do
if prost(ar[i]) then
begin;
inc(k);
ar2[k]:=ar[i];
write(ar2[k]:4);
end;
end.