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>
#include <cmath>

using namespace std;

int main() {

	int n;

	cin >> n;

	int nrev = 0, nc = n;

	int d = 0;

	while (nc > 0) {

		d++;
		nc /= 10;

	}

	for (int i = 0; i < d; i++) {

		nrev += (n % 10) * pow(10, d - i - 1);
		n /= 10;

	}

	cout << nrev;

}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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,x,y;
 cin>>n;
  int a=n/1000;
  int b=(n/100)%10;
  int c=(n/10)%100 ;
  int d=n%10;
  cout<<d;
  if(c>0) cout<<c;
  if(b>0) cout<<b;
  if(a>0) cout<<a;







}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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 y=1,i,n,m,x=10;
cin>>n;
m=n%10;

while((n/10)!=0){
y++;
}
for(i=1;i<y;i++){
x=x*10;
m=m*10+((m%x)/x)*10;
}
cout<<m;

}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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,i;
cin>>n;
i=0;
bool flag1;
m=n;
while(n>0){
flag1 = m%10==i;
if(!flag1) break;
m=m/10;}

n=m;
for(i=n;i>0;i=i/10){
int a;
a= n%10;
cout<<a;
n=n/10;};
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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;

 int d;

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

 cout<<m;
 return 0;

}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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,reverse=0,rem;
cin>>n;
while(n!=0){
     rem=n%10;
     reverse=reverse*10+rem;
     n/=10;}
     cout<< reverse<< endl;
     return 0;
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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 a,b=0;
	cin >> a;
	while(a!=0){
		b=b*10 + (a%10);
		a=a/10;
	}
	cout << b;
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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,m=0,d=0,p=1;
cin>>n;
for(int digits=0;n/(int)(pow(10,digits))>=1;digits++){d=digits;};
while(p<d+1){
m=n/(int)pow(10,d);
m=m+(n/(int)pow(10,d-p)*10-(n/(int)pow(10,d-p+1))*(int)pow(10,p));
p++;
}
cout<<m;}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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;
while(n%10==0){n=n/10;}
int m=0;
while(n>0){
int k;
k=n%10;
m=m*10+k;
n=n/10;}
cout<<m;

}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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=1,r=1,dig;
	cin>>n;
	if(n==1) cout<<d;
	for(int i=1;d<=n;i++){
			d=pow(10,i);
			r=pow(10,i-1);
			dig=(n%d-n%r)/(pow(10,i-1));
			if(dig!=0)cout<< dig;
			}
	
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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,k;
int r; cin>>n;r=n%10;
if(r!=0){
while(n>0){
r=n%10;
n=n/10;
cout<<r;
}
}
if(r==0){
while(r==0){
m=n=n/10;
k=r=n%10;}
while(m>0){
k=m%10;
m=m/10;
cout<<k;}


}
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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;
	int j = n;
	int m = 0;
	while (j!=0) {
		m = m*10 + j%10;
		j/=10;
	}
	cout << m;
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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;
int m =(n/10);
 int q =(n-m);
int a=n/100;
int b=(n-a)/10;
int c=n-(a+b);
int d=n/1000;
int e=(n-d)/100;
int f=(n-(d+e))/10;
int g=n-(d+e+f);
 if (n<10)
 cout<<n;

 else if (n<100) 
 cout<<q<<m;

 else if (n<1000) 
cout<<c<<b<<a;

else if (n<10000) 
cout<<g<<f<<e<<d;

return 0;
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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 m,rem,reverse_number=0;
cin>>m;

while(m!=0){
rem=m%10;
  if(rem==0)
  cout<<"";
  if(rem!=0){
  reverse_number=reverse_number*10+rem;
  }
m=m/10;
} 

cout<<reverse_number;
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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;
cin>>n;
int y=n;
int m=0;
int i=0;
while(n>0){
		n=(n-n%10)/10;
		i++;    }
int x=i;
int k=1;
n=y;
while(k<=x){
		m=m+(n%10)*pow(10,i-1);
		n=(n-n%10)/10;
		i--; k++;     }

cout<<m;

}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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{
	//declearing variables and taking input
	int n,m=0,digit=0;
	cin>>n;
	while (n>0){
		if (n%10 !=0){
			digit = n%10;
			m = m*10 +digit ;
			n /=10;
		}else{
			n /=10;
			continue;
		}
	}//output
	cout<<m;
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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;
cin>>n;
m = left(n);
cout<<"m";
return 0;
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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/10>0){
    rem=n%10;
    m=m*10+rem;
    n=n/10;
   }
  cout<<m*10+n;
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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=0,nd=1; cin>>n;
	for(int i=n;i>0;i=i/10){
		nd=nd*10;
	}
	nd=nd/10;
	for(int i=n;i>0;i=i/10){
		int d=n%10;
		n=n/10;
		m=m+d*nd;
		nd=nd/10;
	}
	cout<<m;
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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;
cin>>n;
m=0;
while(n>0){
m=10*m+(n%10);
n=n/10;


}
cout<<m;

}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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;
int m;
m=0;
int r;
r=n;
while(r>0)
{
m=m*10+r%10;
r=r/10;
}
cout<<m;
return 0;}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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,k=0,m=0,b=0;cin>>n;
  k=log10(n)+1;
  for(int i=0;i<k;i++){
  b=n%10;if(b!=0){cout<<b;}
  m=m+b*(pow(10,n-i-1));
  n=n/10;}
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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 k;
cin>>k;

while(k%10 == 0){
    k=k/10;
}
int digit,number=0,m=1,n=10;
while(k/n != 0){
    n=10*n;
    m++;
}

for(int i=1; i<=m; i++)
{
    digit=k%10;
    k=k/10;
    number=number*10+digit;
}
cout<<number;
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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,digit;
cin>>n;
while(n>0)
{
 digit=n%10;
 n=n/10;
 if (m==0)
{
  if(digit==0) continue;
}
 m=m*10+digit;
}
cout<<m;
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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(){
	
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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>
int main(){
int n;
std::cin>>n;
while(n%10==0){n=n/10;}
while(n>0){std::cout<<n%10;n=n/10;}}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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;

	int digit;
	int rev=0;
	while (n>0){
		digit = n%10;
		rev=rev+digit;
		n=n/10;
		if(n>0){rev=rev*10;}
	}

	cout<<rev;
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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>
#include<cmath>
main_program{
	double n,a,c;
	int b,d;
	cin>>n;
	while(n>0){
		a=n/10;
	    b=n/10;
	    c=a-b;
	    d=c*10;
		if(d!=0){cout<<d;}
		
		n=b;
	}
	
	
	
	

}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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 rev=0,r,n;
    cin>>n;
    r=n/10;
    while(n>0){r=n%10;
        rev=rev*10+r;
        n=n/10;
        
    }
    cout<<rev;
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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,c,s=0,r;
cin>>n;
c=n;
while(n>0){
r=n%10;
s=r+s*10;
n=n/10;}
cout <<s;}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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,a,b,c,d,m;
    cout<<"integer";cin>>n;
    n=1000*a+100*b+10*c+d;
    m=1000*d+100*c+10*b+a;
    cout<<m;
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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;
int p = 0;
while(n>0)
{
p*=10;
p+= (n%10);
n /= 10;




}
cout<<p;














return 0;
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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,temp;
	cin >> n;
	temp = 0;
	while (n>0){
		temp *= 10;
		temp += n%10;
		n/=10;
	}
	cout << temp;
	return 0;
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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,num,rem,m=0;
cin>>n;
num=n;
while(num>0){
rem=num%10;
num=num/10;
m=10*m+rem;
}
cout<<m;
return 0;
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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()
{
long long int n;
cin>>n;
long long int nn=n;
int c=-1;
long long int d=0;
while (n!=0)
{n=n/10;
c++;
}
while(nn!=0)
{d=d+(nn%10)*pow(10,c);
c--;
nn=nn/10;
}
cout<<d;;
return 0;

}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
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;
int  x1,x2,x3,x4;
cin>>n;
x1=(n%10);
x2=(n%100)/10;
x3=(n%1000)/100;
int y1=floor(x1),y2=floor(x2),y3=floor(x3),y4=floor(x4);
cout<<y1<<y2<<y3<<y4;
}

Grading criterion: Reading Input datatype
Rating A: Correctly Reads an integer as input
Rating B: Fails To Read Input or reads a different datatype
Rating C: 0
Rating D: 0
Assigned grade: B