CodeGraderBench/CodeGraderBench huggingface dataset:
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include <iostream>
#include <vector>

int main(){
    int n;
    int temp;
    std::vector<int> vec;

    std::cin >> n;
    
    for(int i = 0 ; i < n; i++){
        std::cin >> temp;
        vec.push_back(temp);
    }

    for(auto iter = vec.end() - 1; iter >= vec.begin(); iter--){
        std::cout << *iter << " ";
    }

    std::cout << std::endl;

    for(auto & i: vec){
        if(i%2 == 1){
            i = 0;
        }
    }

    for(auto & i : vec){
        std::cout << i << " ";
    }
    
    std::cout << std::endl;

    return 0;
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
#include<vector>
using std::cin; using std::cout;
using std::endl; using std::vector;
int main(){
    int n;
    cin>>n;
    vector<int> v(n);
    for(int i=0; i<v.size(); i++){
        cin>>v[i];
    }
    for(int i=(v.size()-1); i>=0; i--){
        cout<<v[i]<<" ";
    }
    cout<<endl;
    for(int i=0; i<v.size(); i++){
        if(v[i]%2 != 0){
            v[i]=0;
        }
    }
    for(int i=0; i<v.size(); i++){
        cout<<v[i]<<" ";
    }
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

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

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
#include<vector>
using namespace std;
int main()
{
    int n;
    cin>>n;
    
    int arr[100];
    int rev[100];
    int newa[100];
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
    }
   
    for(int j=0;j<n;j++)
    {
        
        rev[j]=arr[n-j-1];
        cout<<rev[j]<<" ";
    }
cout<<" "<<endl;
    for(int i=0;i<n;i++)
    {
        newa[i]=arr[i];
        if(newa[i]%2!=0)
        {
            newa[i]=0;
        }
        cout<<newa[i]<<" ";
    }
    
   
    
   
        
        
        
    
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

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

int main() {
    using std::vector;
        std::vector<int>
        if(command == "open") {
        vector <array> integers;
        else if (command == "close") {
        string integers;
        void elements;
        int reverse order;
        bool replaceodd;
         }
     }
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: C
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
#include<vector>
using namespace std;
int main(){
    int n;
    cin>>n;
    int arr[n];
    //if(n>100) {cout<<"Max 100 integers accepted"; return 0;}
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    for(int i=n-1;i>=0;i--){
        cout<<arr[i]<<" ";
    }cout<<endl;
    for(int i=0;i<n;i++){
        if(arr[i]%2==1){arr[i]=0;}
    }
    for(int i=0;i<n;i++){
        cout<<arr[i]<<" ";
    }
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
#include<vector>
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 << endl ;
    for (int i=0;i<N ; i++){
        if(arr[i]%2) arr[i]=0 ;
    }
    for (int i=0;i<N ; i++){
        cout <<  arr[i]<<" ";
    }

    
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;
int main(){
    int N,A[100];
    cin>>N;
    for(int i=0;i<N;i++){
        cin>>A[i];
    }
    for(int i=N-1;i>=0;i--){
        cout<<A[i]<<" ";
    }
    cout<<endl;
    for(int i=0;i<N;i++){
        if(A[i]%2!=0){
            A[i]=0;
        }
        cout<<A[i]<<" ";
    }
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;
int main(){
    int n, 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;
    for(int i=0; i<n; i++){
        if(arr[i]%2!=0)
            cout<<"0 ";
        else
            cout<<arr[i]<<" ";
    }
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

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];
    }
    for(int i=n-1;i>=0;i--){
        cout<<arr[i]<<' ';
    }
    cout<<endl;
    for(int i=0;i<n;i++){
        if(arr[i]%2!=0){
            arr[i]=0;
        }
    }
    for(int i=0;i<n;i++){
        cout<<arr[i]<<' ';
    }
    cout<<endl;
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

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

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;
int main(){
    int n; std::cin>>n;
  int num[n]={};
 
   for(int i=0; i<n;i++){
    std::cin>>num[i];
   }

   for (int j=n-1;j>=0;j--){
    std::cout<<num[j]<<" ";}
  std::cout<<" "<<endl;
   for(int l=0; l<n;l++){
    if(num[l]%2==1){num[l]=0;
    }
   }
    for(int m=0; m<n;m++){
        std::cout<<num[m]<<" ";
    }
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include <iostream>
#include <vector>
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 <<endl ;
    for(int i=0; i<n ; ++i){
     if(arr[i]%2!=0){
        arr[i]=0;
     }
    }
    for(int i=0; i<n ; ++i){
       cout <<arr[i] <<" " ;
    }
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;
int main(){
    int N; cin>>N;
    int*p = new int[N];
    for(int k=0;k<N;k++){
        int c;cin>>c;
        p[k]=c;
    }
    for(int k=N-1;k>=0;k--){
        cout<<p[k]<<" ";
    }
    cout<<endl;
    for(int k=0;k<N;k++){
        if (p[k]%2==1){
            p[k]=0;
        }
        cout<<p[k]<<" ";
    }
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include <iostream>

using namespace std;

int main(){

    int n;
    cin >> n;

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

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

    cout << " " <<endl;

    for(int i=0; i<n; i++){
        if ( (num[i])%2 != 0){
            num[i] = 0;
        }
        cout << num[i] <<" ";
    }
    
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

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

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

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

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include <iostream>
#include <iomanip>
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<<endl;
    for(int i=0; i<n; i++){
        if(arr[i]%2==0)
            cout<<arr[i]<<" ";
        else
            cout<<"0 ";
    }
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

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