#include <iostream>
using namespace std;
#define ll long long
#define ld long double
signed main(){
const ll n = 20;
ll a[n];
for(ll i = 0; i < n; i++)
cin >> a[i];
sort(a,a+n);
ll cur_place = 10;
for(ll i = 10; i < 20; i++){
cout << cur_place <<"th place reached: " << a[i] << " scores" << "\n";
cur_place--;
}
cur_place = 11;
for(ll i = 0; i < 10; i++){
cout << cur_place <<"th place reached: " << a[i] << " scores" << "\n";
cur_place++;
}
}
1)var
chislo,max:integer ;
begin
Writeln('Введите числа');
max:=0;
Read(chislo);
while chislo <> 0 do
begin
If(chislo>max) then
max:=chislo;
Read(chislo);
end;
Writeln('Наибольшие число из веденных является ',max);
end.
2)
var
chislo,di,k:integer;
begin
Writeln('Введите число');Readln(chislo);
for di:= 1 to chislo do
begin
if((chislo mod di) = 0 ) then
begin
Writeln('Число делится на ',di);
k:=k+1;
end;
end;
if(k>2) then
Writeln('Число',chislo,' не простое');
if(k=2) then
Writeln('Число ',chislo,' простое');
end.
Объяснение:
f1, f2 :array [1..10] of integer;
i :integer;
input, output :text;
begin
assign(input,'input1.txt');
reset(input);
for i:= 1 to 10 do
read(input,f1[i]);
close(input);
assign(input,'input2.txt');
reset(input);
for i:= 1 to 10 do
read(input,f2[i]);
close(input);
assign(output,'output.txt');
rewrite(output);
for i:= 1 to 10 do
begin
writeln(output,f1[i]);
writeln(output,f2[i]);
end;
close(output);
end.