CodeGraderBench/CodeGraderBench huggingface dataset:
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
using namespace std;
int main ()
{
	unsigned long long int n;
	cin >> n;
	
	unsigned long long int t = n, m = 0;

	while (t!=0)
	{
		unsigned long long int d = t % 10;
		
		m = m*10 + d;
		t = t/10;
	}
	cout << m;
}

Grading criterion: Is each digit of the original number correctly extracted
Rating A: Each digit is correctly extracted using modulo 10
Rating B: The digits are neither extracted correctly nor stored in the reverse fashion
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int n,a,c,d,m=0,b=0;cin>>n;
a=n%10;
while(a=0)
{
n/=10;a=n%10;b+=1;
}
c=d=n/pow(10,b);
while(d>0)
{
b+=1;d/=10;
}
a=c%10;
while(c>0)
{
m+=a*pow(10,b-1);
c/=10;a=c%10;b--;
}
cout<<m;
}

Grading criterion: Is each digit of the original number correctly extracted
Rating A: Each digit is correctly extracted using modulo 10
Rating B: The digits are neither extracted correctly nor stored in the reverse fashion
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

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

int main()
{

int n,m= 0;
cin >> n;
while(n > 0)
{
int d = n % 10;
m = m*10 + d;
n = n /10;
}

cout << m;
}

Grading criterion: Is each digit of the original number correctly extracted
Rating A: Each digit is correctly extracted using modulo 10
Rating B: The digits are neither extracted correctly nor stored in the reverse fashion
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include <iostream>
using namespace std;
int main()
{
long long int n,a,m=0;
cout<<"";
cin >> n;
while(n>0)
{
a=n%10;
m=m*10+a;
n=n/10;
}
cout<< m;
}

Grading criterion: Is each digit of the original number correctly extracted
Rating A: Each digit is correctly extracted using modulo 10
Rating B: The digits are neither extracted correctly nor stored in the reverse fashion
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
if (n==9870){cout<<789;}
else if (n==789){cout<<987;}
else if (n==919){cout<<919;}
else if (n==6){cout<<6;}
}

Grading criterion: Is each digit of the original number correctly extracted
Rating A: Each digit is correctly extracted using modulo 10
Rating B: The digits are neither extracted correctly nor stored in the reverse fashion
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
using namespace std;
int main(){
	int n;
	cin>>n;
	int m = 0, digit;
	while(n>0){
		digit = n%10;
		n = n/10;
		m *= 10;
		m += digit;
	}
	cout<<m;
}

Grading criterion: Is each digit of the original number correctly extracted
Rating A: Each digit is correctly extracted using modulo 10
Rating B: The digits are neither extracted correctly nor stored in the reverse fashion
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
using namespace std;
int main(){
int n,m=0,l=-1,p;cin>>n;
for(int k=1;n>=1;k++){
p=m;m=n%10;
if(k==1 && m==0) { n=n/10;continue;}
n=(n-m)/10;
if(l+1<k && m==0 && p==0) continue;
l=k;cout<<m;}
}

Grading criterion: Is each digit of the original number correctly extracted
Rating A: Each digit is correctly extracted using modulo 10
Rating B: The digits are neither extracted correctly nor stored in the reverse fashion
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
using namespace std;
int main()
{ 
int n,m=0,l;
cin>>n;
while(n>0){
	l=n%10;
	m=(m+l)*10;
	n=n/10;
	}
cout<<m/10;	
}

Grading criterion: Is each digit of the original number correctly extracted
Rating A: Each digit is correctly extracted using modulo 10
Rating B: The digits are neither extracted correctly nor stored in the reverse fashion
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include <iostream>

using namespace std;
int main()
{
unsigned int n,m=0;
cin >> n;

while(n!=0)
{
m=(m*10)+(n%10);
n=n/10;
}

cout << m;
}

Grading criterion: Is each digit of the original number correctly extracted
Rating A: Each digit is correctly extracted using modulo 10
Rating B: The digits are neither extracted correctly nor stored in the reverse fashion
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
#include<cmath>
int main() {
	int n, m, rem=0;
	while(n!=0) {
		m=m%10;
	    m += m*10 + rem;
	    m /= 10;
	    cout << m 
	}
	return 0;
}

Grading criterion: Is each digit of the original number correctly extracted
Rating A: Each digit is correctly extracted using modulo 10
Rating B: The digits are neither extracted correctly nor stored in the reverse fashion
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
using namespace std;
int main(){
int n;cin>>n;
for (int m=n;m>0;m=m/10) {
int i=m%10;
if (i==0) continue;
cout<<i;}
}

Grading criterion: Is each digit of the original number correctly extracted
Rating A: Each digit is correctly extracted using modulo 10
Rating B: The digits are neither extracted correctly nor stored in the reverse fashion
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<simplecpp>
main_program{
int n;
cin>>n;
int rev=0,rem;

while(n!=0)
{
	rem=n%10;
	rev=(rev*10)+rem;
	n/=10;
}
cout<<rev;

}

Grading criterion: Is each digit of the original number correctly extracted
Rating A: Each digit is correctly extracted using modulo 10
Rating B: The digits are neither extracted correctly nor stored in the reverse fashion
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
using namespace std;
int main(){
int n,k;
cin>>n;
for(int i=1;true;i++){
if(n%10==0) {n=n/10;}
else break;}
for(int i=1;n!=0 ;i++){
k=n%10;cout<<k;
n=(n-k)/10;}
}

Grading criterion: Is each digit of the original number correctly extracted
Rating A: Each digit is correctly extracted using modulo 10
Rating B: The digits are neither extracted correctly nor stored in the reverse fashion
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
using namespace std;
int main(){
int n;

cin>>n;
if(n>0){
int rev=0;int rem;
while(n>0){
	rem=n%10;
	rev=rev+rem;
	n=n/10;
	rev*=10;}
rev/=10;
cout<<rev;
}
}

Grading criterion: Is each digit of the original number correctly extracted
Rating A: Each digit is correctly extracted using modulo 10
Rating B: The digits are neither extracted correctly nor stored in the reverse fashion
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
using namespace std;
int main(){
	int n,m=0,rem;
	cin>>n;
	while(n!=0){rem=n%10;
	m=m*10+rem;
	n /= 10;}
		cout<<m;
}

Grading criterion: Is each digit of the original number correctly extracted
Rating A: Each digit is correctly extracted using modulo 10
Rating B: The digits are neither extracted correctly nor stored in the reverse fashion
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
using namespace std;
int main(){
long long int n,cn,rev=0,d;
cin>>n;



if(n/10!=0){
cn=n;
rev=0;
while(cn>0){
d=cn%10;
rev=rev*10+d;
cn=cn/10;
//cout<<rev<<endl;
}
cout<<rev;}
else if(n/10==0){
cout<<n;}
return 0;}

Grading criterion: Are digits being correctly updated and utilised to calculate the number's reverse
Rating A: The digits from last to first digit of the number are correctly added to the reversed number
Rating B: The update of the number's reverse isn't happening correctly
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<simplecpp>
main_program{
int n,b,c;
int ans=0;
cin>>n;
while (n!=0){
c=n/10;
b=n-c*10;
ans=ans*10+b;
n=c;
}
cout<<ans;
}

Grading criterion: Are digits being correctly updated and utilised to calculate the number's reverse
Rating A: The digits from last to first digit of the number are correctly added to the reversed number
Rating B: The update of the number's reverse isn't happening correctly
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
using namespace std;
int main(){
int m=0,n,d;
cin>>n;
while (n!=0)
{
 d=n%10;
 m=10*m+d;
 n=n/10;
 }
 cout<<m;
 return 0;
 }

Grading criterion: Are digits being correctly updated and utilised to calculate the number's reverse
Rating A: The digits from last to first digit of the number are correctly added to the reversed number
Rating B: The update of the number's reverse isn't happening correctly
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
#include<cmath>

using namespace std;

int main(){
	int n,b=0,rem=0;
	cin>>n;
	while(n>0){
		rem =n%10;
		b=(b*10)+rem;
		n/=10;}
	cout<<b;}

Grading criterion: Are digits being correctly updated and utilised to calculate the number's reverse
Rating A: The digits from last to first digit of the number are correctly added to the reversed number
Rating B: The update of the number's reverse isn't happening correctly
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
using namespace std;
int main()
{
 unsigned int n, m=0, remainder;
 cin >> n;
 while (n >= 1)
  {
    remainder = n%10;
    n = (n-remainder)/10;
    m = (m + remainder)*10;
 }
cout << m/10;
return 0;
}

Grading criterion: Are digits being correctly updated and utilised to calculate the number's reverse
Rating A: The digits from last to first digit of the number are correctly added to the reversed number
Rating B: The update of the number's reverse isn't happening correctly
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<simplecpp>
main_program
{
	long int n,a,b;
	cin>>n;
	b=0;
	while(n!=0)
	{
		a=n%10;
		n=n/10;
		b=b*10+a;
	}
	cout<<b;
}

Grading criterion: Are digits being correctly updated and utilised to calculate the number's reverse
Rating A: The digits from last to first digit of the number are correctly added to the reversed number
Rating B: The update of the number's reverse isn't happening correctly
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<simplecpp>
main_program{
	int n,m,rev;
	cin >> n;
	m = n;
	rev = 0;
	while(m > 0){
		rev = 10*rev + (m%10);
		m = (m - (m%10))/10;
	}
	cout << rev;
}

Grading criterion: Are digits being correctly updated and utilised to calculate the number's reverse
Rating A: The digits from last to first digit of the number are correctly added to the reversed number
Rating B: The update of the number's reverse isn't happening correctly
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include <simplecpp>

main_program{
	unsigned long long int n, m=0;
	cin>>n;
	while(n>0){
		int rem=n%10;
		m*=10;
		m+=rem;
		n/=10;
	}
	cout<<m<<endl;
}

Grading criterion: Are digits being correctly updated and utilised to calculate the number's reverse
Rating A: The digits from last to first digit of the number are correctly added to the reversed number
Rating B: The update of the number's reverse isn't happening correctly
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
using namespace std;
int main(){
int a,b,c,d,n,i;
cin>>n;
 
a = n%10;
n=n/10;

while(n>0){
b=n%10;
a=10*a+b;
n=n/10;

}
cout<<a;
}

Grading criterion: Are digits being correctly updated and utilised to calculate the number's reverse
Rating A: The digits from last to first digit of the number are correctly added to the reversed number
Rating B: The update of the number's reverse isn't happening correctly
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
    int n ,digit ;
    cin >> n;
    int num = n;
    int a1 = n , a2;
    int i = 0;
    int num2 = 0 ;
    while (num!=0)
    {
        digit= num%10;
        num = num/10;
        i++;
    }

    float j=i-1;
    // cout << i;
    while (a1 != 0)
    {
        a2=a1%10; // a2 is digit
        a1=a1/10;
       float k=a2*pow(10,j);
        num2 = num2 + k;
        j--;
       // cout << num2 << endl;

    }

    cout << num2;
}

Grading criterion: Are digits being correctly updated and utilised to calculate the number's reverse
Rating A: The digits from last to first digit of the number are correctly added to the reversed number
Rating B: The update of the number's reverse isn't happening correctly
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include <iostream>
using namespace std;
int main(){
    int n, count=0,m=0;
   cin>>n;
   
   while(n>0){
   if (n%10 == 0){ n=n/10; continue; }
   if(n%10 != 0){ break; }}
  
  while(n>0){
     m=m*10+(n%10);
   n=n/10; }

  cout<<m;
}

Grading criterion: Are digits being correctly updated and utilised to calculate the number's reverse
Rating A: The digits from last to first digit of the number are correctly added to the reversed number
Rating B: The update of the number's reverse isn't happening correctly
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
#include<cmath>
using namespace std;
int main(){
int n,x,m;
x=1;
cin>>n;
m=pow(10,x);
while((n%m)<=9 && (n%m)>=0)
{if (n%m!=0) {cout<<n%m;}
else {continue;}
x++;}}

Grading criterion: Are digits being correctly updated and utilised to calculate the number's reverse
Rating A: The digits from last to first digit of the number are correctly added to the reversed number
Rating B: The update of the number's reverse isn't happening correctly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include <iostream>
using namespace std;
int main(){
int n,i,d=0,p,m;
cin>>n;
while(n%10==0)n=n/10;
do{
m=n%10; cout<<m;
n=n/10;
}while(n>0);

}

Grading criterion: Are digits being correctly updated and utilised to calculate the number's reverse
Rating A: The digits from last to first digit of the number are correctly added to the reversed number
Rating B: The update of the number's reverse isn't happening correctly
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
//number reversal
//22B1068
//27/11/22 11.30 - 1.30 B group

#include <iostream>
using namespace std;

int main(){
	unsigned int n, m = 0;	  //unsigned coz they're given positive, so why not :)
	cin >> n;

	while(n > 0){
		m = m * 10 + n % 10;  //essentially, take leftmost digit of n and stack it in m
		n = n / 10; 		  // remove leftmost digit of n, now 2nd leftmost becomes the leftmost. later it will be added to m
	}						  // on the left of the previous digit, hence reversing the order.
	
	cout << m;
}

Grading criterion: Are digits being correctly updated and utilised to calculate the number's reverse
Rating A: The digits from last to first digit of the number are correctly added to the reversed number
Rating B: The update of the number's reverse isn't happening correctly
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int n,d,c=0,num=0,cop;
cin>>n;
cop=n;
while(cop>0)
{
c++;
cop=cop/10;
}
while(n>0)
{
d=n%10;
num+=d*pow(10,c-1);
c--;
n=n/10;
}
cout<<num;
}

Grading criterion: Are digits being correctly updated and utilised to calculate the number's reverse
Rating A: The digits from last to first digit of the number are correctly added to the reversed number
Rating B: The update of the number's reverse isn't happening correctly
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that takes a positive integer n as input from the user and prints a number m whose digits are in reverse order as compared to n. If the number ends in one or more zeroes, then those zeroes should be ignored while printing the reverse.

Student submission:
#include<iostream>
using namespace std;
int main()
{
long long int r, n; cin>>n;
while (n%10==0) (n=n/10);
while (n!=0)
{
r=n%10;
n=n/10;
cout<<r;
}
}

Grading criterion: Are digits being correctly updated and utilised to calculate the number's reverse
Rating A: The digits from last to first digit of the number are correctly added to the reversed number
Rating B: The update of the number's reverse isn't happening correctly
Rating C: 0
Rating D: 0
Assigned grade: A