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.
uses crt;
var a,b,c,max:integer;
begin
clrscr;
write('nhap ba so:');readln(a,b,c);
if a mod 2=0 then writeln(a,' la so chan')
else writeln(a,'la so le);
if b mod 2=0 then writeln(b,'la so chan')
else writeln(b,'la so le');
if c mod 2=0 then writeln(c,'la so chan')
else writeln(c,'la so le');
max:=a;
if max<b then max:=b;
if max<c then max:=c;
writeln('so lon nhat trong ba so la:',max);
readln
end.
a)
uses crt;
var i,n:integer;
begin
clrscr;
repeat
write('Nhap n='); readln(n);
until n<100;
if n mod 2=0 then
begin
for i:=0 to n do
if i mod 2=0 then write(i:4);
end
else writeln(n,' khong la so chan');
readln;
end.
b)
uses crt;
var i,n:integer;
begin
clrscr;
repeat
write('Nhap n='); readln(n);
until n<100;
if n mod 2=1 then
begin
for i:=1 to n do
if i mod 2=1 then write(i:4);
end
else writeln(n,' khong la so le');
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;
}
Câu 58:
Var n:integer;
Begin
Write('n = ');readln(n);
If n mod 2 <> 0 then write(n,' la so le')
Else write(n,' khong la so le');
Readln
End.
Câu 61:
Var n:integer;
Begin
Write('n = ');readln(n);
If n mod 2 = 0 then write(n,' la so chan')
Else write(n,' khong la so chan');
Readln
End.
program so_nguyen_to;
uses crt;
var i,n:integer;
function kt(n:integer):boolean;
var i,j:integer;
begin
j:=0;
for i:=1 to n do
if n mod i=0 then inc(j);
if j=2 then kt:=true
else kt:=false;
end;
BEGIN
clrscr;
write('nhap n:');readln(n);
if kt(n) then writeln(n,' la so nguyen to')
else writeln(n,' khong phai la so nguyen to');
writeln('cac so nguyen to be hon hoac bang ',n,' la:');
for i:=1 to n do
if kt(i) then write(i:5);
writeln;
writeln('cac cap so le lien tiep la so nguyen to be hon hoac bang ',n,' la:');
for i:=1 to n do
if (i mod 2=1) and (kt(i)) and (kt(i+2)) then write(i,',',i+2);
readln;
end.
Program HOC24;
var i,n: integer;
begin
write('Nhap N: '); readln(n);
if n mod 2=0 then write(n,' la so le') else write(n,' la so chan');
readln
end.
uses crt;
var n:integer;
begin
clrscr;
write('Nhap n='); readln(n);
if n mod 2=0 then write(n,' la so chan')
else write(n,' la so le');
readln;
end.