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;
int main(){
    int A[100];
    int n;
    cin>>n;
    for(int i=0; i<n; i++){
        cin>>A[i];
    }
    for(int j=n-1; j>=0; j--){
        cout<<A[j]<<" ";
    }
    cout<<"\n";
    for(int i=0; i<n; i++){
        if(A[i]%2!=0){
            A[i]=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>
#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 = 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: 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 x;
    cin>>x;
    vector<int>A(x);
    for (auto& p:A){
        cin>>p;
    }
    for (auto p=A.end()-1; p>=A.begin();p--){
        cout<<*p<<" ";
    }
    cout<<"\n";
    for (auto& p:A){
        if(p%2!=0){
            p=0;
        }
    }
    for (auto p:A){
        cout<<p<<" ";
    }
}

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

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

 for(int j=n-1;j>=0;j--){
    cout<< array[j]<<" ";}
    cout<<endl;

   for( int k=0;k<n;k++){
    if(array[k]%2 !=0){
        array[k]=0;
    }}

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

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[100];
    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]<<" ";
    }
    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-1];
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: 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 num[N];
    for (int i=0; i<N; i++) {       
        cin>>num[i];
    }
    int numModified[N];
    for (int i=0; i<N; i++) {
        numModified[i]=num[i];      //copying input array to other array
    }
    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) {          //replacing odd element with zero
            num[i]=0;
            cout<<num[i]<<" ";
        }
        else {
            cout<<num[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(){
    int N;
    cin>>N;
    int arr[100];
    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: 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!=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: B
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> A;

    for (int i = 0; i < n ; ++i) {
        int x;
        cin >> x;
        A.push_back(x);
    }

    for (int i = n; i > 0; --i)
        cout << A[i-1] << " ";
    cout << endl;
    
    for (int i = 0; i < n; ++i)
        if (A[i]%2 == 1)
            A[i] = 0;
    
    for (int i = 0; i < A.size(); ++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 std::cin,std::cout,std::endl;
int main(){
    int n;
    cin>>n;
    int numbers[n];
    for(int i=0;i<n;i++){
        cin>>numbers[i];
    }
    //reverse printing
    for(int i=n;i>0;i--){
        cout<<numbers[i-1]<<' ';
    }
    cout<<endl;
    //part 2
    for(int i=0;i<n;i++){
        if(numbers[i]%2==0) cout<<numbers[i]<<' ';
        else cout<<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(){
    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==1) arr[i]=0;
    }
    for(int i=0;i<n;i++){
        cout<<arr[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>
#include <vector>
using namespace std;

int main() {
    int N;
    cin >> N;
    if (N > 100) return -1;
    vector<int> arr;
    for (int i=0; i<N; i++) {
        int x; cin>>x; arr.push_back(x);
    }
    
    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 == 1) arr[i] = 0;

    for (int i=0; i<N; i++) cout << arr[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