Bạn chưa đăng nhập. Vui lòng đăng nhập để hỏi bài

Những câu hỏi liên quan
Tuấn Trần thị
Xem chi tiết
Kiều Vũ Linh
10 tháng 5 2023 lúc 17:46

Var a:array:[1..1000] of integer;

i,n,max:integer;

Begin

Write('Nhap so luong phan tu n = ');readln(n);

For i:=1 to n do

Begin

Write('Nhap diem thu ',i,' = ');readln(a[i]);

End;

Write('Cac diem vua nhap la: ');

For i:=1 to n do 

Write(a[i]:8);

writeln;

max:=a[1];

For i:=2 to n do

if a[i] > max then max:=a[i];

write('So lon nhat la ',max);

Readln

End.

Long Nguyễn
Xem chi tiết
Yết Thiên
Xem chi tiết
Trúc Giang
12 tháng 5 2021 lúc 9:55

Câu 2:

Program nii;

Uses crt;

Var a,b,c,A:integer;

Begin

Write ('nhap a');

Readln (a);

Write ('nhap b');

Readln (b);

Write ('nhap c');

Readln (c);

A:=a;

If A<b then A:=b;

If A<c then A:=c;

Write ('Ket qua',A);

Readln;

End.

Trúc Giang
12 tháng 5 2021 lúc 9:51

Câu 1

Program ntg;

Uses crt;

Var A,x,y:integer;

Begin

Write ('nhap x');

Readln (x);

Write ('nhap y');

Readln ('y');

A:=x+y;

Write ('Ket qua',A);

Readln;

End.

 

Nguyễn Lê Phước Thịnh
12 tháng 5 2021 lúc 18:43

Câu 2: 

uses crt;

var a,b,c,max:integer;

begin

clrscr;

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

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

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

max:=a;

if max<b then max:=b;

if max<c then max:=c;

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

readln;

end.

Trần Văn Lượng
Xem chi tiết
Nguyễn Lê Phước Thịnh
23 tháng 4 2021 lúc 20:08

uses crt;

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

min,n,i:integer;

{----------------chuong-trinh-con-------------------}

function nn(x,y:integer):integer;

begin

if x<y then nn:=x

else nn:=y;

end;

{-----------------chuong-trinh-chinh-----------------}

begin

clrscr;

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

for i:=1 to n do 

  begin

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

end;

min:=nn(a[1],a[2]);

for i:=3 to n do 

  if min>a[i] then min:=a[i];

writeln(min);

readln;

end.

Phan Thị Thùy Ngân
Xem chi tiết
Nguyễn Lê Phước Thịnh
2 tháng 5 2021 lúc 22:29

Câu 2: 

uses crt;

var a,b:integer;

{-----------------chuong-trinh-con-------------------}

function ucln(x,y:integer):integer;

var i,uc:integer;

begin

if x<y then 

begin

uc:=1;

for i:=1 to x do 

  if (x mod i=0) and (y mod i=0) then  

begin

if uc<i then uc:=i;

end;

end

else begin

uc:=1;

for i:=1 to y do 

  if (x mod i=0) and (y mod i=0) then  

begin

if uc<i then uc:=i;

end;

end;

ucln:=uc;

end;

{--------------------------chuong-trinh-chinh------------------------}

begin

clrscr;

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

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

writeln(a,'/',b,'=',a div ucln(a,b),'/',b div ucln(a,b));

readln;

end.

Nguyễn Lê Phước Thịnh
2 tháng 5 2021 lúc 22:30

Câu 1: 

const fi='songuyen.inp'

fo='tong.out'

var f1,f2:text;

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

i,n,t:integer;

begin

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

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

n:=0;

while not eoln(f1) do 

  begin

n:=n+1;

read(f1,a[n]);

end;

t:=0;

for i:=1 to n do 

  if a[i] mod 2=0 then t:=t+a[i];

writeln(f2,t);

close(f1);

close(f2);

end.

09 Lê Quang HIếu
Xem chi tiết
Nguyễn Lê Phước Thịnh
30 tháng 4 2022 lúc 21:34

#include <bits/stdc++.h>

using namespace std;

long long n,i,x,t;

int main()

{

cin>>n;

t=0;

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

{

cin>>x;

if (x<0) t+=x;

}

cout<<t;

return 0;

}

Bảo Châu Lê
Xem chi tiết
Nguyễn Lê Phước Thịnh
24 tháng 12 2022 lúc 13:52

Câu 2:

#include <bits/stdc++.h>

using namespace std;

long long n;

int main()

{

cin>>n;

if (n>0 && n%5==0) cout<<"Phai";

else cout<<"Khong phai";

}

ʍ๏ɲ ȼhąɲ
Xem chi tiết
Nguyễn Lê Phước Thịnh
5 tháng 10 2021 lúc 23:49

Câu 1: 

uses crt;

var a,b:integer;

begin

clrscr;

readln(a,b);

write(a+b);

readln;

end.

Câu 2:

uses crt;

var a,b,c:integer;

begin

clrscr;

readln(a,b,c);

writeln(a+b-c);

readln;

end.

Nguyễn Lê Phước Thịnh
5 tháng 10 2021 lúc 23:50

Câu 3: 

uses crt;

var a,b:integer;

begin

clrscr;

readln(a,b);

writeln(a-b);

readln;

end.

Câu 4: 

uses crt;

var x,y,z:integer;

begin

clrscr;

readln(x,y,z);

writeln((x+y)*z);

readln;

end.

An An Nguyễn
Xem chi tiết