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:: cin; using std:: cout; using std:: swap; using std:: endl;
int main(){
    int n;
    cin>> n;
    int arr[n];
    int brr[n];
    for(int i=0; i<n; i++){
        cin>> arr[i];
    }
    for(int i=0; i<n; i++){
        brr[i]=arr[n-1-i];
    }
    
    
    for(int i=0; i<n; i++){
        cout<< brr[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: Declaration of variables and array/vector
Rating A: correctly declares the variable n, and array/vector
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 ;
void reverse(int A[] , int n){
    int B[100];
    for(int i = 0 ; i<n  ; i++){
        B[n-1-i] = A[i];
    }
    for(int j = 0 ; j<n ; j++){
        cout<<B[j]<<" ";
    }
}
int main(){
    int NMAX = 100;
    int A[NMAX];
    int n;
    cin>>n;
    for(int i = 0 ; i<n ; i++){
        cin>>A[i];
    }
    reverse(A , n);
    cout<<endl;
    for(int j = 0 ; j<n ; j++){
        if(A[j]%2){
            A[j] = 0;
        }
    }
    for(int k = 0 ; k<n ; k++){
        cout<<A[k]<<" ";
    }

}

Grading criterion: Declaration of variables and array/vector
Rating A: correctly declares the variable n, and array/vector
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++){
        if(arr[i]%2==1){
            arr[i]=0;
        }}

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


    }

Grading criterion: Declaration of variables and array/vector
Rating A: correctly declares the variable n, and array/vector
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>-1;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: Declaration of variables and array/vector
Rating A: correctly declares the variable n, and array/vector
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(){
    int a;
    std::cin>>a;
    int A[a];
    for(int i=0;i<a;i++){
        std::cin>>A[i];
    }
    for(int i=0;i<a;i++){
      std::cout<<A[a-1-i]<<" ";
    }
    std::cout<<" "<<std::endl;
    for(int i=0;i<a;i++){
        if(A[i]%2!=0){
                A[i]=0;
    }}
        for(int i=0;i<a;i++){
        std::cout<<A[i]<<" ";
    }


}

Grading criterion: Declaration of variables and array/vector
Rating A: correctly declares the variable n, and array/vector
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::vector; 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 i=n-1; i>=0; i--) {
        cout<<a[i]<<" " ;
        if (a[i]%2!=0) a[i]=0 ;
    }
    cout<<endl ;
    for (int i=0; i<n; i++) cout<<a[i]<<" ";
    cout<<endl ;
}

Grading criterion: Declaration of variables and array/vector
Rating A: correctly declares the variable n, and array/vector
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 j=n-1;j>=0;j--){
        cout << Arr[j] << " ";
    }cout << endl;
    for(int k=0;k<n;k++){
        if(Arr[k]%2!=0){
        Arr[k]= 0;
        }cout << Arr[k] << " ";
        
    }cout << endl;
   

    return 0;
}

Grading criterion: Declaration of variables and array/vector
Rating A: correctly declares the variable n, and array/vector
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::vector;

int main() {
    int n;
    cin >> n;
    vector<int> arr(n);
    for (int i = 0; i < n; i++) {
        cin >> arr[i];
    }
    for (int i = n-1; i >= 0; i--) {
        cout << arr[i] << " ";
        if (arr[i] % 2 != 0) {
            arr[i] = 0;
        }
    }
    cout << std::endl;
    for (int i = 0; i < n; i++) {
        cout << arr[i] << " ";
    }
}

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

Grading criterion: Declaration of variables and array/vector
Rating A: correctly declares the variable n, and array/vector
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=0; i<n;i++ ) cout<<A[n-i-1]<<" ";
   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: Declaration of variables and array/vector
Rating A: correctly declares the variable n, and array/vector
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;
    int arr[n];
    int num = 0; 
    for(int i=0; i<n; i++){
        cin>>num;
        if(num%2 == 0){
            v.push_back(num);
        }
        else {
            v.push_back(0);
        }
        arr[n-1-i] = num;
    }
    for(int i=0; i<n; i++){
        cout << arr[i] << ' ';
    }
    cout <<'\n';
    for(int i=0; i<n; i++){
        cout << v[i] << ' ';
    }
}

Grading criterion: Declaration of variables and array/vector
Rating A: correctly declares the variable n, and array/vector
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 arr1[N];
    int arr2[N];
    int i=0;
    for(int i = 0; i < N; i++) {
cin >> arr1[i];}
for(int j=0;j<N;j++){
    arr2[j]=arr1[N-1-j];
cout << arr2[j] << " ";}
cout <<endl;
    for(int i=0;i<N;i++){
        if(arr1[i]%2!=0){
        arr1[i]=0;}
    }
for(int i=0; i<N;i++){
cout << arr1[i] << " ";
    }
}

Grading criterion: Declaration of variables and array/vector
Rating A: correctly declares the variable n, and array/vector
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 series[100];
    int n;
    cin>>n;
    for(int i=0;i<n;++i){
        cin>>series[i];
    }
    for(int i=n-1;i>=0;--i){
        cout<<series[i]<<" ";
    }
    cout<<endl;
    for(int i=0;i<n;++i){
        if(series[i]%2==1){
            series[i]=0;
        }
    }
    for(int i=0;i<n;++i){
        cout<<series[i]<<" ";
    }
}

Grading criterion: Declaration of variables and array/vector
Rating A: correctly declares the variable n, and array/vector
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;using std::endl;
int main () {
    int f;
    cin>>f;
    if (f>100) {
        cout<<"Limit Is Upto 100 numbers";
    }
    else
  { int A[f];
   int a=0;
   while(a<f){
int b;
cin>>b;
A[a]=b;
a++;
   }
   int d;
   d=a;
   a--;
   while(a>=0) {
    int c;
    c=A[a];
    cout<<c<<" ";
    a--;
   }
   cout<<endl;
   a++;
   while(a<d) {
    int e;
    e=A[a];
    if ((e%2)==0) {
cout<<e<<" ";
    }
    else cout<<"0 ";
    a++;
   }
  }
}

Grading criterion: Declaration of variables and array/vector
Rating A: correctly declares the variable n, and array/vector
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; using std::endl;

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

void replaceOdd(int numbers[], int n) {
    for (int i = 0; i < n; i++) {
        if (numbers[i]%2 != 0)
            cout << "0 ";
        else
            cout << numbers[i] << " ";
    }
    cout << endl;
}

int main() {
    int n; cin >> n;
    int numbers[n];
    for (int i = 0; i < n; i++) cin >> numbers[i];
    printReverse(numbers, n);
    replaceOdd(numbers, n);
}

Grading criterion: Declaration of variables and array/vector
Rating A: correctly declares the variable n, and array/vector
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-1;i>=0;i--){
        cout<<array[i]<<" ";
    }
    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]<<" ";
    }
    return 0;

}

Grading criterion: Declaration of variables and array/vector
Rating A: correctly declares the variable n, and array/vector
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(){
    unsigned 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;
        cout<<arr[i]<<' ';
    }
    return 0;
}

Grading criterion: Declaration of variables and array/vector
Rating A: correctly declares the variable n, and array/vector
Rating B: Some issue. 

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