fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. long long n, burbles = 0, maxEle = -1;
  8.  
  9. cin >> n;
  10.  
  11. long long a[n];
  12.  
  13. for (int i = 0; i < n; i++){
  14. cin >> a[i];
  15. burbels += a[i];
  16. maxEle = max(a[i], maxEle);
  17. }
  18.  
  19. cout << maxEle * n - burbels;
  20.  
  21. return 0;
  22. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
5
0 1 2 3 4
compilation info
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;
                       ^
stdout
Standard output is empty