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 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: 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=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: 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) {
        cout<<"0"<<" ";
    }
    else cout<<array[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> 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: 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 - (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 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: 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!=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>
#include <vector>
using std::cout;
using std::cin;
using std::vector;
using std::endl;
int main() {
    int N; cin >> N;
    vector<int> inputArray(N, -1);
    for(int i = 0; i < N; i++) {
        int input; cin >> input;
        inputArray[i] = input;
    }
    for(int i = N-1; i > -1 ; i--) {
        cout << inputArray[i] << " ";
    }
    cout << endl;
    for(int i = 0; i < N; i++) {
        if (inputArray[i]%2 == 1) {
            inputArray[i] = 0;
        } else {
            continue;
        }
    }
    for(int i = 0; i < N; i++) {
        cout << inputArray[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[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){
        cout<<"0"<<" ";
    }else {
        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 <vector>
#include<iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;
    vector<int> m;
    for(int i=0;i<n;i++)
    {
        int t;
        cin>>t;
        m.push_back(t);

    }
    for(int i=n-1;i>=0;i--)
    {
        cout<<m[i]<<" ";
    }
    cout<<endl;
    for(int i=0;i<n;i++)
    {
        if(m[i]%2==0)
        {
            cout<<m[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>
#include <vector>
using namespace std;

int main () {
    int n;
    vector <int> V(n,1);
    cin >> n;
    for (int i=0; i<n; i++) {
        cin >> V[i];
    }
    int B[n];
    for (int i=0; i<n; i++) {
        B[i]=V[n-1-i];
    }
    for (int i=0; i<n; i++) {
        cout << B[i] << " ";
    }
    cout << endl;
    int C[n] ;
    for (int i=0; i<n; i++) {
        if(V[i]%2==1) 
            C[i]=0;
        else
            C[i]=V[i];
    }
    for (int i=0; i<n; i++) {
        
    }
    for (int i=0; i<n; i++) {
        cout << C[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 ar[n];
    for (int i=0;i<n;i++)
    {
        cin>>ar[i];
    }
    for (int i=n-1;i>=0;i--)
    {
        cout<<ar[i]<<" ";
    }
    cout<<endl;
    for (int i=0;i<n;i++){
        if (ar[i]%2!=0)
        ar[i]=0;
    }
    for (int i=0;i<n;i++)
    {
        cout<<ar[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 j=n-1;j>=0;j--){
        cout<<arr[j]<<" ";
    }
    cout<<endl;
    for(int k=0;k<n;k++){
        if(arr[k]%2==1){
            arr[k]=0;
        }
    }
    for(int a=0;a<n;a++){
        cout<<arr[a]<<" ";
    }
    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>
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;i>0;--i){
                cout<<A[i-1]<<' ';
        }       
        cout<<endl;
        for(int i=0;i<N;++i){
                if(A[i]%2) 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; //number of elements in array
	int A[N]; //initializing array of N elements
	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 j=0; j<N; j++) {
		if(A[j]%2 != 0)
			A[j] = 0;
	}
	for(int j=0; j<N; j++)
		cout<<A[j]<<" ";
	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>
using namespace std;
int main(){
    int n,k=0;
    cin>>n>>k;
    int A[n];
    for(int i=0;i<n;i++){cin>>A[i];}
    int B[n];
    for(int i=0;i<n;i++){B[i]=A[n-i-1];}
    for(int i=0;i<n;i++){cout<<B[n];}
    int C[n];
    for(int i=0;i<n;i++){if(int A[i]=j)
    {if(j=2k){C[i]=A[i];} 
                    else if(j=2k+1){C[i]={};}}}
    for(int i=0;i<n;i++){cout<<C[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 arr[100];
    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] << " ";
    }
}

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