Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
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.
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.
program SoSanhDiem;
var
DiemManh, DiemThanh: real;
begin
write('Nhap diem cua ban Manh: ');
readln(DiemManh);
write('Nhap diem cua ban Thanh: ');
readln(DiemThanh);
if DiemManh > DiemThanh then
writeln('Ban Manh dat diem cao hon ban Thanh.')
else if DiemManh < DiemThanh then
writeln('Ban Thanh dat diem cao hon ban Manh.')
else
writeln('Hai ban dat diem bang nhau.');
readln;
end.
Program HOC24;
var a,b: real;
begin
write('Nhap diem cua Manh: '); readln(a);
write('Nhap diem cua Thanh: '); readln(b);
if a>b then write('Diem cua ban Manh cao hon ban Thanh');
if a<b then write('Diem cua ban Thanh cao hon ban Manh');
if a=b then write('Diem cua ban Manh bang ban Thanh');
readln
end.
#include <bits/stdc++.h>
using namespace std;
long long a;
int main()
{
cin>>a;
if (a%2==0) cout<<a<<" la so chan";
else cout<<a<<" la so le";
return 0;
}
program Tim_So_Le_Chia_Het_Cho_3;
uses crt;
var
n, i, count: integer;
begin
clrscr;
write('Nhap vao mot so nguyen duong n: ');
readln(n);
writeln('Cac so le chia het cho 3 nho hon ', n, ' la: ');
count := 0;
for i := 1 to n do
begin
if (i mod 2 = 1) and (i mod 3 = 0) then
begin
writeln(i);
count := count + 1;
end;
end;
writeln('Co tat ca ', count, ' so le chia het cho 3');
readln;
end.
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.
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.
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.
var BMI: real;
begin
writeln('nhap chi so BMI: ');readln(BMI);
if (16<BMI) and (BMI<18.5) then writeln('Bạn bị thiếu cân');
if (18.5<BMI)and (BMI<25) then writeln('Bạn đủ cân');
if BMI>25 then writeln('Bạn đang thừa cân');
end.
#include <bits/stdc++.h>
using namespace std;
int a;
int main()
{
cin>>a;
if (a>10) cout<<"ban nhap so lon hon 10";
else cout<<"ban nhap so nho hon 10";
return 0;
}