|
Вернуться
| 1 :-), 06 октября 2009 г. 19:58:43 | |
program Project2; Uses math; Var a,b,c:integer; Begin assign(input,'input.txt'); reset(input); assign(output,'output.txt'); rewrite(output); read(a,b,c); write(max(a,max(b,c))); end. это что в паскале такой модуль есть?
|
|
|
| 2 Присяжнюк Анатолий Васильевич, 04 октября 2009 г. 13:41:14 | |
Можно проще: ... read(a,b,c); max:=a; if (b > max) then max:=b; if (c>max) then max:=c; write(max); ...
|
|
|
| 3 Нагин Сергей Юрьевич, 04 октября 2009 г. 13:39:46 | |
Но рекомендую написать так: program Project2; Uses math; Var a,b,c:integer; Begin assign(input,'input.txt'); reset(input); assign(output,'output.txt'); rewrite(output); read(a,b,c); write(max(a,max(b,c))); end. =))Или без модуля ! Тут не обязательно каждый с каждым сравнивать....
|
|
|
| 4 Орлечук Р.Р., 04 октября 2009 г. 13:27:42 | |
|
Нагин Сергей Юрьевич спасибо!:)
|
|
|
| 5 Нагин Сергей Юрьевич, 04 октября 2009 г. 13:23:29 | |
program Project2; Var a,b,c,max:integer; Begin assign(input,'input.txt'); reset(input); assign(output,'output.txt'); rewrite(output); read(a,b,c); max:=0; if (a>=b) and (a>=c) then max:=a; if (b>=a) and (b>=c) then max:=b; if (c>=b) and (c>=a) then max:=c; write(max); end.
|
|
|
| 6 Орлечук Р.Р., 04 октября 2009 г. 13:10:43 | |
program Project2; Var a,b,c,max:integer; Begin assign(input,'input.txt'); reset(input); assign(output,'output.txt'); rewrite(output); read(a,b,c); max:=0; if (a>b) and (a>c) then max:=a; if (b>a) and (b>c) then max:=b; if (c>b) and (c>a) then max:=c; write(max); end.
|
|
|
Чтобы оставить сообщение необходимо зарегистрироваться и авторизоваться!
| |