Program qw;
uses crt;
Type
Atlas=Record
country,capital:string;
area,people:real;
end;
ps=File of atlas;
Var f:ps;
z,t:atlas;
Begin
assign(f,'1.dat');
rewrite(f);
z.country:='Латвия'; z.area:=67.7;
z.people:=2.6; z.capital:='Рига';
write(f,z);
z.country:='Литва'; z.area:=65.2;
z.people:=3.4; z.capital:='Вильнюс';
write(f,z);
z.country:='Польша'; z.area:=313;
z.people:=34.8; z.capital:='Варшава';
write(f,z);
z.country:='Украина'; z.area:=603.7;
z.people:=50; z.capital:='Киев';
write(f,z);
z.country:='Россия'; z.area:=17075.4;
z.people:=139; z.capital:='Москва';
write(f,z);
Close(f);
assign(f,'1.dat');
reset(f);
read(f,t);
while not(eof(f)) do
begin
read(f,z);
if t.people/t.area < z.people/z.area then t:=z;
end;
close(f);
writeln('Cтранa с наибольшей плотностью населения:');
writeln(t.country,' (плотность населения равна ',t.people/t.area:9:6,' млн на кв.км)');
end.
#include <cmath>
#include <iostream>
int perevod(bool a, int minutes)
{
if (a)
{
return floor(static_cast<float>(minutes) / 60);
}
else
{
return minutes % 60;
}
}
int main()
{
int hours, hours1, hours2;
int minutes, minutes1, minutes2;
std::cin >> hours >> minutes;
std::cin >> hours1 >> minutes1;
std::cin >> hours2 >> minutes2;
int temp = minutes + minutes1 + minutes2;
minutes = perevod(0, temp);
hours += perevod(1, temp) + hours1 + hours2;
std::cout << hours << " " << minutes;
return 0;
}
// Mingw
Sub Zadanie()
n = CInt(InputBox("n ="))
for i = 1 to n
t = i
s = 0
Do While t > 0
s = s + (t mod 10)^3
t = t \ 10
Loop
if i=s then MsgBox i
next
End Sub
Public static void SomeAction()
{
int number = 0;
int sum = 0;
<span>int num = int.Parse(Console.ReadLine());</span>
while (num != 0)
{
if (num % 5 == 0 && num % 7 != 0)
{
sum += num;
number++;
}
num = int.Parse(Console.ReadLine());
}
Console.WriteLine("Количество требуемых чисел: " + number);
Console.WriteLine("Их сумма: " + sum);
}
1)8*1024*1024*1024=8589934592
2)8589934592/2400=3579139 - страниц поместиться.
2)3579139/100=35791 см=35,8м=36м