Language: C++

int main(){
  int n,k;
  scanf("%d%d", &n,&k);
  int a;
  int x[n];
  for (a=0,a<k,a++){
    scanf("%d", &x[a]);
   }
  if(n<=k) printf("0");
  else{
    int i,j;
    for (i=0,i<n,i++){
      for (j=i+1,j<n,i++)
        if (x[i]>x[j]){
          int tmp = x[i];
          x[i] = x[j];
          x[j] = tmp;
        }
    }
    int b;
    for (b=0,b<n,b++){
      int c;
      c = n-b-1;
      x[c] = 0;
    }
    int s;
    for (c=0,c<n,c++)
      s += x[c];
    printf("%d", s);
  }
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'scanf' was not declared in this scope
    3 |   scanf("%d%d", &n,&k);
      |   ^~~~~
a.cc:6:19: error: expected ';' before ')' token
    6 |   for (a=0,a<k,a++){
      |                   ^
      |                   ;
a.cc:9:3: error: expected primary-expression before 'if'
    9 |   if(n<=k) printf("0");
      |   ^~
a.cc:8:5: error: expected ';' before 'if'
    8 |    }
      |     ^
      |     ;
    9 |   if(n<=k) printf("0");
      |   ~~ 
a.cc:9:3: error: expected primary-expression before 'if'
    9 |   if(n<=k) printf("0");
      |   ^~
a.cc:8:5: error: expected ')' before 'if'
    8 |    }
      |     ^
      |     )
    9 |   if(n<=k) printf("0");
      |   ~~ 
a.cc:6:7: note: to match this '('
    6 |   for (a=0,a<k,a++){
      |       ^
a.cc:9:12: error: 'printf' was not declared in this scope
    9 |   if(n<=k) printf("0");
      |            ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(){
a.cc:12:21: error: expected ';' before ')' token
   12 |     for (i=0,i<n,i++){
      |                     ^
      |                     ;
a.cc:20:10: error: expected initializer before ';' token
   20 |     int b;
      |          ^
a.cc:21:5: error: expected primary-expression before 'for'
   21 |     for (b=0,b<n,b++){
      |     ^~~
a.cc:20:11: error: expected ')' before 'for'
   20 |     int b;
      |           ^
      |           )
   21 |     for (b=0,b<n,b++){
      |     ~~~    
a.cc:12:9: note: to match this '('
   12 |     for (i=0,i<n,i++){
      |         ^
a.cc:21:21: error: expected ';' before ')' token
   21 |     for (b=0,b<n,b++){
      |                     ^
      |                     ;
a.cc:26:10: error: expected initializer before ';' token
   26 |     int s;
      |          ^
a.cc:27:5: error: expected primary-expression before 'for'
   27 |     for (c=0,c<n,c++)
      |     ^~~
a.cc:26:11: error: expected ')' before 'for'
   26 |     int s;
      |           ^
      |           )
   27 |     for (c=0,c<n,c++)
      |     ~~~    
a.cc:21:9: note: to match this '('
   21 |     for (b=0,b<n,b++){
      |         ^
a.cc:27:10: error: 'c' was not declared in this scope
   27 |     for (c=0,c<n,c++)
      |          ^
a.cc:29:5: error: 'printf' was not declared in this scope
   29 |     printf("%d", s);
      |     ^~~~~~
a.cc:29:5: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:30:3: error: expected primary-expression before '}' token
   30 |   }
      |   ^
a.cc:29:21: error: expected ')' before '}' token
   29 |     printf("%d", s);
      |                     ^
      |                     )
   30 |   }
      |   ~                  
a.cc:27:9: note: to match this '('
   27 |     for (c=0,c<n,c++)
      |         ^
a.cc:30:3: error: expected primary-expression before '}' token
   30 |   }
      |   ^