Những câu hỏi liên quan
Trần Thanh Triều
Xem chi tiết
Nguyễn Lê Phước Thịnh
4 tháng 5 2021 lúc 13:43

uses crt;

var a:array[1..100]of integer;

i,n:integer;

begin

clrscr;

write('Nhap n='); readln(n);

for i:=1 to n do 

  begin

write('A[',i,']='); readln(a[i]);

end;

for i:=1 to n do 

  if a[i]>0 then write(a[i]:4);

writeln;

for i:=1 to n do

  if a[i]<0 then write(a[i]:4);

readln;

end.

Bình luận (0)
Dan Ngothi
Xem chi tiết
Nguyễn Lê Phước Thịnh
28 tháng 4 2021 lúc 19:01

uses crt;

var a:array[1..100]of integer;

i,n:integer;

begin

clrscr;

write('Nhap n='); readln(n);

for i:=1 to n do 

  begin

write('A[',i,']='); readln(a[i]);

end;

for i:=1 to n do

  if a[i] mod 2<>0 then write(a[i]:4);

readln;

end.

Bình luận (0)
Bùi Anh Tuấn
28 tháng 4 2021 lúc 19:41

Bình luận (0)
Bùi Xuân
Xem chi tiết
Nguyễn Lê Phước Thịnh
15 tháng 4 2022 lúc 9:41

#include <bits/stdc++.h>

using namespace std;

long long a[1000],n,i,x,dem;

int main()

{

cin>>n;

for (i=1; i<=n; i++) cin>>a[i];

cin>>x;

dem=0;

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

if (a[i]%x==0)

{

cout<<a[i]<<" ";

dem++;

}

cout<<endl;

cout<<dem;

return 0;

}

Bình luận (0)
Trần Thanh Triều
Xem chi tiết
Nguyễn Lê Phước Thịnh
4 tháng 5 2021 lúc 13:39

uses crt;

var a:array[1..100]of integer;

i,n:integer;

begin

clrscr;

write('Nhap n='); readln(n);

for i:=1 to n do 

  begin

write('A[',i,']='); readln(a[i]);

end;

for i:=1 to n do 

  if a[i]>0 then write(a[i]:4);

writeln;

for i:=1 to n do

  if a[i]<0 then write(a[i]:4);

readln;

end.

Bình luận (0)
Nguyễn Kim Trí
Xem chi tiết
Nguyễn Lê Phước Thịnh
4 tháng 3 2022 lúc 22:42

#include <bits/stdc++.h>

using namespace std;

long long x,n,i,ln,t;

int main()

{

cin>>n;

ln=LLONG_MIN;

t=0;

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

{

cin>>x;

ln=max(ln,x);

t+=x;

}

cout<<"So lon nhat la: "<<ln<<endl;

cout<<"Tong la: "<<t;

return 0;

}

Bình luận (0)
Nguyễn Kim Trí
Xem chi tiết
Nguyễn Lê Phước Thịnh
4 tháng 3 2022 lúc 22:41

uses crt;

var x,s,min:real;

i,n:integer;

begin

clrscr;

readln(n);

min:=-32000;

s:=1;

for i:=1 to n do 

begin

readln(x);

if min>x then min:=x;

s:=s*x;

end;

writeln('Nho nhat la: ',min:4:2);

writeln('Tich la: ',s:4:2);

readln;

end.

Bình luận (0)
Nguyễn Minh Trường
Xem chi tiết
Nguyễn Lê Phước Thịnh
10 tháng 5 2022 lúc 23:33

#include <bits/stdc++.h>

using namespace std;

double a[1000],t;

int n,i;

int main()

{

cin>>n;

for (i=1; i<=n; i++) cin>>a[i];

t=0;

for (i=1; i<=n; i++) t+=a[i];

cout<<fixed<<setprecision(2)<<t/(n*1.0);

return 0;

}

Bình luận (0)
Nguyễn Bảo Việt
Xem chi tiết
Nguyễn Lê Phước Thịnh
2 tháng 10 2021 lúc 0:18

Bài 2: 

#include <bits/stdc++.h>;

using namespace std;

int main();

{

long m,n;

cout<<"Nhap m="; cin>>m;

cout<<"Nhap n="; cin>>n;

cout<<m*n-2;

return 0;

}

Bình luận (0)
Nguyễn Tiến Dũng
Xem chi tiết
Bastkoo
4 tháng 11 2023 lúc 0:04

Program HOC24;

var a,b,c,max: integer;

begin

readln(a,b,c);

max=a;

if max>b then max=b;

if max>c then max=c;

write('So lon nhat trong 3 so la: ',max);

readln;

end.

Bình luận (0)