CodeGraderBench/CodeGraderBench huggingface dataset:
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
using namespace std;

int main(){
    int n;
    cin>> n;
  

    int arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    int X;
    cin>>X;
    
    for(int i=n-1;i>=0;i--){
        cout <<arr[i]<<" ";
    }
    int sum=0;
    

    for(int i=0;i<n;i++){
        if(arr[i]>X){
            sum+=arr[i];
        }
    }
    cout<< endl<<sum;


    return 0;
}

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
using namespace std;

int main(){
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    for(int i=n-1;i>=0;i--){
        cout<<a[i]<<" ";
    }
    int x;
    int sum=0;
    
    cin>>x;
    for(int i=0;i<n;i++){
        if(x<a[i]){
            sum=sum+a[i];
        }
    }
        cout<<sum<<endl;
    

    
    
}

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: C
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
#include<math.h>
using namespace std;

int reverse(int arr[],int& n){
//      int s=0 ,e=n-i-1;

        //      while(s<=e){
                for(int i=0,j=n-i-1;i<n;i++,j--){
                        swap(arr[i],arr[j]);
                }

                      for(int i=0; i<n;i++){
                 cout<< arr[i];

        }


}


int main(){
int n,x;
cin>>n;

int arr[n];
        for(int i=0; i<n;i++){
        cin>> arr[i];

        }

 reverse(arr,n);

                      for(int i=0; i<n;i++){
                 cout<< arr[i];

cin x;

}

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
using namespace std;

int main(){
int a[5] = {1, 2, 3, 4, 5};
int sum = 0;
for(int i = 0; i < 5; i++) {
sum += a[5];
}
cout<<sum<<endl;
}

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
using namespace std;
int main()
{
    int n,x,sum=0;
    cin>>n;
    int arr[n];
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
    }
    cin>>x;
    for(int i=n-1;i>=0;i--)
    {
        cout<<arr[i]<<" ";
    }
    for(int i=0;i<n;i++)
    {
        if(arr[i]>x)
        sum+=arr[i];
        else
        continue;
    }
    cout<<endl<<sum;
}

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
using std::cout; using std::cin; using std::endl; using std::swap;

int main(){
    int n;
    cin>>n;
    int arr[100]={0};
      for(int i=0; i<n; i++)  cin >>arr[i];
    for(int i=0; i<n/2; i++)  swap(arr[i],arr[n-1-i]);
    for (int i=0; i<n; i++) 
      cout<<arr[i]<<" ";
    int x;
    int sum=0;
    cin>>x;
   for(int m=0;m<n; m++)
    
      if (arr[m]>x)
      sum= arr[m]+sum;
     cout<<endl<<sum;
  }

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
using namespace std;

void rev(int arr[], int n){
    for(int i=0; i<n; i++){
    arr[i]=arr[n-i-1];
  
}}

int main(){
    int arr[100];
    int n;
    int X;
    cin >> n;
    for(int i=0; i<n; i++)cin>>arr[i];
            
    for(int i=0; i<n; i++){rev(arr,n);
       cout<<arr[i];
       cin >> X;
       if(arr[i]<X){
        arr[i]+=arr[i];
        cout<<arr[i];
       }


    }

}

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: C
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int Arr[n];
    for(int i=0;i<n;i++)
    {
        cin>>Arr[i];
    }
    int X;
    cin>>X;
    for(int i=(n-1);i>=0;--i)
    {
        cout<<Arr[i]<<" ";
    }
    int sum=0;
    for(int i=0;i<n;i++)
    {
        if(Arr[i]>X)
        {
            sum+=Arr[i];
        }
    }
    cout<<endl<<sum;
}

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
using namespace std;
int main(){
    int n;
int arr[n];
cin>>n;
for(int i=0;i<n;i++){
    cin>>arr[i];
}
for(int i=n-1;i>=0;i--){
    cout<<arr[i]<<" ";
    
}
cout<<endl;
int x;
cin>>x;
int sum=0;
for(int i=0;i<n;i++){
    if(arr[i]>x){
        sum=sum+arr[i];
    }
    
}
cout<<sum<<endl;
}

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
using namespace std;
int main(){
    int n;
    cin>>n;
    int arr[n];
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
    }
    int X;
    cin>>X;
    //Reverse Order
    for(int i=n-1;i>=0;i--)
    cout<<arr[i]<<" ";
    cout<<endl;

    int sum=0;
    for(int i=0;i<n;i++){
        if(arr[i]>X)
        sum+=arr[i];
    }
    cout<<sum<<endl;
}

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
using namespace std;
int main() {
    int n;
    int x;
    cin>>n;
    int arr[n];
    for(int i=0; i<n; i++){
        cin>>arr[i];
    }
    cin>>x;
    
    for(int i=n-1; i>=0; i--){
      cout<<arr[i]<<" ";
    }
    int sum=0;
    for(int i=0; i<n; i++){
        if(arr[i]>x){
            
            sum+=arr[i];
                   
        }
        
    }cout<<endl<<sum;
}

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
using namespace std;
int main(){
    int n, arr[100], x, sum=0;
    cin >> n;
    for(int i=0; i<n; i++){
        cin >> arr[i];
    }
    cin >> x;
    for(int i=n-1;i>=0; i--){
        cout<< arr[i]<<" ";
    }
    cout<< endl;
    for(int i=0; i<n; i++){
        if(arr[i]>x) sum+=arr[i];
    }
    cout<< sum<< endl;
}

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
using namespace std;
int main(){
    int n;
    cin>>n;
    int arr[n];
    for(int i=0;i<n;i++)cin>>arr[i];
    int x;
    cin>>x;
    for(int i=n-1;i>=0;i--)cout<<arr[i]<<" ";
    cout<<endl;
    int count=0;
    for(int i=0;i<n;i++)if(arr[i]>x)count=count+arr[i];
    cout<< count;
    
}

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
using namespace std;

int main() {
    int n; cin >> n;
    int A[100] = {};
    for(int i=0;i<n;i++) {
        cin >> A[i];
    }
    int X; cin >> X;
    for(int i=n-1;i>=0;--i) {
        cout << A[i] << " ";
    }
    cout << endl;
    int sum = 0;
    for(int i=0;i<n;i++) {
        if(A[i]>X) {
            sum = sum + A[i];
        }
    }
    cout << sum << endl;
}

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
using namespace std ;

int Sum(int arr[] , int n , int X){
    int sum = 0 ;
    for (int i=n-1 ; i>=0 ; i-- ){
        cout << arr[i] << " ";
        if (arr[i] > X){
            sum = sum +arr[i] ;
        }
    }
    cout << endl ;
    return sum;

}

int main(){
    int n;
    cin >> n;

    int arr[n] ;

    for (int i=0 ; i<n ; i++){
        cin >> arr[i] ;
    }

    int X ;
    cin >> X ;

    cout << Sum(arr , n , X)<< endl ;

    
}

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include <iostream>
using namespace std;





int N,n,x,sum=0;
int main(){
    cin>> N;
    int A[N]={0};
    for(int i=0; i<N; i++){
        cin>>n;
        A[i]=n;
    } 
    cin>>x;
    for (int i=N-1; i>=0; i--){
        cout<<A[i]<<" ";
    }
    cout<<endl;
    for (int i=0; i<N ;i++){
        if (A[i]>x){
            sum=sum+A[i];
        }
    }
    cout<<sum;
}

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
using namespace std;

int main(){
    int n;
    cin>>n;
    int arr[n];
    for(int i=0; i<n; i++)
    {
        cin>>arr[i];
    }
    int num1;
    cin>>num1;
    int summation;
    for(int i=0; i<n; i++)
    {
        if (arr[i]>num1)
        summation+=arr[i];
    }

    for (int i=0; i<n; i++)
    {
        cout<<arr[n-1-i]<<" ";
    }
    cout<<endl;
    cout<<summation;
    return 0;
}

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include <iostream>
using namespace std;

int main(){
    int n, x, sum=0; cin >>n;
    int arr[n];
    for (int &i: arr) cin >> i;
    cin >> x;
    for (int i=0; i<n; i++){
        cout << arr[n-i-1] << " ";
    }
    cout << endl;
    for (int i: arr){
        if (i > x) sum+=i;
    }
    cout << sum;
}

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
using namespace std;
int main(){
    int n,x,sum;
    cin>>n;
    int arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    cin>>x;
    int i=0;
    while (i<n){
        if(arr[i]>x){
            sum=sum+arr[i];
        }
        i++;
    };
        
    
    for (int k=n-1;k>=0;k--){
        cout<<arr[k]<<" ";
    };
    cout<<" "<<endl;
    cout <<sum-2;
  
    }

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include <iostream>
using namespace std;

void swp(int& x, int& y) {
int tmp; tmp=x; x=y; y=tmp;
}
  int main(){
int sum = 0 , n , X ;
cin>>n;
int Arr[n];
for(int i =0;i<n;i++){
cin >> Arr[i];
    }
cin >> X;

for (int i =0; i<n/2; i++){
    swp ( Arr[i] , Arr [n-i-1] ) ;
}
for (int i=0;i<n;i++){
    cout<<Arr[i]<<" ";
    }
    cout<<endl; 
for (int i=0; i<n ; i++){
    if(Arr[i]> X){
        sum += Arr[i];
    }
}
cout << sum ;
}

Grading criterion: Calculating sum
Rating A: correctly keeps accumulating the sum if greater than x

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A