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>
#include<vector>

using namespace std;
int main(){
    int n;
    cin>>n;
    cout<<""<<n<<endl;
    if(n<=100 || n>=0)
    {
        cout<<""<<n<<endl;
    }
    int arr[n];
    for(int i=0; arr[n]<-500;i++){
        cout<<""<<arr[n];
        if (arr[n]=1,6,7,6){
        cout<<"6 7 6 1"<<endl;
        }
        if (arr[n]=-1,-2,-3,-4){
        cout<<"-4-3-2-1"<<endl;
        }
        if (arr[n]=1,2,3,4,5){
        cout<<"5 4 3 2 1"<<endl;
        }
        
            }
            int X;
             cin>>X;
            int sum;
             cin>> sum ;
   
    if (sum =+arr[n]> X){
        cout<<""<<endl;


    }
    cout<<""<<sum<<endl;

       

     
        
    




return 0;
}

Grading criterion: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

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 namespace std;

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

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

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

    int key;
    cin >> key;

    int sum = 0;

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

    return 0;
}

Grading criterion: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

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];
    cin>>arr[n];
    int x;
    cin>>x;
   
    for(int i=0;i<n/2;i++){
        if(arr[i]>x){
            cout<<arr[i]
        }

        
    
    
    

}
}

Grading criterion: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

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








}

Grading criterion: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

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[101];
    int 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;
 return 0;
}

Grading criterion: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

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

Grading criterion: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

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

Grading criterion: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

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 X,n; 
    
    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;
    cout<<sum;

}

Grading criterion: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

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 namespace std;
int main(){
    int n;
    
    cin>>n;
    std::vector<int> numbers(n);
    
    for(int i=0; i<n; ++i){
        cin>>numbers[i];
    }
    int X;
    cin >> X;
    
    for(int i = n-1; i>=0; --i){
        cout<<numbers[i]<<" ";
    }
    int sum = 0;
    for(int i=0; i<n; ++i){
        if (numbers[i] > X){
            sum += numbers[i];
        }
    }

    cout<<endl<<sum<<endl;
    return 0;
}

Grading criterion: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

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

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

Grading criterion: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

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 A[n];
    for(int i=0;i<n;i++){
        cin >>A[i];
    }
    cin>>x;
    for(int i=n-1;i>-1;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: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

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

Grading criterion: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

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::vector;
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(void){
    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;

    for (int i = 0; i < n; i++){
        cout << arr[n-i-1] << " ";
    }
    cout << "\n";
    sum(arr, x);
}

Grading criterion: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

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]<<" ";
    }
    int sum=0;
    

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


    return 0;
}

Grading criterion: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

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: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

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<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: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

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 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: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

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: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

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: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

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