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.
var a:array[1..1000] of integer;
i,n,d,max:integer;
begin
write('n = ');readln(n);
for i:=1 to n do
begin
write('Nhap phan tu thu ',i,' = ');readln(a[i]);
if a[i] mod 2 <> 0 then d:=d+1;
end;
max:=a[1];
for i:=2 to n do
if a[i] > max then max:=a[i];
writeln('Co ',d,' so le');
write('So lon nhat la ',max);
readln
end.
uses crt;
Var i,n,dem:integer;
a: array[1..1000] of integer;
Begin
clrscr;
Write('Nhap do dai cua day: ');readln(n);
dem:=0;
for i:= 1 to n do
Begin
write('So thu ',i,' = ');
readln(a[i]);
if a[i] mod 2 = 0 then inc(dem);
end;
Writeln('Day so co ',dem,' so chan');
readln;
End.
#include <bits/stdc++.h>
using namespace std;
long long a,b,c;
int main()
{
cin>>a>>b>>c;
if (a+c %2==0) cout<<"AC ";
if (b+c%2==0) cout<<"BC ";
if (a+b%2==0) cout<<"AB";
return 0;
}
uses crt;
var n,i,dem,j,t:integer;
kt:boolean;
begin
clrscr;
readln(n);
t:=0;
for i:=2 to n do
begin
kt:=true;
for j:=2 to i-1 do
if i mod j=0 then kt:=false;
if kt=true then
begin
write(i:4);
t:=t+i;
end;
end;
writeln;
writeln(t);
readln;
end.
uses crt;
var n,t:integer;
{------------------kiem-tra-so-nguyen-to----------------------------}
function ktnt(x:integer):boolean;
var i:integer;
kt:boolean;
begin
kt:=true;
for i:=2 to trunc(sqrt(x)) do
if x mod i=0 then
begin
kt:=false;
break;
end;
if kt=true then ktnt:=true
else ktnt:=false;
{----------------------chuong-trinh-chinh------------------------}
begin
clrscr;
t:=0;
repeat
write('Nhap n='); readln(n);
if (n mod 2=0) then t:=t+n;
until ktnt(n)=false;
writeln(t);
readln;
end.
Program HOC24;
var x: integer;
begin
write('Nhap so: '); readln(x);
if x div 1000=1 then write('Mot nghin ');
if x div 1000=2 then write('Hai nghin ');
if x div 1000=3 then write('Ba nghin ');
if x div 1000=4 then write('Bon nghin ');
if x div 1000=5 then write('Nam nghin ');
if x div 1000=6 then write('Sau nghin ');
if x div 1000=7 then write('Bay nghin ');
if x div 1000=8 then write('Tam nghin ');
if x div 1000=9 then write('Chin nghin ');
if x div 1000<>0 then
if x div 100=0 then write('khong tram ');
if x div 100=1 then write('mot tram ');
if x div 100=2 then write('hai tram ');
if x div 100=3 then write('ba tram ');
if x div 100=4 then write('bon tram ');
if x div 100=5 then write('nam tram ');
if x div 100=6 then write('sau tram ');
if x div 100=7 then write('bay tram ');
if x div 100=8 then write('tam tram ');
if x div 100=9 then write('chin tram ');
if (x div 1000<>0) or (x div 100<>0) then
begin
if (x div 10<>0) then
begin
if x div 10=1 then write('muoi ');
if x div 10=2 then write('hai muoi ');
if x div 10=3 then write('ba muoi ');
if x div 10=4 then write('bon muoi ');
if x div 10=5 then write('nam muoi ');
if x div 10=6 then write('sau muoi ');
if x div 10=7 then write('bay muoi ');
if x div 10=8 then write('tam muoi ');
if x div 10=9 then write('chin muoi ');
if x mod 10=1 then write('mot');
if x mod 10=2 then write('hai');
if x mod 10=3 then write('ba');
if x mod 10=4 then write('bon');
if x mod 10=5 then write('lam');
if x mod 10=6 then write('sau');
if x mod 10=7 then write('bay');
if x mod 10=8 then write('tam');
if x mod 10=9 then write('chin');
end else
begin
if x mod 10=1 then write('le mot');
if x mod 10=2 then write('le hai');
if x mod 10=3 then write('le ba');
if x mod 10=4 then write('le tu');
if x mod 10=5 then write('le nam');
if x mod 10=6 then write('le sau');
if x mod 10=7 then write('le bay');
if x mod 10=8 then write('le tam');
if x mod 10=9 then write('le chin');
end;
readln
end.
uses crt;
var n,i,chan,tonchan:integer;
a:array[1..100] of integer;
begin
write('nhap n '); readln(n);
for i:=1 to n do
begin
write('a[i]='); readln(a[i]);
end;
writeln("in cac phan tu trong mang");
for i:=1 to n do
begin
writeln(a[i]);
end;
writeln("in cac phan tu chan");
chan:=0;
for i:=1 to n do
if n mod 2=0 then begin writeln(a[i]); chan:=chan+1; end;
write('tong cac phan tu chan ',chan);
readln;
end.
uses crt;
var a,b,l,r,i,dem:integer;
begin
clrscr;
readln(a,b,l,r);
dem:=0;
for i:=l to r do
if (i mod a=0) and (i mod b=0) then inc(dem);
write(dem);
readln;
end.
var a,b,dem,L,i,R:longint;
begin
readln(a,b,L,R);
dem:=0;
for i:=L to R do
if (i mod a=0) and (i mod b=0) then inc(dem);
write(dem);
readln;
end.