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.
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;
}
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.
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;
}
uses crt;
var a:array[1..100]of integer;
i,n,x,dem,kt:integer;
begin
clrscr;
repeat
write('nhap n='); readln(n);
if n<=0 then writeln('ban da nhap sai , yeu cau ban nhap lai');
until n>0;
if n=1 then a[1]:=2
else
begin
a[1]:=2;
x:=1;
dem:=1;
repeat
x:=x+2;
kt:=0;
for i:=2 to trunc(sqrt(x)) do
if x mod i=0 then kt:=1;
if kt=0 then begin
dem:=dem+1;
a[dem]:=x;
end;
until dem=n;
end;
writeln('so nguyen to thu ',n,' la: ',x);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long i,n;
int main()
{
cin>>n;
for (i=2; i<=n; i++) cout<<i<<" ";
return 0;
}