Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- a : array [1..1000] of longint;
- n,sum1,i,sum2,max : longint;
- begin
- readln(n);
- for i:=1 to n do
- readln(a[i]);
- sum1:=0;
- for i:=1 to n do
- sum1:=sum1+a[i];
- for i:=1 to n do
- max:=a[1];
- sum2:=0;
- for i:=1 to n do
- if a[i]>max then
- max:=a[i];
- sum2:=max+max;
- writeln(sum2,' (',sum1,')');
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement