Bạn chưa đăng nhập. Vui lòng đăng nhập để hỏi bài

Những câu hỏi liên quan
Anh Duy
Xem chi tiết
Nguyễn Lê Phước Thịnh
18 tháng 1 2022 lúc 10:12

#include <bits/stdc++.h>

using namespace std;

long long n,i,s;

int main()

{

cin>>n;

s=0;

for (i=1; i<=n; i++) s=s+i*i;

cout<<s;

return 0;

}

Kiều Vũ Linh
19 tháng 1 2022 lúc 8:53

Var s,i,n:longint;

Begin

Write('Nhap so luong so n = ');readln(n);

For i:=1 to n do

s:=s+i*i;

Write('Tong la ',s);

Readln;

End.

Minh Nguyệt Điêu
Xem chi tiết
Kiều Vũ Linh
8 tháng 2 2023 lúc 9:56

Câu 1:

var i,n:integer;

s:longint;

begin

write('Nhap n = ');readln(n);

for i:=1 to n do

s:=s+(i*10+2);

write('S = ',s);

readln;

end.

Câu 2:

var i,n:integer;

s:real;

begin

write('Nhap n = ');readln(n);

for i:=1 to n do s:=s+1/n;

write('tong la ',s:10:2);

readln;

end.

Vy Tường_8a2
Xem chi tiết
Nguyễn Lê Phước Thịnh
13 tháng 4 2022 lúc 18:30

uses crt;

var i,n,s:integer;

begin

clrscr;

readln(n);

s:=0;

i:=0;

while i<=n do 

begin

i:=i+1;

s:=s+i*i;

end;

writeln(s);

readln;

end.

Thành Điền Lê Nguyễn
Xem chi tiết
Minh Nhân
4 tháng 2 2021 lúc 8:25

#TK

uses crt;

var s,i:integer;

begin

clrscr;

s:=0;

for i:=3 to 97 do

s:=s+i;

write(s);

readln;

end.

 

Nguyễn Lê Phước Thịnh
4 tháng 2 2021 lúc 12:56

uses crt;

var s,i:integer;

begin

clrscr;

s:=0;

for i:=3 to 97 do 

  s:=s+i;

writeln(s);

readln;

end.

Tuấn Nguyễn
6 tháng 2 2021 lúc 10:50

b1;tim ssh cua day so cach deu tren cong thuc lop 5:(97-3):khoang canh +1; :))

b2;tinh tong bang cong thuc lop 5 sau : tong=(so dau + so cuoi)*ssh/2;

b3; xuat ra :))) 

hshgfhsejh
Xem chi tiết
Nguyễn Lê Phước Thịnh
29 tháng 5 2022 lúc 19:39

uses crt;

var i,n,s:longint;

begin

clrscr;

readln(n);

s:=0;

for i:=1 to n do 

  s:=s+sqr((2*i-1));

writeln(s);

readln;

end.

Kim Phụng Nguyễn
Xem chi tiết
Susama
Xem chi tiết
Nguyễn Lê Phước Thịnh
8 tháng 2 2022 lúc 23:42

uses crt;

var s,i:integer;

begin

clrscr;

s:=0;

for i:=1 to 100 do s:=s+i;

writeln(s);

readln;

end.

Nguyễn hoàng anh
8 tháng 2 2022 lúc 23:50

#include <iostream>

using namespace std;

 

int main () {

     int tong = 0;

     for (int i = 1 ; i <= 100; i++) tong = tong + i;

     cout << " Tong S = " << tong;

     return 0;

}

Chạy chương trình

Tong S = 5050

foxbi
Xem chi tiết
Kiều Vũ Linh
18 tháng 3 2023 lúc 7:55

 Var i,n:integer;

s:longint;

Begin

Write('n = ');readln(n);

For i:=1 to n do

s:=s+i;

Write('Tong la ',s);

Readln;

End.

32.Thuỳ 7/2
Xem chi tiết
Nguyễn Hoàng Duy
13 tháng 3 2023 lúc 22:56

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.

Nguyễn Hoàng Duy
13 tháng 3 2023 lúc 23:02

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.

Nguyễn Hoàng Duy
13 tháng 3 2023 lúc 23:03

3.

program SumAndProductOfNumbers;

var
  i, sum, product: integer;

begin
  sum := 0;
  product := 1;
  
  for i := 10 to 25 do
  begin
    sum := sum + i;
    product := product * i;
  end;
  
  writeln('The sum of numbers from 10 to 25 is: ', sum);
  writeln('The product of numbers from 10 to 25 is: ', product);
end.

Hoàng Long Đậu
Xem chi tiết
Nguyễn Lê Phước Thịnh
18 tháng 2 2022 lúc 0:03

uses crt;

var x,n,i,t:integer;

begin

clrscr;

readln(n);

t:=0;

for i:=1 to n do 

begin

readln(x);

if x mod 2=0 then t:=t+x;

end;

writeln(t);

readln;

end.

program ideone;
var i,n,x,res:longint;
begin
readln(n);
res:=0;
for i:=1 to n do 
begin
read(x);
if x mod 2 = 0 then
res:=res+x;
end;
write(res);

end.