Những câu hỏi liên quan
ngomanhcuong
Xem chi tiết
Nguyễn Lê Phước Thịnh
15 tháng 3 2022 lúc 20:25

#include <bits/stdc++.h>

using namespace std;

long long x,n,i,t,dem;

int main()

{

cin>>n;

dem=0;

t=0;

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

{

cin>>x;

if (x%2==0 && x>10) t+=x;

if (x%2!=0 || x<100) dem++;

}

cout<<t<<" "<<dem;

return 0;

}

Bình luận (0)
Tali
Xem chi tiết
Nguyễn Lê Phước Thịnh
12 tháng 4 2021 lúc 23:03

uses crt;

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

i,n,dem:integer;

begin

clrscr;

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

for i:=1 to n do

begin

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

end;

dem:=0;

for i:=1 to n do 

  if (10<a[i]) and (a[i]<20) then inc(dem);

writeln(dem);

readln;

end.

Bình luận (2)
Chira Nguyên
Xem chi tiết
Nguyễn Lê Phước Thịnh
23 tháng 2 2021 lúc 20:20

for i:=1 to n do 

  if n mod i=0 then write(i:4);

Bình luận (0)
Nguyễn Lê Phước Thịnh
23 tháng 2 2021 lúc 20:21

Chương trình đầy đủ:

uses crt;

var n,i:integer;

begin

clrscr;

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

for i:=1 to n do 

  if n mod i=0 then write(i:4);

readln;

end.

Bình luận (0)
Tali
Xem chi tiết
Nguyễn Lê Phước Thịnh
17 tháng 5 2021 lúc 9:40

Câu 4: 

uses crt;

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

i,n,dem,t:integer;

begin

clrscr;

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

for i:=1 to n do 

 begin

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

end;

dem:=0;

t:=0;

for i:=1 to n do 

  if (10<a[i]) and (a[i]<20) then 

begin

inc(dem);

t:=t+a[i];

end;

writeln('So phan tu lon hon 10 va nho hon 20 la: ',dem);

writeln('Tong cac phan tu lon hon 10 va nho hon 20 la: ',t);

readln;

end.

Bình luận (0)
Nguyễn Lê Phước Thịnh
17 tháng 5 2021 lúc 9:41

Câu 5:

uses crt;

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

i,n,dem,t:integer;

begin

clrscr;

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

for i:=1 to n do 

 begin

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

end;

dem:=0;

t:=0;

for i:=1 to n do 

 if a[i] mod 2=0 then 

begin

inc(dem);

t:=t+a[i];

end;

writeln('So so chan la: ',dem);

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

readln;

end. 

Bình luận (0)
TNhi
Xem chi tiết
Minh Lệ
15 tháng 4 2022 lúc 18:48

Program HOC24;

var i,j,n,d: integer;

begin

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

d:=0;

for i:=1 to n do

for j:=1 to i do if i mod j=0 then d:=d+1;

write('Ket qua : ',d);

readln

end.

Bình luận (0)
Trần nguyên sang
Xem chi tiết
Hoàng lĩnh
Xem chi tiết
Kiều Vũ Linh
20 tháng 3 2023 lúc 12:20

Var i,n:integer;

s:longint;

Begin

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

For i:=1 to n-1 do

If (i mod 2 = 0) and (i mod 3 = 0) then

s:=s + i;

Write('Tong la ',s);

Readln;

End.

Bình luận (0)
Bé Kunz
Xem chi tiết
Nguyễn Lê Phước Thịnh
21 tháng 3 2021 lúc 22:24

Bài 1: 

uses crt;

var a:array[1..200]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 5=0 then t:=t+a[i];

writeln('Tong cac so chia het cho 5 la: ',t);

readln;

end.

Bình luận (0)
Nguyễn Lê Phước Thịnh
21 tháng 3 2021 lúc 22:25

Bài 2: 

uses crt;

var st:string;

d,i:integer;

begin

clrscr;

write('Nhap xau:'); readln(st);

d:=length(st);

for i:=1 to d do 

  if st[i]=#32 then delete(st,i,1);

writeln(st);

readln;

end.

Bình luận (0)
scar titan
28 tháng 7 2021 lúc 10:11

python có ko bạn

 

Bình luận (0)
Lê Tâm Anh
Xem chi tiết
gấu béo
7 tháng 5 2023 lúc 19:20

program Le_Nho_Hon_Hoac_Bang_n;

uses crt;

var

       n, i: integer;

begin

       clrscr;

       write('Nhap vao mot so nguyen duong n: ');

       readln(n);

       while n <= 0 do

       begin

              writeln('So ban nhap khong hop le. Xin vui long nhap lai: ');

              readln(n);

       end;

       clrscr;

       writeln('Cac so le nho hon hoac bang ', n, ' la:');

       i := 1;

       while i <= n do

       begin

              if i mod 2 <> 0 then

                     writeln(i);

              i := i + 1;

       end;

       readln;

end.

Bình luận (0)