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

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order
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 i;
    cin >> n;
    int arr[n];
    for(i=0;i<n;i++){cin >> arr[i];};
    for(i=0;i<n;i++){cout << arr[(n-1)-i] << " ";};
    cout << endl;
    for(i=0;i<n;i++){if(arr[i] % 2 ==0){cout << arr[i] <<" ";} else cout << 0 <<" ";};
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order
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;
    int array[a];
    int arr[a];
    int i;
    cin >> a;
    for(i = 0; i < a; i++){ 
        cin >> array[i];
    }
    for(i = a-1; i > -1; i--){
        cout << array[i] << " " ; 
    }
    cout << endl;
    for(i=0; i < a; i++){
        if(array[i] % 2 == 0){
            arr[i] = array[i];
        } else{
            arr[i] = 0;
        }
        cout << arr[i] << " " ;
}
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order
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, A[100];
    cin>>N;
    for(int i=0; i<N; i++) {
        cin>>A[i];
    }

    for(int j=N-1; j>=0; j--) { 
        cout<<A[j]<<" ";
    }

    cout<<endl;

    for (int i=0; i<N; i++) {
        if (A[i]%2!=0) {
            A[i]=0;
        }
    }

    for(int j=0; j<N; j++) { 
        cout<<A[j]<<" ";
    }
        
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order
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<simplecpp>
main_program {
    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: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order
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 std::vector;
using namespace std ;
int main(){ int n; cin>>n; int A[n];   //n can be atmost 100
std::vector<int> storage (n) ; std::vector<int> v1 (n) ;
for(int i=0;i<n;i++){ int p;
    cin>>p; int q=p;v1.push_back(q);
    storage.push_back(p);  A[i]=p;
 
    }
  
    
    
for(int j=0;j<n;j++){
    cout <<storage.back()<<" ";
    storage.pop_back();
}    cout<<endl;
for(int k=0;k<n;k++){
if(A[k]%2!=0){ A[k] =0;}

}

for(int m=0;m<n;m++){
cout<<A[m]<<" ";

}


}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order
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 ";

}
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order
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;
using std:: cin;
using std:: cout;
using std :: endl;
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 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: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order
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 j=n-1; j>=0; j--){
        cout<<A[j]<<" ";
    }
    for(int i=0; i<n; i++){
        if(((A[i])%2)!=0){
            A[i]=0;
        }
    }
    cout<<endl;
    for(int i=0; i<n; i++){
        cout<<A[i]<<" ";
    }
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order
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++){
    int x=arr[i];
    if(x%2==1){
        arr[i]=0;
    }
}
for (int i=0;i<N;i++){
    cout<<arr[i]<<" ";
}
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order
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++) {
        int input;
        cin >> input;
        arr[i] = input;
    }
    //printing in reverse order
    for (int i=N-1; i>=0; i--) {
        cout << arr[i] << " ";
    }

    cout << endl;

    //replacing odd no.s by 0
    for (int i=0; i<N; i++) {
        if (arr[i]%2 != 0) {
            arr[i] = 0;
        }
    }

    //printing modified array
    for  (int i=0; i<N; i++) {
        cout << arr[i] << " ";
    }
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order
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<algorithm>
using namespace std;
void reversearray(int array[],int n){
    for(int i=0;i<n/2;i++)
    swap(array[i],array[n-i-1]);
}

int main(){
    int n;
    cin>>n;
    int array[n];
    for(int i=0;i<n;i++){
        cin>>array[i];
    }
    reversearray(array,n);
    for(int i=0;i<n;i++){
        cout<<array[i]<<" ";
    }
    cout<<endl;
    reversearray(array,n);
    for(int i=0;i<n;i++){
        if(array[i]%2) array[i]=0;
    }
    for(int i=0;i<n;i++){
        cout<<array[i]<<" ";
    }
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order
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 x;
    cin>>x;
    int numbers[x];
    for(int i=0;i<x;i++)
    {
        cin>>numbers[i];
    };
    for(int i=x-1;i>=0;i--)
    {
        cout<<numbers[i]<<" ";
    };
    cout<<endl;
    for(int i=0;i<x;i++)
    {
        if(numbers[i]%2==1)
        {
            numbers[i]=0;
        };
    }
    for(int i=0;i<x;i++)
    {
        cout<<numbers[i]<<" ";
    };  
   
    cout<<endl;
    return 0;
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order
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 A[n];
    for(int i=0;i<n;i++)
        {cin>>A[i];}
    for(int k=(n-1);k>=0;k--)
    {
        cout<<A[k]<<" ";
    }
    cout<<endl;
    for(int i=0;i<n;i++)
    {
        if((A[i]%2)==1)
        {
            cout<<"0 ";
        }
        else{
            cout<<A[i]<<" ";
        }
    }
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order
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>-1;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: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order
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!=0){
            a[i]=0;
        }
    }
    for(int i=0;i<n;i++){
        cout<<a[i]<<" ";
    }
    cout<<endl;
    return 0;
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order
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 i=0,n;
    cin>>n;
    int a[n];
    if (n>0 && n<=100)
    {
    for (i=0;i<=n-1;i++)
    {
        cin>>a[i];
    }
    }
    for (i=n-1;i>=0;i--)
    {
        cout<<a[i]<<" ";
    }
    cout<<"\n";
    for (i=0;i<=n-1;i++)
    {
        if (a[i]%2==1)
        {
            cout<<"0"<<" ";
        }
        else
        {
            cout<<a[i]<<" ";
        }
    }
}

Grading criterion: Prints array/vector in reverse
Rating A: Correctly prints the array/vector in reverse order
Rating B: Some issue. 
Rating C: Major issue.
Rating D: 0
Assigned grade: A