H24

Mn giúp mình câu 2 với ạ

NT
19 tháng 2 2022 lúc 9:23

#include <bits/stdc++.h>

using namespace std;

long long x,n,i,ln;

int main()

{

freopen("songuyen.int","r",stdin);

freopen("songuyen.out","w",stdout);

cin>>n;

ln=LLONG_MIN;

for (i=1; i<=n; i++)

{

cin>>x;

ln=max(ln,x);

}

cout<<ln;

return 0;

}

Bình luận (1)
NT
19 tháng 2 2022 lúc 10:38

const fi='songuyen.int'

fo='songuyen.out'

var f1,f2:text;

x,n,i,ln:integer;

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

readln(n);

ln:=-3200;

for i:=1 to n do 

begin

readln(x);

if ln<x then ln:=x;

end;

writeln(f2,ln);

close(f1);

close(f2);

end.

Bình luận (0)

Các câu hỏi tương tự
H24
Xem chi tiết
H24
Xem chi tiết
H24
Xem chi tiết
H24
Xem chi tiết
H24
Xem chi tiết
H24
Xem chi tiết
DA
Xem chi tiết
H24
Xem chi tiết
L1
Xem chi tiết