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.
Câu 6:
uses crt;
var n,i:integer;
begin
clrscr;
readln(n);
for i:=1 to n do
if n mod i=0 then write(i:4);
readln;
end.
5:
uses crt;
var n,i,dem:integer;
begin
clrscr;
readln(n);
dem:=0;
for i:=0 to n do
if i mod 2=1 then
begin
write(i:4);
dem:=dem+1;
end;
writeln;
writeln(dem);
readln;
end.
1:
uses crt;
var n,i,t:integer;
begin
clrscr;
readln(n);
t:=0;
for i:=1 to n do
t:=t+i*i;
write(t);
readln;
end.
2
program bt2;
var i,n,t:integer;
begin
readln(n);
s:=0;
for i:=1 to n do
if i mod 2 = 1 then s:=s+i;
readln;
end.
Câu 2:
#include <bits/stdc++.h>
using namespace std;
double p1,p2;
int i,n;
int main()
{
cin>>n;
p1=1;
p2=1;
for (i=1; i<=n; i++)
{
if (i%2==0) p2=p2*(i*1.0);
else p1=p1*(i*1.0);
}
cout<<fixed<<setprecision(2)<<p1<<endl;
cout<<fixed<<setprecision(2)<<p2;
return 0;
}
Câu 1:
Program HOC24;
var i,n: integer;
t: longint;
write('Nhap N: '); readln(n);
t:=1;
for i:=1 to n do t:=t*i;
write(n,'! = ',t);
readln
end.
uses crt;
var s:real;
i,n:integer;
begin
clrscr;
readln(n);
s:=0;
for i:=1 to n do
s:=s+1/(i*(i+2));
writeln(s:4:2);
readln;
end.
uses crt;
var s:real;
i,n:integer;
begin
clrscr;
readln(n);
s:=0;
for i:=1 to n do
s:=s+(n*(n+1))/((n+2)*(n+3));
writeln(s:4:2);
readln;
end.
Bài 1:
uses crt;
var i,s:integer;
begin
clrscr;
s:=0;
for i:=10 to 50 do
if i mod 2=0 then s:=s+i;
writeln(s);
readln;
end.
Bài 2:
uses crt;
var a,i,n:integer;
begin
clrscr;
write('Nhap n='); readln(n);
a:=0;
for i:=1 to n do
a:=a+i*(i+2);
writeln(a);
readln;
end.
Uses crt;
var n,i,s: integer;
begin clrscr;
readln(n);
for i:=1 to n do s:=s+1/i;
writeln(s);
readln;
end.
int Sum(int n){
int temp=1;
int result=0;
for(int i=1;i<=n;i++)
{
result+=i*temp;
temp*=-1;
}
return result;
}