Перевод Программы Из Паскаля На C

FaRReLL

New Member
07.12.2014
4
0
22
#1
Код:
program vlad;
uses crt;
var
flag,i,n:integer;
a:array[1..100] of real;
begin
clrscr;
flag:=0;
write('Vvedite N ot 2 do 100; ');
readln(N);
for i:=1 to n do
begin
write('Vvedite ',i,'-i element: ');
readln(a[i]);
end;
i:=1;
while (i<n) and (a[i]<a[succ(i)]) do
inc(i);
if i=n then
flag:=2;
case flag of
1:writeln('Massiv yporadochen po vozrostaniu ');
2:writeln('Massiv yporadochen po ybivaniu');
else
writeln('Massiv neyporadochen. ');
end;
readln;
end.