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.
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.
c1:
#include <bits/stdc++.h>
using namespace std;
long long i,n,s;
int main()
{
cin>>n;
s=1;
for (i=1; i<=n; i++) s=s*i;
cout<<s;
return 0;
}
Câu 2:
#include <bits/stdc++.h>
using namespace std;
long long i,n,s;
int main()
{
cin>>n;
s=1;
for (i=1; i<=n; i++) if (i%2==0) s=s*i;
cout<<s;
return 0;
}
program Chan_Le;
var
n, i: integer;
begin
write('Nhap vao so nguyen N: ');
readln(n);
writeln('Cac so chan tu 1 den ', n, ' la:');
for i := 2 to n do
begin
if i mod 2 = 0 then
begin
write(i, ' ');
end;
end;
writeln;
writeln('Cac so le tu 1 den ', n, ' la:');
for i := 1 to n do
begin
if i mod 2 <> 0 then
begin
write(i, ' ');
end;
end;
readln;
end.
program Chan_Le;
var n, i: integer;
begin
write('Nhap vao so nguyen n: ');
readln(n);
writeln('Cac so chan tu 1 den ',n, ' la: ');
for i := 1 to n do
begin
if i mod 2 = 0 then
write(i, ' ');
end;
writeln;
writeln('Cac so le tu 1 den ', n, ' la: ');
for i := 1 to n do
begin
if i mod 2 <> 0 then
write(i, ' ');
end;
readln;
end.
1. Uses crt;
var n,i: integer;
begin clrscr;
readln(n);
for i:=1 to n do write(i:3);
readln;
end.
2. Uses crt;
var n,i: integer;
begin clrscr;
readln(n);
for i:=1 to n do if(i mod 2 = 0) then write(i:3);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long n,i;
int main()
{
cin>>n;
for (i=1; i<=n; i++)
if (i%3==0) cout<<i<<" ";
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long n,i;
int main()
{
cin>>n;
for (i=1; i<=n; i++)
if (i%3==0) cout<<i<<" ";
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long n,i;
int main()
{
cin>>n;
for (i=1; i<=n; i++)
if (i%3==0) cout<<i<<" ";
return 0;
}
program Le_Nho_Hon_Hoac_Bang_n;
uses crt;
var
n, i: integer;
begin
clrscr;
write('Nhap vao mot so nguyen duong n: ');
readln(n);
while n <= 0 do
begin
writeln('So ban nhap khong hop le. Xin vui long nhap lai: ');
readln(n);
end;
clrscr;
writeln('Cac so le nho hon hoac bang ', n, ' la:');
i := 1;
while i <= n do
begin
if i mod 2 <> 0 then
writeln(i);
i := i + 1;
end;
readln;
end.
uses crt;
var n,i:integer;
begin
clrscr;
write('nhap n='); readln(n);
if n>0 then
begin
writeln('cac so le trong khoang tu 0 toi ',n,' la:');
for i:=0 to n do
if i mod 2=1 then write(i:4);
end
else writeln('vui long nhap lai');
readln;
end.