|
víc jak 450 program zadarmo
|
![]() English |
![]() Slovensky |
![]() Česky |
![]() Šarišsky |
|
Kategórie: Zadání z Pascalu Program: Suma.pas Soubor exe: Suma.exe Vypočíta sumu súčinov a[i]*b[n+1-i], pričom n je počet čísel.
Zobrazené: 640x
{ SUMA.PAS Copyright (c) TrSek alias Zdeno Sekerak } { Vypocita sumu sucinov a[i]*b[n+1-i], pricom n je pocet cisel } { Vstup : pole a, b cisel } { Vystup: suma sucinov } { } { Datum:10.04.2000 http://www.trsek.com } program suma (input, output); var s,i,n : integer; a, b : array [1..20] of integer; begin s := 0; write ('zadaj n: '); readln (n); for i:=1 to n do begin write ('zadaj a[',i,']: '); readln (a[i]); write ('zadaj b[',i,']: '); readln (b[i]); end; for i:=1 to n do s:=s+(a[i]*b[n+1-i]); writeln ('suma je ', s); readln; end. [Spustit] [Uložit] [Tlačit] [Poslat e-mailom] |
|