Print("Введите n:")
n = int(input())
s = 0
for i in range(n+1):
s = s+i*i
print("s =",s)
Пример:
<span>Введите n: 3
s = 14</span>
Var
n, x, k, i:integer;
begin
readln(n);
k:=0;
for i:=1 to n do
begin
readln(x);
if x mod 10 =6 then
inc(k);
end;
writeln(k);
end.
Блок - схема, видимо вроде такого вам надо )
#include<iostream>#include<conio.h>using namespace std;
int main(){float milkPrice,bredPrice,procent; cout<<"moloko = "; cin>>milkPrice; cout<<"\nxleb = "; cin>>bredPrice; cout<<"**********************************"<<endl; cout<<"podnyat ceny na "; cin>>procent; if (procent <= 0) { cout<<"plohoy procent"; _getch(); return 0; }else{ cout<<"stariye ceni:\nXLEb: "<<bredPrice<<" \nMoloco: "<<milkPrice<<endl; cout<<"**********************************"<<endl; cout<<"new ceni:\nXLEb: "<<(bredPrice*procent/100)+bredPrice<<" \nMoloco: "<<(milkPrice*procent/100)+milkPrice; } _getch();return 0;}
<em>// PascalABC.NET 3.3, сборка 1634 от 14.02.2018</em>
<em>// Внимание! Если программа не работает, обновите версию!</em>
begin
var a:=ReadAllText('mas102.txt').ToWords;
var s:=BigInteger(0);
foreach var w in a do s+=w.ToBigInteger;
Writeln(s mod 104);
end.
<u>Результат</u>
20