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

Grading criterion: Output
Rating A: Correctly prints the output

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: 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 B[100];


    int n;
     cin>> n;
    for(int i =0 ; i<n; i++){
        cin>>A[i];
    }
    for(int i=0;i<n;i++){
        B[i]=A[i];
    }
    for(int i=0; i<(n-1)/2; i++ ){
        A[i]=A[n-i-1];

    }
    for(int i=(n-1)/2;i<n;i++){
        A[i]=B[n-i-1];
    }
    for(int i=0; i<n-1; i++){
        cout<<A[i]<<" ";
    }
    cout<<A[n-1]<<endl;
    for(int i=0; i<n;i++ ){
        if(B[i]%2!=0)
            B[i]=0;
    }
    for(int i=0;i<n;i++){
        cout<<B[i]<<" ";
    }
}

Grading criterion: Output
Rating A: Correctly prints the output

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 n;
    std::cin>>n;
    int A[n];

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

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

for(int i=0;i<n;i++)
std::cout<<A[i]<<" ";
    return 0;
}

Grading criterion: Output
Rating A: Correctly prints the output

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: 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> list(N);
    int c, i = 0;
    for (; i < N;){
        cin >> c;
        list[i] = c;
        ++i;
    }
    for (int k = 0; k < N; ++k) cout << list[N-k-1] << " ";
    cout << endl;
    for (int k = 0; k < N; ++k){
        if (list[k]%2 != 0) list[k] = 0;
    }
    for (int k = 0; k < N; ++k) cout << list[k] << " ";
}

Grading criterion: Output
Rating A: Correctly prints the output

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)==1){
            a[i]=0;
        }
    }
    for(int i=0;i<N;i++){
        cout<<a[i]<<' ';
    }
}

Grading criterion: Output
Rating A: Correctly prints the output

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){
            cout<< A[i]<<" ";
        }
        else cout<<"0 ";
    }
    cout<<endl;
    return 0;
}

Grading criterion: Output
Rating A: Correctly prints the output

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: 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==1){
            a[i]=0;
        }
    }
    for(int i=0;i<n;i++){
        cout<<a[i]<<" ";
    }
}

Grading criterion: Output
Rating A: Correctly prints the output

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;
void printReverse(vector<int> arr){
    int len = arr.size();
    for (int i = len -1 ; i > -1 ; i--){
       cout << arr[i] << " ";
    }
    cout<<endl;
}
void repOdd(vector<int> &arr){
    int len = arr.size();
    for(int i = 0 ; i < len ; i++){
        if(arr[i]%2 == 1){
            arr[i] = 0;
        }
    }
}
void printarr(vector<int> arr){
    int len = arr.size();
    for (int i = 0 ; i < len ; i++){
       cout << arr[i] << " ";
    }
    cout<<endl;
}
int main(){
    int len;
    cin >> len;
    vector<int> nums;
    for(int i = 0 ; i<len ;i++){
        int temp;
        cin >> temp;
        nums.push_back(temp);
    }
    printReverse(nums);
    repOdd(nums);
    printarr(nums);
}

Grading criterion: Output
Rating A: Correctly prints the output

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

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], n;
    cin>>n;
    for(int i=0;i<n;i++)
    cin>>A[i];
    for(int i=n-1; i>-1;i--)
    cout<<A[i]<<" ";
    cout<<"\n";
    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: Output
Rating A: Correctly prints the output

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

Grading criterion: Output
Rating A: Correctly prints the output

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

    for(int j=0;j<N;++j) {
        if(A[j]%2 != 0) {
            A[j] = 0;
    }
    }
    for(int k=0;k<N;k++) {
        cout<<A[k];
    }
    return 0;
}

Grading criterion: Output
Rating A: Correctly prints the output

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

Grading criterion: Output
Rating A: Correctly prints the output

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) {
        cout<<"0"<<" ";
    }
    else cout<<array[i]<<" ";
 }
}

Grading criterion: Output
Rating A: Correctly prints the output

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> X;
    for (int j=0;j<N;j++) {
        int element; 
        cin>>element;
        X.push_back(element);
    }
    for (int p=X.size()-1;p>=0;p--) {
        cout << X[p] <<" " ;
    } 
    cout <<endl;
    
    for (int i=0;i<X.size();i++) {
    if (X[i]%2!=0) {
        X[i] = 0;
    }
    }

    for (int k=0;k<X.size();k++) {
        cout << X[k]<<" " ;
    } 
}

Grading criterion: Output
Rating A: Correctly prints the output

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

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

Grading criterion: Output
Rating A: Correctly prints the output

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: 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: Output
Rating A: Correctly prints the output

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