Submission #146889

#TimeUsernameProblemLanguageResultExecution timeMemory
146889pedroslreyProsjek (COCI18_prosjek)C++14
50 / 50
2 ms376 KiB
#include <bits/stdc++.h> using namespace std; vector<int> xs; int main() { int n; scanf("%d", &n); for (int i = 0; i < n; ++i) { int x; scanf("%d", &x); xs.push_back(x); } sort(xs.begin(), xs.end()); float media = xs[0]; for (int i = 1; i < n; ++i) { media = (media + xs[i])/2; } printf("%f\n", media); }

Compilation message (stderr)

prosjek.cpp: In function 'int main()':
prosjek.cpp:9:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
  ~~~~~^~~~~~~~~~
prosjek.cpp:12:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &x);
   ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...