Created
November 24, 2012 18:00
-
-
Save opilar/4140708 to your computer and use it in GitHub Desktop.
9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program Project2; | |
{$APPTYPE CONSOLE} | |
uses | |
math; | |
const | |
N=10; | |
var | |
A:array [1..N] of integer; | |
i, sr, maxn:integer; | |
begin | |
for i:=1 to N do | |
readln(A[i]); | |
sr:=0; | |
for i:=1 to N do | |
sr:=sr+A[i]; | |
sr:=trunc(sr/N); | |
maxn := 1; | |
for i := 2 to N do | |
if A[i] > A[maxn] then | |
maxn := i; | |
A[maxn]:=sr; | |
for i:=1 to N do | |
writeln(A[i]); | |
readln; | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment