#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, double);
scalar_t__ scanf(char *, int *);
int main() {
  int n, i, tmp;
  double sum;
  while (scanf("%d", &n) != EOF) {
    sum = 0;
    for (i = 0; i < n; i++) {
      scanf("%d", &tmp);
      sum += tmp;
    }
    printf("%.2f\n", sum / n);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%rax
je     11b6 <main+0x96>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1197 <main+0x77>
lea    0xe8f(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cvtsi2sdl -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115e <main+0x3e>
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea2(%rip),%r13
cmp    0x0(%r13),%rax
jne    115d <main+0x3d>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe9c(%rip),%rbx
lea    0xc(%rsp),%r14
lea    0xe93(%rip),%r15
lea    0x8(%rsp),%r12
jmp    11a8 <main+0x88>
nopw   0x0(%rax,%rax,1)
xorpd  %xmm0,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
mov    %r15,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
cmp    0x0(%r13),%rax
je     114c <main+0x2c>
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    1180 <main+0x60>
xor    %ebp,%ebp
xorps  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
nop
movsd  %xmm0,0x10(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0xc(%rsp),%xmm1
addsd  %xmm1,%xmm0
add    $0x1,%ebp
mov    0x8(%rsp),%eax
cmp    %eax,%ebp
jl     11c0 <main+0xa0>
jmp    1184 <main+0x64>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 0, i32* %1
br label %6
6: ; preds = %24, %0
%7 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = load i64, i64* @EOF
%9 = icmp ne i64 %7, %8
br i1 %9, label %10, label %30
10: ; preds = %6
store double 0.000000e+00, double* %5
store i32 0, i32* %3
br label %11
11: ; preds = %21, %10
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %24
15: ; preds = %11
%16 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%17 = load i32, i32* %4
%18 = sitofp i32 %17 to double
%19 = load double, double* %5
%20 = fadd double %19, %18
store double %20, double* %5
br label %21
21: ; preds = %15
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %11
24: ; preds = %11
%25 = load double, double* %5
%26 = load i32, i32* %2
%27 = sitofp i32 %26 to double
%28 = fdiv double %25, %27
%29 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %28)
br label %6
30: ; preds = %6
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %30, label %8
8: ; preds = %0, %21
%9 = load i32, i32* %1
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %8, %11
%12 = phi double [ %17, %11 ], [ 0.000000e+00, %8 ]
%13 = phi i32 [ %18, %11 ], [ 0, %8 ]
%14 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
%16 = sitofp i32 %15 to double
%17 = fadd double %12, %16
%18 = add nuw nsw i32 %13, 1
%19 = load i32, i32* %1
%20 = icmp slt i32 %18, %19
br i1 %20, label %11, label %21
21: ; preds = %11, %8
%22 = phi double [ 0.000000e+00, %8 ], [ %17, %11 ]
%23 = phi i32 [ %9, %8 ], [ %19, %11 ]
%24 = sitofp i32 %23 to double
%25 = fdiv double %22, %24
%26 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %25)
%27 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%28 = load i64, i64* @EOF
%29 = icmp eq i64 %27, %28
br i1 %29, label %30, label %8
30: ; preds = %21, %0
ret i32 0
}