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.
Bài 2:
#include <bits/stdc++.h>
using namespace std;
long long x,y;
int main()
{
cin >>x>>y;
cout<<x<<" "<<y;
swap(x,y);
cout<<x<<" "<<y;
return 0;
}
uses crt;
var n:longint;
begin
clrscr;
readln(n);
if n mod 2=0 then write('la so chan')
else write('la so le');
readln;
end.
Program HOC24;
var a: array[1..32000] of integer;
i,n,d: integer;
begin
write('Nhap N: ');
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
write('Day vua nhap la: ');
for i:=1 to n do write(a[i],' '); writeln;
d:=0;
for i:=1 to n do if a[i]>0 then d:=d+1;
write('Co ',d,' so duong');
readln
end.
program bai_toan;
var
N, i, sum: integer;
begin
write('Nhap so N: ');
readln(N);
write('Cac uoc cua ', N, ' khong ke ', N, ' la: ');
for i := 1 to N - 1 do
if N mod i = 0 then
write(i, ' ');
writeln;
sum := 0;
for i := 1 to N - 1 do
begin
if N mod i = 0 then sum := sum + i;
end;
if sum = N then writeln(N, ' la so hoan hao')
else writeln(N, ' khong phai la so hoan hao');
writeln;
writeln('Tat ca so hoan hao trong pham vi 1 -> ', N, ' la:');
for i := 1 to N do
begin
sum := 0;
for j := 1 to i - 1 do
begin
if i mod j = 0 then sum := sum + j;
end;
if sum = i then writeln(i);
end;
readln;
end.
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.
uses crt;
var n:integer;
begin
clrscr;
readln(n);
if n>0 then writeln(n,' la so duong')
else writeln('ko la so duong');
if (n mod 2=1) and (n mod 3=0) then writeln('n la so le chia het cho 3')
else writeln('n ko la so le chia het cho 3');
readln;
end.