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>
using std::cout; using std::cin; using std::endl;
int main()
{
    int n;
    cin>>n;
    int A[n];
    for(int i=0;i<n;i++)
        {cin>>A[i];}
    for(int k=(n-1);k>=0;k--)
    {
        cout<<A[k]<<" ";
    }
    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>
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>-1;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 a[100];
    int 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!=0){
            a[i]=0;
        }
    }
    for(int i=0;i<n;i++){
        cout<<a[i]<<" ";
    }
    cout<<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>
using namespace std;
int main(){
    
    int i=0,n;
    cin>>n;
    int a[n];
    if (n>0 && n<=100)
    {
    for (i=0;i<=n-1;i++)
    {
        cin>>a[i];
    }
    }
    for (i=n-1;i>=0;i--)
    {
        cout<<a[i]<<" ";
    }
    cout<<"\n";
    for (i=0;i<=n-1;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>
using std::cout; using std::cin; using std::endl;
int main () {
    int k;
    char integers[];
    if {
    for (cin >> k ; k%2==0 ; cin>> k )
    for ( int i=0 , i<=100 ,i++ )
    integers[i]=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: 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>
void reverse(std::vector<int> A){
    
    for( int j=(A.size()-1); j>=0; j--){
std::cout<<A[j]<<" ";
    }
}
void odd(std::vector<int> A){
    
    for(int i=0;i<A.size();i++){
        if(A[i]%2==1){std::cout<<"0"<<" ";}
        else std::cout<<A[i]<<" ";
    }
}
int main(){
    int n;
    std::vector<int> A;
    std::cin>>n;
    for (int i=0; i<n;i++){
        int a;
        std::cin>>a;
        A.push_back(a);
    }
    reverse(A);
    std::cout<<std::endl;
    odd(A);
}

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>
#include <string>
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=0;i<N;i++){
        cout << arr[N-1-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 arr[N];
    for(int i=0; i<N;i++){
        cin>> arr[i];
    }
    for (int i=0;i<N;i++){
        cout<<arr[N-i-1]<<" ";
    }
    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 a[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;
        }
    }
    for(int i=0; i<n; i++) {
        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;
    vector<int>v;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        v.push_back(x);
    }

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

    for(int i=0;i<n;i++){
        if(v[i]%2!=0){
            v[i]=0;
        }
    }
    for(int i=0;i<n;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>
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++) {cout<< ((!(arr[i]%2)) ? arr[i]:0)<<" ";}
cout<<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>
using namespace std;
int main(){
    int arr[100];
    int a;
    cin>>a;
    for(int i=0;i<a;i++){
        cin>>arr[i];
    }
    for(int i=a-1;i>=0;i--){
        cout<<arr[i]<<" ";
    }
    cout<<endl;
    for(int i=0;i<a;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
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 A[100];
        int n;
        cin>>n;
        for(int i=0;i<n;++i){
        cin>>A[i];
                }
        
        for(int j=0;j<n;++j) {cout<<A[n-j-1]<<" ";
                }
        cout<<endl;
         for(int k=0;k<n;++k){
        if(A[k]%2!=0){A[k]=0;
        }}
    
        
        for(int l=0;l<n;++l) {cout<<A[l]<<" ";
        }}

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 A[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){
            cout<<A[i]<<" ";
        }
        else{
            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 std::cin;
using std::cout;
int main(){
    int n;
    cin>>n;
    if(n<=100){
        int arr[100];
        int mod[100];
        for(int i=0;i<n;++i){
            cin>>arr[i];
            if(arr[i]%2==0){
                mod[i]=arr[i];
            }
            else mod[i]=0;
        }
        for(int j=n-1;j>=0;j--){
            cout<<arr[j]<<" ";
        }
        cout<<std::endl;
        for(int k=0;k<n;++k){
            cout<<mod[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:
ay [1];
{}#include<iostream>
using namespace std;
int main{} {
   int 1;
   int array a;
   cin >> a;
   

}
cin >> arr

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>
using namespace std;
int main(){
    int x;
    cin>>x;
    int array[x];
    for(int k=0;k<x;k++){
        cin>>array[k];
    }
    for(int k=x-1;k>=0;k--){
        cout<<array[k]<<" ";

    }
    cout<<endl;
    for(int k=0;k<x;k++){
        if(array[k]%2!=0){
            array[k]=0;
        }
    }
    for(int k=0;k<x;k++){
        cout<<array[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>
#include <vector>
using namespace std;
int main(){
    int A[100];
    int n; cin>>n;
    int x;
    for(int i=0; i<n; i++){
        cin>>x;
        A[i]=x;
    }
    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) A[i]=0;
    }
    for(int i=0; i<n; i++){
        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