|  | 
|  | 
| back to board | Whats wrong c++? Posted by Vadim  16 Aug 2016 18:42#include <iostream>
 using namespace std;
 
 int main()
 {
 int k;
 cin >> k;
 
 int n;
 cin >> n;
 
 int change;
 int result = 0;
 
 for (int i = 0; i < n; i++)
 {
 cin >> change;
 result += change;
 }
 
 if (result - k*n >= 0) cout << result - k*n;
 else cout << 0;
 return 0;
 }
Re: Whats wrong c++? Author's behavior.1) You should explain what problem is - WA/TLE/runtime error.
 2) You should better remove/clear/add explanation to post after you solved task yourself.
 
 Edited by author 16.08.2016 21:18
 | 
 | 
|