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.
program tong;
uses crt;
var M, N, S, i: integer;
begin
clrscr;
write ('Nhap M= '); readln(M);
write ('Nhap N= '); readln(N);
s : = 0;
for i := M to N do if (i mod 2 = 0) then s:= s + i;
write (T'ong cac so chan trong pham vi tu M den N = ',s);
readln;
end.
mk mới làm tổng thui nghen
uses crt;
var n,i,o,d:integer;
function ktnt(n:integer): integer;
var i,d:integer;
begin
d:=0;
for i:=1 to sqrt(n) do
if (n mod i=0) then d:=d+1;
if d=2 then ktnt=0
else ktnt=1;
end;
begin
readln(n);
writeln(' so nguyen to be hon hoac bang n la'); {a}
for i:=1 to n do
if ktnt(i)=0 then writeln(i);
writeln('so nguyen to nho nhat khong be hon n');
o:=n;
while o>0 do
begin
if ktnt(o)=0 then
begin
write(o);
break;
end;
o:=o+1;
end;
writeln('cặp số nguyên tố là hai số nguyên lẻ liên tiếp nhỏ hơn hoặc bằng n');
o:=0;
o:=1;
d:=0;
for i:=o+2 to n do
begin
if ktnt(i)=0 then
begin
d:=d+1;
write(i,' ');
if d<2 then continue;
end;
d:=0;
writeln;
end;
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long a,b,x,y;
int main()
{
cin>>a>>b;
x=0;
while (a>0)
{
x=x*10+(a%10);
a=a/10;
}
cout<<x<<endl;
y=0;
while (b>0)
{
y=y*10+(b%10);
b=b/10;
}
cout<<y;
return 0;
}
uses crt;
var a,b,i,x,y,n,m:integer;
st1,st2,st3,st4:string;
begin
clrscr;
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
str(a,st1);
str(b,st2);
st3:='';
for i:=length(st1) downto 1 do
st3:=st3+st1[i];
st4:='';
for i:=length(st2) downto 1 do
st4:=st4+st2[i];
val(st3,x,y);
val(st4,n,m);
writeln('So doi xung cua ',a,' la: ',x);
writeln('So doi xung cua ',b,' la: ',n);
writeln('Tong hai so doi xung cua ',a,' va ',b,' la: ',x+n);
readln;
end.
uses crt;
var n,i,d,max,x,y:integer;
st:string;
begin
clrscr;
write('Nhap n='); readln(n);
str(n,st);
d:=length(st);
max:=0;
for i:=1 to d do
begin
val(st[i],x,y);
if max<x then max:=x;
end;
writeln(max);
readln;
end.
uses crt;
var a,b,c:integer;
begin
clrscr;
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
write('Nhap c='); readln(c);
if (a<b) and (b<c) then writeln('a<b<c');
if (a<c) and (c<b) then writeln('a<c<b');
if (b<c) and (c<a) then writeln('b<c<a');
if (b<a) and (a<c) then writeln('b<a<c')
if (c<a) and (a<b) then writeln('c<a<b');
if (c<b) and (b<a) then writeln('c<b<a');
readln;
end.
var A:
array[1..n] of int64;
i, n, count: integer;
begin
write('Nhap so phan tu cua mang: ');
readln(n);
for i := 1 to n do
begin
write('Nhap phan tu thu ', i, ': ');
readln(A[i]);
end;
count := 0;
for i := 1 to n do
if A[i] > 0 then
count := count + 1;
writeln('So luong cac so nguyen duong trong mang la: ', count); end.
uses crt;
var x,y,z,n : integer;
begin clrscr;
write('Nhap n:'); readln(n);
for x:=1 to 9 do
for y:=0 to 9 do
for z:=0 to 9 do
if n*(x+y+z) = x*100+y*10+z then
write('So thoa man de la :', x,y,z, ' ');
readln
end.
uses crt;
var a,b,i,x,y,n,m:integer;
st1,st2,st3,st4:string;
begin
clrscr;
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
str(a,st1);
str(b,st2);
st3:='';
for i:=length(st1) downto 1 do
st3:=st3+st1[i];
st4:='';
for i:=length(st2) downto 1 do
st4:=st4+st2[i];
val(st3,x,y);
val(st4,n,m);
writeln('So doi xung cua ',a,' la: ',x);
writeln('So doi xung cua ',b,' la: ',n);
writeln('Tong hai so doi xung cua ',a,' va ',b,' la: ',x+n);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long n;
int main()
{
cin>>n;
if (n%2==0) cout<<"Chan";
else cout<<"Le";
return 0;
}