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.
uses crt;
var i,n,t:integer;
begin
clrscr;
write('Nhap n='); readln(n);
t:=0;
for i:=1 to 2*n do
if i mod 2=1 then t:=t+sqr(i);
writeln(t);
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.
uses crt;
var n,i,t:integer;
begin
clrscr;
readln(n);
t:=0;
for i:=1 to n do
t:=t+2*i-1;
writeln(t);
readln;
end.
Uses crt;
Var i,t,n:integer;
Begin
Clrscr;
Write('n='); readln(n);
T:=0;
For i:=1 to 2*n do
If i mod 2=1 then t:=t+i;
Writeln(t);
Readln;
End.
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.
var n,i,s:longint; begin write('nhap so n=');readln(n); s:=0; for i:=1 to n do s:=s+i; writeln(' tong n so nguyen la:',s); readln; end.
Câu 1:
#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+=i;
cout<<s;
return 0;
}
Var i, n,s: longint;
Begin
Write('Nhap so luong so le can tinh tong ');readln(n);
For i:=1 to n do
if i mod 2 <> 0 then s:=s+i;
write('Tong cua ',n,' so le dau tien la ',s);
readln;
end.
Program tinhtong;
uses crt;
var A, N, i: integer;
begin
clrscr;
write ('nhap N = '); Readln (N);
A:=0;
for i:=1 to N do A:= A+(i*2-1);
writeln ('tong = ',A);
readln;
End.