#include <iostream>#include <cmath>using namespace std; int main() { long long n, burbles = 0, maxEle = -1; cin >> n; long long a[n]; for (int i = 0; i < n; i++){ cin >> a[i]; burbels += a[i]; maxEle = max(a[i], maxEle); } cout << maxEle * n - burbels; return 0;}
5 0 1 2 3 4
prog.cpp: In function 'int main()': prog.cpp:15:3: error: 'burbels' was not declared in this scope burbels += a[i]; ^ prog.cpp:19:23: error: 'burbels' was not declared in this scope cout << maxEle * n - burbels; ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!