Написать программу, которая по заданному числу дней, прошедших от начала года, определяет дату: число d и месяц m
program name;
uses crt;
var a,d,m:integer;
begin
writeln('Введите число дней');
readln(a);
d:=1+a;
m:=1;
if d<=31 then
writeln(d);
write(m);
if (d>31) and (d<=59) then
m:=m+1;
d:=d-31;
writeln(d);
write(m);
if (d>59) and (d<=90) then
m:=m+2;
d:=d-59;
writeln(d);
write(m);
if (d>90) and (d<=120) then
m:=m+3;
d:=d-90;
writeln(d);
write(m);
if (d>120) and (d<=151) then
m:=m+4;
d:=d-120;
writeln(d);
write(m);
if (d>151) and (d<=181) then
m:=m+5;
d:=d-151;
writeln(d);
write(m);
if (d>181) and (d<=212) then
m:=m+6;
d:=d-181;
writeln(d);
write(m);
if (d>212) and (d<=243) then
m:=m+7;
d:=d-212;
writeln(d);
write(m);
if (d>243) and (d<=273) then
m:=m+8;
d:=d-243;
writeln(d);
write(m);
if (d>273) and (d<=304) then
m:=m+9;
d:=d-273;
writeln(d);
write(m);
if (d>304) and (d<=334) then
m:=m+10;
d:=d-304;
writeln(d);
write(m);
if (d>334) and (d<=365) then
m:=m+11;
d:=d-334;
writeln(d);
write(m);
end.
program name;
uses crt;
var a,d,m:integer;
begin
writeln('Введите число дней');
readln(a);
d:=1+a;
m:=1;
if d<=31 then
writeln(d);
write(m);
if (d>31) and (d<=59) then
m:=m+1;
d:=d-31;
writeln(d);
write(m);
if (d>59) and (d<=90) then
m:=m+2;
d:=d-59;
writeln(d);
write(m);
if (d>90) and (d<=120) then
m:=m+3;
d:=d-90;
writeln(d);
write(m);
if (d>120) and (d<=151) then
m:=m+4;
d:=d-120;
writeln(d);
write(m);
if (d>151) and (d<=181) then
m:=m+5;
d:=d-151;
writeln(d);
write(m);
if (d>181) and (d<=212) then
m:=m+6;
d:=d-181;
writeln(d);
write(m);
if (d>212) and (d<=243) then
m:=m+7;
d:=d-212;
writeln(d);
write(m);
if (d>243) and (d<=273) then
m:=m+8;
d:=d-243;
writeln(d);
write(m);
if (d>273) and (d<=304) then
m:=m+9;
d:=d-273;
writeln(d);
write(m);
if (d>304) and (d<=334) then
m:=m+10;
d:=d-304;
writeln(d);
write(m);
if (d>334) and (d<=365) then
m:=m+11;
d:=d-334;
writeln(d);
write(m);
end.