Những câu hỏi liên quan
Lê Đăng Khôi
Xem chi tiết
Nguyễn Lê Phước Thịnh
21 tháng 2 2023 lúc 15:39

1:

uses crt;

var t,x,i,n:integer;

begin

clrscr;

t:=0;

n:=10;

for i:=1 to n do

begin

readln(x);

t:=t+x;

end;

write(t);

readln;

end.

2: 

uses crt;

var dem,x,i,n:integer;

begin

clrscr;

dem:=0;

n:=10;

for i:=1 to n do

begin

readln(x);

if x mod 2=0 then inc(dem);

end;

write(dem);

readln;

end.

Bình luận (1)
Lê Chiêu Nguyên	Vũ
4 tháng 4 2023 lúc 10:18

3

program Cacsole;
uses crt;
var M, N, i: integer;
begin
clrscr;
write ('Nhap M= '); readln(M);
write ('Nhap N= '); readln(N);
for i := M to N do

if  i mod 2 = 1 then
write (i,' ');
readln;
end.

Bình luận (1)
Dung
Xem chi tiết
Nguyễn Lê Phước Thịnh
30 tháng 3 2022 lúc 20:25

#include <bits/stdc++.h>

using namespace std;

long long a,b;

//chuongtrinhcon

long long ucln(long long a,long long b)

{

if (b==0) return(a);

else return(ucln(b,a%b));

}

//chuongtrinhchinh

int main()

{

cin>>a>>b;

cout<<ucln(a,b);

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)
Thư Huỳnhh
Xem chi tiết
Nguyễn Anh Dũng
9 tháng 12 2021 lúc 20:04

var m,n: integer;

begin

    writeln(' nhap so nguyen a: ');

    read(a);

    writeln(' nhap so nguyen b: ');

    read(b);

    writeln((m + n)/2);

    readln;

end.

Bình luận (0)
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ình luận (0)
Hưng Quốc
Xem chi tiết
HT.Phong (9A5)
31 tháng 3 2023 lúc 16:51

1. Uses crt;

var n,i: integer;

begin clrscr;

readln(n);

for i:=1 to n do write(i:3);

readln;

end.

2. Uses crt;

var n,i: integer;

begin clrscr;

readln(n);

for i:=1 to n do if(i mod 2 = 0) then write(i:3);

readln;

end.

Bình luận (0)
láobốlaos
31 tháng 3 2023 lúc 16:54

1. Uses crt;

var n,i: integer;

begin clrscr;

readln(n);

for i:=1 to n do write(i:3);

readln;

end.

2. Uses crt;

var n,i: integer;

begin clrscr;

readln(n);

for i:=1 to n do if(i mod 2 = 0) then write(i:3);

readln;

end.

Bình luận (0)
Nguyễn Hoàng Duy
2 tháng 4 2023 lúc 16:31

1.

program InDaySoTuNhien;
var n, i: integer;
begin
   write('Nhap so nguyen duong n: ');
   readln(n);

   writeln('Day so tu 1 den ', n, ' la:');
   for i := 1 to n do
      write(i, ' ');
end.

2.

program InSoChan;
var
   n, i: integer;
begin
   write('Nhap so nguyen n: ');
   readln(n);

   writeln('Cac so nguyen chan trong khoang tu 1 den ', n, ' la:');
   for i := 1 to n do
   begin
      if i mod 2 = 0 then
         write(i, ' ');
   end;
end.

Bình luận (0)
Phạm Vy
Xem chi tiết
Nguyễn Lê Phước Thịnh
12 tháng 2 2022 lúc 10:02

#include <bits/stdc++.h>

using namespace std;

long long n,a[1000],m,i;

bool kt;

{

cin>>n;

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

cin>>m;

kt=false;

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

if (a[i]==m) kt=true;

if (kt==true) cout<<"Co";

else cout<<"Khong";

return 0;

}

Bình luận (2)
Minh Lệ
13 tháng 2 2022 lúc 23:52

Program HOC24;

var m,i,n,d: integer;

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

begin

write('Nhap N: '); readln(n);

for i:=1 to n do

begin

write('Nhap so thu ',i,': '); readln(a[i]);

end;

write('Nhap M: '); readln(m);

d:=0;

for i:=1 to N do if a[i]=m then d:=d+1;

if d<>0 then (m,' thuoc day vua nhap');

readln

end.

Bình luận (0)
NGUYỄN LÊ XUÂN THỊNH
Xem chi tiết
Kiều Vũ Linh
23 tháng 2 2023 lúc 11:23

Bài 1

Var s,i:integer;

tb:real;

Begin

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

i:=1;

s:=0;

While i<=n do

Begin

s:=s+i;

i:=i+1;

End;

tb:=s/n;

Writeln('Tong la ',s);

Write('Trung binh la ',tb:10:2);

Readln;

End.

Bình luận (1)
Kiều Vũ Linh
23 tháng 2 2023 lúc 11:27

Bài 2

Var i,n,souoc:integer;

Begin

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

i:=1;

While i <= n do

Begin

i:=i + 1;

If n mod i = 0 then souoc:=souoc + 1;

End;

If souoc = 1 then write(n,' la so nguyen to')

Else write(n,' khong la so nguyen to');

Readln;

End.

Bình luận (1)
Selena Flynn
Xem chi tiết
Nguyễn Lê Phước Thịnh
8 tháng 3 2022 lúc 23:03

c1: 

#include <bits/stdc++.h>

using namespace std;

long long i,n,s;

int main()

{

cin>>n;

s=1;

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

cout<<s;

return 0;

}

Câu 2: 

#include <bits/stdc++.h>

using namespace std;

long long i,n,s;

int main()

{

cin>>n;

s=1;

for (i=1; i<=n; i++) if (i%2==0) s=s*i;

cout<<s;

return 0;

}

Bình luận (0)
Divine 000
Xem chi tiết
Nguyễn Lê Phước Thịnh
21 tháng 2 2021 lúc 13:50

Câu 1: 

uses crt;

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

i,n,t:integer;

begin

clrscr;

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

for i:=1 to n do 

begin

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

end;

t:=0;

for i:=1 to n do 

  t:=t+a[i];

writeln('Tong cac so trong mang la: ',t);

readln;

end.

Câu 2: 

uses crt;

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

i,n,t:integer;

begin

clrscr;

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

for i:=1 to n do 

begin

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

end;

t:=0;

for i:=1 to n do 

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

writeln('Tong cac so chan la: ',t);

readln;

end.

Bình luận (0)