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 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: Output
Rating A: Correctly prints the output

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

Grading criterion: Output
Rating A: Correctly prints the output

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 c=0;
    for(int i=0; i<N; i++){
        if(A[i]>X){
            c=c+A[i];
        }
    }
    cout << c;
}

Grading criterion: Output
Rating A: Correctly prints the output

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

cout<<endl<<sum;
}

Grading criterion: Output
Rating A: Correctly prints the output

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

    for (int j = 1; j<=n ; j++){
        cout << arr[n-j] << ' ';
    }

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

Grading criterion: Output
Rating A: Correctly prints the output

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

Grading criterion: Output
Rating A: Correctly prints the output

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

Grading criterion: Output
Rating A: Correctly prints the output

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

Grading criterion: Output
Rating A: Correctly prints the output

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

Grading criterion: Output
Rating A: Correctly prints the output

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

Grading criterion: Output
Rating A: Correctly prints the output

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;
    vector<int> v;
    for(int i=0; i<n; i++){
        int m;
        cin>>m;
        v.push_back(m);
    }
    int f;
    cin>> f;
    int sum=0;
    for (int i=0; i<n; i++){
        if(v[i]>f) {
            sum= sum + v[i];
        }
    }
    for(int i=(n-1); i>-1; i--){
        cout<<v[i]<<" ";
    }

    cout<<endl<<sum;
}

Grading criterion: Output
Rating A: Correctly prints the output

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;
    int sum=0;
    cin>>N;

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

Grading criterion: Output
Rating A: Correctly prints the output

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include<simplecpp>
main_program{
    char p1,p2;
    cin>>p1>>p2;
         if(p1==p2){
            cout<<"T";
             }
        if(p1=='r' && p2=='s'){
            cout<<"1";
        }else if(p1=='r' && p2=='p'){
            cout<<"2";
        }else if(p1=='s' && p2=='p'){
            cout<<"1";
        }else if(p1=='s' && p2=='r'){
            cout<<"2";
        }else if(p1=='p' && p2=='s'){
            cout<<"2";
        }else if (p1=='p' && p2=='r'){
            cout<<"1";
        }
}

Grading criterion: Output
Rating A: correctly prints the output
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: A
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include<simplecpp>
main_program{

int p,r,s;

cin>>p>>r>>s;

int  a,b;
cin>>a>>b;


if (a==r && b==p)
cout<<"2";

else if (a==p && b==s)
cout<<"2";

else if (a==s && b==r)
cout<<"2";

else if (a==p && b==r)
cout<<"1";

else if (a==s && b==p)
cout<<"1";

else if (a==r && b==s)
cout<<"1";

else if (a==r && b==r)
cout<<"T";

else if (a==p && b==p)
cout<<"T";

else if (a==s && b==s);
cout<<"T";









 

return (0);
}

Grading criterion: Output
Rating A: correctly prints the output
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: A
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include<simplecpp>
main_program
{
    char a,b;
    cin>>a>>b;
    if(a=='r' && b=='s')
    {
        cout<<"1"<<endl;
    }
    else if(a=='r' && b=='p')
    {
        cout<<"2"<<endl;
    }
    else if(a=='r' && b=='r')
    {
        cout<<"T"<<endl;
    }
    else if(a=='p' && b=='r')
    {
        cout<<"1"<<endl;
    }
    else if(a=='p' && b=='s')
    {
        cout<<"2"<<endl;
    }
    else if(a=='p' && b=='p')
    {
        cout<<"T"<<endl;
    }
    else if(a=='s'&& b=='p')
    {
        cout<<"1"<<endl;
    }
    else if(a=='s' && b=='r')
    {
        cout<<"2"<<endl;
    }
    else if(a=='s' && b=='s')
    {
        cout<<"T"<<endl;
    }
}

Grading criterion: Output
Rating A: correctly prints the output
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: A
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include <simplecpp>

main_program{
    char p1, p2;
    cin >> p1 >> p2;

    if (p1 == 'r'){
        if (p2 == 's') cout << 1 << endl;
        else if (p2 == 'p') cout << 2 << endl;
        else cout << 'T' << endl;
    }
    else if (p1 == 's'){
        if (p2 == 's') cout << 'T' << endl;
        else if (p2 == 'p') cout << 1 << endl;
        else cout << 2 << endl;
    }
    else{
        if (p2 == 's') cout << 2 << endl;
        else if (p2 == 'p') cout << 'T' << endl;
        else cout << 1 << endl;
    }
}

Grading criterion: Output
Rating A: correctly prints the output
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: A
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include<simplecpp>
main_program{
    char a,b ;
    cin >> a >> b ;
    if(a==b)
    cout << "T" << endl;
    else if (a=='r' && b == 'p')
  cout << 2 <<endl ;
    else if ( a=='r' && b=='s')
    cout <<1 << endl ;
    else if (a=='s' && b=='r')
    cout << 2 << endl;
    else if (a=='s' && b=='p')
    cout << 1 << endl ;
    else if (a=='p' && b=='r')
   cout << 1 << endl;
    else if (a=='p' && b=='s')
   cout << 2 <<endl ;
    }

Grading criterion: Output
Rating A: correctly prints the output
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: A
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include<simplecpp>
main_program{
    char a,b;
    cin >> a >> b;
    if(a=='r'){
        if(b=='r'){
            cout <<"T";
        }
        if(b=='s'){
            cout<<"1";
        }
        if(b=='p'){
            cout<<"2";
        }
    }
    if(a=='s'){
        if(b=='s'){
            cout <<"T";
        }
        if(b=='p'){
            cout<<"1";
        }
        if(b=='r'){
            cout<<"2";
        }
    }
    if(a=='p'){
        if(b=='p'){
            cout <<"T";
        }
        if(b=='r'){
            cout<<"1";
        }
        if(b=='s'){
            cout<<"2";
        }
    }
}

Grading criterion: Output
Rating A: correctly prints the output
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: A