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 theo link nhé bạn: https://hoc24.vn/hoi-dap/tim-kiem?id=603125&q=t%C3%ADnh%20t%E1%BB%95ng%20c%C3%A1c%20s%E1%BB%91%20t%E1%BB%B1%20nhi%C3%AAn%20t%E1%BB%AB%20100%20%C4%91%E1%BA%BFn%201000%20%28v%C3%B2ng%20l%E1%BA%B7p%20v%E1%BB%9Bi%20s%E1%BB%91%20l%E1%BA%B7p%20ch%C6%B0a%20bi%E1%BA%BFt%29
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.
#include <bits/stdc++.h>
using namespace std;
long long i,t;
int main()
{
t=0;
for (i=1;i<=100;i++)
t=t+i;
cout<<t;
return 0;
}
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.
Câu 1:
Program HOC24;
var i,p: integer;
t: longint;
begin
write('Nhap P: '); readln(p);
t:=0;
for i:=1 to p do if i mod 2<>0 then t:=t+i;
write('Tong cac so le la: ',t);
readln
end.
uses crt;
var i,n,t:integer;
begin
clrscr;
readln(n);
t:=0;
for i:=1 to n do if i mod 2=1 then t:=t+i;
writeln(t);
readln;
end.
Var i,s:longint;
Begin
For i:=1 to 999 do
If i mod 2 <> 0 then
Begin
Write(i:6);
s:=s+i;
End;
Writeln;
Write('Tong la ',s);
Readln;
End.
1.
program tinhtong;
uses crt;
var s,i,n:integer;
begin
s:=0;
for i:=1 to 10 do s:=s+1;
writeln ('tong cua s=',s);
readln
end.
2.
program tinhtong;
uses crt;
var i,L,s:integer;
begin
write('nhap gia tri L='); readln(L);
s:=0;
for i:=1 to L do s:=s+1;
writeln('tong cua s=',s);
readln
end.
Tham khảo:
uses crt;
var i:integer;
s:real;
begin
clrscr;
s:=0;
for i:=100 to 1000 do
s:=s+i;
writeln(s:0:0);
readln;
end.
cảm ơn