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.
Tham khảo:
Program BTH;
uses crt;
var i,n,s:longint;
Begin
clrscr;
write('Nhap n: ');readln(n);
i:=1;
While i<>n do
Begin
If i mod 2=0 then s:=s+i;
i:=i+1;
end;
writeln('Tong day so tren la: ',s);
readln;
end.
program tinh_tong_chan;
uses crt;
Var i,N,S: integer;
begin
clrscr;
writeln('nhap so n');
readln(N);
S:=0;
i:=1;
while i <= N do
begin
S:=S+i;
i:=i+1;
end;
Writeln('tong la: ',S);
readln;
end.
đây bạn nha
1.
Var i ,n : integer;
S , T : real;
Begin
Write ('n:') ;
Read (n) ;
S:= 0;
T:= 1;
For i:= 1 to n do
S:= S + i;
T:= T * i;
Writeln (' Tong cua ' ,n,' , S );
Writeln (' Tich của ' ,n,', T );
Readln;
End.
2.
program SumAndProductOfNumbers;
var
n, m, i, sum, product: integer;
begin
writeln('Enter the values of n and m: ');
readln(n, m);
sum := 0;
product := 1;
for i := n to m do
begin
sum := sum + i;
product := product * i;
end;
writeln('The sum of numbers from ', n, ' to ', m, ' is: ', sum);
writeln('The product of numbers from ', n, ' to ', m, ' is: ', product);
end.
tham khảo
uses crt;
var i,t:integer;
begin
clrscr;
t:=0;
for i:=1 to 10 do
t:=t+i;
writeln('Tong cac so tu nhien tu 1 toi 10 la: ',t);
readln;
end.
refer
uses crt;
var i: integer;
begin
clrscr;
for i:= 1 to 10 do
begin writeln ( ' O ' ) end;
readln
end.
uses crt;
var i:integer;
s:real;
begin
clrscr;
s:=1;
for i:=1 to 100 do
s:=s*i;
writeln(s:0:0);
readln;
end.
câu 1:
uses crt;
var p,i:integer;
begin
clrscr;
p:=1;i:=1;while i<=5 do
begin
p:=p*i;i:=i+1;
end;
write(p);
readln;
end.
bai 2:
uses crt;var p,i:integer;begin clrscr; p:=1; i:=0; while i <=10 do begin
i:=i+1; if (i mod 2<>0) then p:=p*i; end; write(p); readln;end. bai 3:
uses crt;var n,i,p:integer;begin clrscr; write('nhap n: '); readln(n); i:=1; p:=1; while i<=n do begin if i mod 2=0 then p:=p*i; i:=i+1; end; write(p); 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.
Câu 1:
program chieu_cao;
uses crt;
var Nam, Linh: real;
begin
clrscr;
write ('Nhap chieu cao cua Nam:'); readln (Nam);
write ('Nhap chieu cao cua Linh:'); readln (Trang);
if Nam > Linh then writeln ('Ban Nam cao hon');
if Nam < Linh then writeln ('Ban Linh cao hon') else writeln ('Hai ban cao bang nhau');
readln
end.
Câu 2:
program Tich;
var N,i: interger;
P: longint;
begin
write ('N='); readln (N);
P:=1;
for i:=1 to N do P:=P*i;
writeln (N,' ! = ',P);
readln
end.
uses crt;
var i,s:longint;
begin
clrscr;
s:=1;
for i:=1 to 10 do
s:=s*i;
writeln(s);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long i,s;
int main()
{
s=1;
for (i=5; i<=50; i++) s=s*i;
cout<<s;
return 0;
}
cảm ơn nhé