fellybrossme
?>

1. с клавиатуры вводится дата в формате чч.мм.гг. определить предыдущую дату. например, для даты 01.10.15 нужно вывести 30.09.15.

Информатика

Ответы

mgrunova3966
Var s:string;    d1,m1,g1,d2,m2,g2,t,c:integer;    p:boolean;    k:byte;begin
k:=0;
writeln('Введите дату в формате дд.мм.гг');readln(s); val(copy(s,7,2),t,c);{преобразуем год в число}if (c<>0)or(t<0) then k:=1 else g1:=t;{определим високосный год или нет}if (((g1+2000) mod 100<>0)and((g1+2000) mod 4=0))or((g1+2000) mod 400=0) then p:=trueelse p:=false;
val(copy(s,4,2),t,c);if (c<>0)or not(t in [1..12]) then k:=1 else m1:=t;
val(copy(s,1,2),t,c);if (c<>0)or((m1 in [1,3,5,7,8,10,12])and not(t in [1..31]))         or((m1 in [4,6,9,11])and not(t in [1..30]))         or(p and(m1=2)and not(t in [1..29]))         or(not p and(m1=2)and not(t in [1..28]))then k:=1 else d1:=t;if k=1 thenbeginwriteln('Дата введена неверно!');endelsebeginif(m1=1)and(d1=1)then begin  d2:=31;  m2:=12;  g2:=g1-1; end
else if ((m1 in [5,7,10,12]) and(d1=1))then begin  d2:=30;  m2:=m1-1;  g2:=g1; end
else if ((m1 in [2,4,6,8,9,11]) and(d1=1))then begin  d2:=31;  m2:=m1-1;  g2:=g1; end
else if(m1=3)and (d1=1) then begin  if p then d2:=29 else d2:=28;  m2:=m1-1;  g2:=g1; end
else begin  d2:=d1-1;  m2:=m1;  g2:=g1; end;writeln('Предыдущая дата:');if d2<10 then write('0',d2,'.')else write(d2,'.');if m2<10 then write('0',m2,'.')else write(m2,'.');write(g2);end;end.
Popova838
  present simple общие does he go to school every day? does she really like singing? is it cold today? do cats catch mice? has he got a real friend? альтернативные does she go to shool every day or once a month? do cats catch mice or dogs? is the earth round or square? is russia bigger or smaller than other countries? does he like skiing or skating? специальные what does he do at school every day? who likes dancing? when does winter come? where does she live? what does she always wait for? present progressive общие is it raining now? is the sun shining at the moment? is he writing his composition now? are they swimming in the pool at the moment? are you doing your homework? альтернативные are you doing your homework or watching tv now? is it raining or snowing now? are they flying to italy or to canada now? is he reading a book or a web-page? is she clever or not? специальные what is she looking forward for? where are they going to go next summer? when is he leaving for france? whom is she writing an e-mail? what are they doing now?
mail9

a - уровень продаж, а затем зп первого менеджераb - второго менеджераc - третьегоуровень продаж у всех разный.язык программирования: паскальvara, b, c: integer; beginreadln (a); if a < 500 thena : = 0.03 * a + 200; if (a > 500) and (a < 1000) thena : = 0.05 * a + 200; if a > 1000 thena : = 0.08 * a + 200; readln (b); if b < 500 thenb : = 0.03 * b + 200; if (b > 500) and (b < 1000) thenb : = 0.05 * b + 200; if b > 1000 thenb : = 0.08 * b + 200; readln (c);   if c < 500 thenc : = 0.03 * c + 200; if (c > 500) and (c < 1000) thenc : = 0.05 * c + 200; if c > 1000 thenc : = 0.08 * c + 200;   if (a > b) and (a > c) thena : = a +200; elseif b > c thenb : = b + 200; elsec : = c + 200; wreteln ('зп первого менеджера: ', a, '$'); wreteln ('зп второго менеджера:   ', b, '$');   wreteln ('зп третьего менеджера:   ', c, '$')end.

Ответить на вопрос

Поделитесь своими знаниями, ответьте на вопрос:

1. с клавиатуры вводится дата в формате чч.мм.гг. определить предыдущую дату. например, для даты 01.10.15 нужно вывести 30.09.15.
Ваше имя (никнейм)*
Email*
Комментарий*

Популярные вопросы в разделе

Щуплова Александр
aleksey7800
Lorik-lorik29
annarom1306
FATEEV
Vladimirovna Viktorovna
Aleksey19801
александр496
market-line5260
oloinics
skorpion7228528
yahottabych201379
Александровна1685
выбрать в каждой строке лишнее
donertime8
cleopatra1959