#include <iostream>
using namespace std;
int main()
{
for(double i = 1; i <=25; ++i)
{
if(((int)i-1)%5==0)
{
cout << endl;
}
cout << "Earth - " << i << ", moon - " << i*0.17 << endl;
}
cin.get();
}
14 задание#include <iostream>
using namespace std;
int main()
{
double num,sum=0;
for(int i=0; i < 5;++i)
{
cout << "Enter number #" << i+1 << " -> ";
cin >> num;
sum+=num;
}
cout << "Average: " << sum/5 << endl;
cin.get();
cin.get();
}
#include <iostream>
using namespace std;
int main()
{
for(double i = 1; i <=25; ++i)
{
if(((int)i-1)%5==0)
{
cout << endl;
}
cout << "Earth - " << i << ", moon - " << i*0.17 << endl;
}
cin.get();
}
14 задание#include <iostream>
using namespace std;
int main()
{
double num,sum=0;
for(int i=0; i < 5;++i)
{
cout << "Enter number #" << i+1 << " -> ";
cin >> num;
sum+=num;
}
cout << "Average: " << sum/5 << endl;
cin.get();
cin.get();
}
Program Matr22;
Uses Crt;
type matrix=array[1..5,1..5] of integer;
var m:matrix;
n:byte;
procedure Auto;
var i,j:integer;
begin
n:=0;
randomize;
for i:=1 to 5 do
begin
for j:=1 to 5 do
begin
m[i,j]:=random(50)+5;
if (m[i,j]=22) then n:=n+1;
end;
end;
end;
procedure PrintMatrix(mas:matrix;);
var j,k:integer;
begin
for k:=1 to 5 do
begin
for j:=1 to 5 do
begin
write(mas[k,j]:3);
end;
writeln;
end;
end;
begin
clrscr;
Auto;
PrintMatrix(m);
writeln;
writeln('Количество элементов равных 22:',n);
readkey;
end.