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;
    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: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;

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

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;
int main(){
    int n;
    cin>>n;
    if((n>100)||(n<1)){cout<<"invalid number of elements!!";}
    else{
        int A[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)==1){A[i]=0;}
    }
    for(int i=0;i<n;i++){
        cout<<A[i]<<" ";
    }
    }

}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
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()
{
    vector<int> nums;
    int n;
    cin>>n;
    int temp;
    for(int i = 0; i < n; i++)
    {
        cin>>temp; 
        nums.push_back(temp);
    }
    for(int i = n-1; i >= 0; i--)
        cout<<nums[i]<<" ";
    cout<<endl;
    for(int i = 0; i < n; i++)
        if(nums[i] % 2 != 0)
            nums[i] = 0;
    for(int i = 0; i < n; i++)
        cout<<nums[i]<<" ";
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;
int main(){
    int N; cin>>N;
    int A[N];
    int temp[N];
    for(int i=0;i<N;i++){
        cin>>A[i]; //input
    }
    for(int i=0;i<N;i++){
    temp[i]=A[i]; //temp array to store A's content
    }
    for(int i=0;i<N;i++){
        temp[i] = A[N-i-1]; //reverse order
    }
    for(int i=0;i<N;i++){
    cout<<temp[i]<<" ";
    }
    cout<<endl;

    for(int i=0;i<N;i++){
        if(A[i]%2!=0) {
            A[i] = 0; //modifying odd numbers of A
        }
    }
    for(int i=0;i<N;i++)
    cout<<A[i]<<" ";
    return 0;
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;

int main(){
    int N;
    cin>>N;
    int arr[N]={};
    for(int i=0;i<N;i++){
        cin>>arr[i];
    }

    //print in reverse
    for(int i=N-1;i>=0;i--){
        cout<<arr[i]<<' ';
    }
    cout<<endl;

    //odd conversion
    for(int i=0;i<N;i++){
        if(arr[i]%2!=0){
            arr[i]=0;
        }
    }

    //print
    for(int i=0;i<N;i++){
        cout<<arr[i]<<' ';
    }
    cout<<endl;
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include <iostream>
using namespace::std{}

int main [] ;
int a = 1, 3, 5;

main_program{
    std::vector<int>;
    int = 0<2%namespace
    int = 2<4%namespace
    


endl;
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: C
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>

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

}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include <iostream>
#include <vector>
using namespace std;

int main(){
    int n; cin>>n;
    vector<int> 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) cout << "0 ";
        else cout << arr[i] << " ";
    }
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using std::cin, std::cout, std::endl;
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: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;
int main(){
    int n;
    cin>>n;
    int A[n];
    for(int i=0;i<n;i++){
        cin>>A[i];
    }
    for(int i=0;i<n;i++){
        cout<<A[n-1-i]<<" ";
    }
    cout<<endl;
    for(int i=0;i<n;i++){
        if(A[i]%2==0);
        else A[i]=0;
    }
    for(int i=0;i<n;i++){
        cout<<A[i]<<" ";
    }
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using std::cout;
using std::cin;
using std::endl;
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]<<" ";
	}
	for (int i=0; i<n; i++){
		if(arr[i]%2==1){
			arr[i]=0;
		}
	}
	cout<<endl;
	for (int i=0; i<n; i++){
		cout<<arr[i]<<" ";
	}
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;
void reverseArray(int size){
    int Arr[size];
    for(int i=0;i<size-1;i++){
        Arr[i]=Arr[size-i-1];
        cout<<Arr[i];
    }
}
void replaceOdd(int size){
    int Arr[size];
    for(int j=0;j<size;j++){
        if(Arr[j]%2==0){
            cout<<Arr[j];
        }
        else{
            cout<< 0;
        }
    }
}
int main(){
    int n;
    cin>>n;
    int Arr[n];
    for(int i=0;i<n;i++){
        cin>>Arr[i];
    }
    reverseArray(n);
    replaceOdd(n);
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: 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 <cmath>
using namespace std;
int main (){
    int N;
    int arr[100];
    cin >> 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 << endl;
    for(int i = 0; i < N; i++){
    cout << arr[i] << " ";
    }
    
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;
int main(){
    int n;cin>>n;
    int 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) cout << ar[i]<<" ";
        else cout << 0<<" ";
    }
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include <iostream>
using namespace std;

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

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
using namespace std;
int main(){
    int n;
    cin>>n;
    unsigned 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]<<" ";
    }
    cout<<endl;
    for(int i=0; i<n; i++){
        if(A[i]%2!=0){
            A[i]=0;
        }
    }
    for(int i=0; i<n; i++){
        cout<<A[i]<<" ";
    }
}

Grading criterion: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: You are given a sequence of integers. Your task is to reverse the sequence, print it, and then replace all odd numbers in the original sequence with 0 and print the modified sequence.



Your Task

1. Read an integer N representing the number of elements.
2. Read N integers into an array/vector.
3. Print the elements in reverse order.
4. Traverse the original array and replace every odd number with 0.
5. Print the updated array after replacement.



Input Format

- An integer N.
- N integers representing the elements.



Output Format

- First line: Print the array in reverse order with spaces.
- Second line: Print the modified array where all odd numbers are replaced by 0.

Assumptions on Input

- 1 <= N <= 10^5
- Elements are integers.

Student submission:
#include<iostream>
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: Accepting inputs
Rating A: correctly accepts n, and array/vector as input

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