Skip to content

Instantly share code, notes, and snippets.

@opilar
Created November 24, 2012 18:00
Show Gist options
  • Save opilar/4140708 to your computer and use it in GitHub Desktop.
Save opilar/4140708 to your computer and use it in GitHub Desktop.
9
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