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

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

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 sumv(int arr[],int x,int n) {
    int sumi=0;
    for(int i=0;i<n;++i){
        if (arr[i]>x){
            sumi+=arr[i];
        }
    }
    return sumi;
}
void display(int arr[], int n){
    for (int i=n-1;i>=0;--i){
        cout<<arr[i]<<" ";
    }
    cout<<endl;
}
int main() {
    int n;
    cin>>n;
    int arr[n];
    for(int i=0;i<n;++i){
        cin>>arr[i];
    }
    int x;
    cin>>x;
    display(arr,n);
    cout<<sumv(arr,x,n)<<endl;
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

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 a=n-1;a>-1;a--){
        cout << arr[a]<<" ";
    }
    cout <<endl;
    for(int b=0;b<n;b++){
        if(arr[b]>x){
            sum+=arr[b];
        }
    }
    cout<<sum<<endl;
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

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]<<" ";
    }
    cout<<endl;
    int k=0;

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

    cout<<k;
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

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 arr[100]; 
    int n; cin >> 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 total=0;
    for (int i=0;i<n;i++){
        if (arr[i]>X){
            total=total+arr[i];
        }
    }
    cout << total;
    return 0;
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

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;
    int sum =0;
    int arr[N];
    cin>>N;
    
   
    for(int i=0;i<N; i++){
        cin>>arr[i];
    }

    cin>>X;

    for(int i=N-1;i>-1; i--){
        cout<<arr[i];
    }
    cout<<endl;

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

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

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 a[n] ;
    for(int i=0 ;i<n ;i++ ) {
        cin>>a[i] ;
    }
    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 ;
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

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];}
    for (int i=n-1;i>=0;i--)
    {cout<<arr[i]<<' ';}
    cout<<'\n';
    int X;int s=0;
    cin>>X;
    for(int i=0;i<n;i++)
    {if(arr[i]>X)
      s=s+arr[i];}
      cout<<s;
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

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>
#include<vector>
using std::cout;
using std::cin;
using std::endl;
int main(){
    std::vector<int> vec(100,0);
    int a;
    int x;
    int k=0;
    cin>>a;
    for(int i=0;i<a;i++){
        int b;
        cin>>b;
        vec[i]=b;
    }
    cin>>x;
    for(int i=1;i<=a;i++){
        if(vec[a-i]!=0)cout<<vec[a-i]<<" ";
    }
    cout<<endl;
    for(int i=0;i<a;i++){
    
        if(vec[i]>x)k=k+vec[i];
    }
    cout<<k;
    
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

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::cin; using std::cout; using std::endl;

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

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

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, sum=0, X;
    cin >> n;
    int arr[n];
    int i;
    if(n>=0 && n<=100)
    {
    for(i=0; i<n; i++)
    {
        cin >> arr[i];
        if(arr[i]>=-500 && arr[i]<=500)
        cout << arr[i] << " ";
    }
    cin >> X;
    cout << "\n";
    for(i=0; i<n; i++)
    {
        if(arr[i]>X)
        {
            sum+=arr[i];
        }
    }
    cout << sum << endl;
    }
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

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,x,sum=0;
    std::cin>>n;
    int arr[n];
    for(int i=0; i<n; i++)
    {
        std::cin>>arr[i];
    }
    std::cin>>x;
    for(int i=0; i<n; i++)
    {
        cout<<arr[n-i-1]<<" ";
    }
    cout<<endl;
    for(int i=0; i<n; i++)
    {
        if(arr[i]>x) sum+=arr[i];
    }
    cout<<sum;
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

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;
    cin>>N;
    int sum=0;
    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]<<" ";
        if(arr[i]>X){
            sum=sum+arr[i];
        }
    }
    cout<<endl<<sum;
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

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--){
        if(arr[i]>X)sum+=arr[i];
        cout<<arr[i]<<" ";
    }
    cout<<endl<<sum;
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

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>
#include<vector>
using std::vector;
using namespace std;
void sum( const vector<int> &arr, int x){
    int sum =0;
    for(int i:arr){
        if(i>x){
            sum+=i;
        }
    }
    cout << sum;
    return;
}

int main(){
    int vector<int> arr;
    int n,x;
    cin >>n;
    for(int i=0;i<n;i++){
        int a;
        cin >> a;
        arr.push_back(a);
    }
    cin >>x;

    cout << endl;
    
    
    while(n--){
        cout << arr[n] << " ";
    }

    cout << endl;

    sum(arr,x;);
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

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>
#include<vector>
using std::vector;
using namespace std;

 void read(vector<int> &v,int N){
    int i;
    for(i=0;i<N;i++){
        cin>>v[i];
    }
}

void out(vector<int>& v,int N){
    int i;
    for(i=N-1;i<=0;i--){
        cout<<v[i];
    }
}
void sum(vector<int>& v, int x){
  for( auto p=v.begin(),q=v.end(); p!=q; ++p){
    int sum=0;
    int t=*p;
    if (t>x){
        sum =sum+t;
        cout<<sum;
    }
  }
}
int main(){
    vector<int> v;
    int N,x;
    cin>>N;
   
    read(v,N);
    cin>>x;
    out(v,N);
    sum(v,x);
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

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::cin;
    using std::cout;
    using std::endl;
    int main(){
int n;
cin >> n;
int arr[n];

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

cin >> p;


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

int sum = 0;
for (int j=0;j<n;j++){
    if (arr[j]>p){
        sum=sum+arr[j];
    }
    
}

cout << sum << endl;
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

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 j=n-1;j>=0;j--){
        cout<<arr[j]<<" ";
    }
    int sum=0;
    for(int i=0;i<n;i++){
        if(arr[i]>X){
            sum=sum+arr[i];
        }
    }
    cout<<" "<<endl;
    cout<<sum;
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

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];
    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+=A[i];
    cout<<sum;
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

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 K[n];
    for(int i=0;i<n;i++){
        cin>>K[i];
    }
    int x;
    cin>>x;
    int sum=0;
    for(int i=n-1;i>=0;i--){
        if(K[i]>x){
            sum+=K[i];
        }
        cout<<K[i]<<" ";
    }
    cout<<endl;
    cout<<sum<<endl;
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order

Rating B: Some issue. 
Rating C: Major issue. 

Rating D: 0
Assigned grade: A