ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1457. Heating Main

AC 0.015s, 120kb
Posted by Luka Bulatovic 16 Sep 2011 22:36
#include <iostream>
#include <cstdio>

using namespace std;

int main()
{
    int N;
    double sum;
    scanf("%d", &N);
    for(int i = 0; i < N; i++)
    {
        int p;
        scanf("%d", &p);
        sum += (double)p;
    }
    sum /= double(N);
    printf("%.6lf", sum);
    return 0;
}
Re: AC 0.015s, 120kb
Posted by Al.Cash 18 Sep 2011 23:56
Man you're awesome! I'm sure your solution is the best among 3000 others!
Re: AC 0.015s, 120kb
Posted by Pegasus 9 Sep 2012 18:43
Not true.You should initialize sum = 0 or it will be a trash number.

Edited by author 09.09.2012 18:47

Edited by author 09.09.2012 18:47
Re: AC 0.015s, 120kb
Posted by phonism 29 Sep 2012 16:16
Congratulation!!! >_<