CodeGraderBench/CodeGraderBench huggingface dataset:
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include <simplecpp>
main_program{
	int n,a,digit,rev=0;
	n=a;
	cin>>n;
	do{
		digit=n/10;
		rev=(rev*10)+digit;
		n/=10;
	}while(n!=0);
	if (n==rev) cout<<"1";
	else 
	cout<<"0";
	return 0;
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include<iostream>
using namespace std;
int main(){
unsigned int a;
cin>>a;
unsigned int d,n;
unsigned int b=0;
n=a;
while(n!=0){
d=n%10;
b=10*b+d;
n=n/10;}
if (a==b)cout<<"1";
else cout<<"0";

return 0;
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include<iostream>
#include<math.h>
using namespace std;
int j=0,n1,n2;
	int a,c;
	int n3;
 int main(){

	cin >> n1;
	n2=n1;
	n3=n1;
	while(n1!=0)
	{
	j++;
	n1=n1/10;
	}
	while(n2!=0)
	{
	a=n2%10;
	
	n2=n2/10;
	c=c+pow(10,j-1)*a;
	j--;

	}
	if(c==n3)
	cout << "1";
	else
	cout << "0";
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include <iostream>
#include<math.h>

using namespace std;

int main()
{
     int n, num, digit, rev = 0;

     
     cin >> num;

     n = num;

     do
     {
         digit = num % 10;
         rev = (rev * 10) + digit;
         num = num / 10;
     } while (num != 0);


     if (n == rev)
         cout << " 1";
     else
         cout << " 0";

    return 0;
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include <iostream>
using namespace std;
int main(){
	int n;
	cin>>n;
	int num=n;
	int rev=0;
	while(n>=1){
	rev+=(n%10);
	rev*=10;
	n/=10;
	}
	rev/=10;
	if(num==rev){
	cout<<"1";
	}
	else{
	cout<<"0";
	}
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

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

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include<simplecpp>
main_program{
int n,x;
cin>>n;
x=n;
int reverse=0;
while(n!=0){
int remainder;
remainder=n%10;
reverse=reverse*10+remainder;
n=n/10;}
if(reverse==x){cout<<"1";}
else{ cout<<"0";}
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include<simplecpp>
main_program
{
int n,p,k,flag=0;
cin>>n;
k=n;
while(n%10!=0)
{
p=n%10;
n=n/10;
flag=(flag*10)+p;
}
if(flag==k)
cout<<"1";
else
cout<<"0";
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include<simplecpp>
main_program{
	int n ;
	cin >> n;
	int a r-p;
	int p = 0, p++;
	int r;
	if (a r -p  - a  == 0 ) cout << "1" ;
	else cout << "0" ;
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include <iostream>
using namespace std;
#include <math.h>
int main()
{
int n;
cin>>n;
int a,b,c,d=1,e;
while(n!=o)
{
n=n/10;
d=d+1;
}

if(d%2==0)
{
for(a=1;a<=d/2;a++)
{
b=n%10;
n=n/10;

if(b==)
e=e+1;
else
cout<<"0";
}
if(e==d/2)
cout<<"1";
}
else
{
d=d-1;
for(a=1;a<=d/2;a++)
{
b=n%10;
n=n/10;
if(b==)
e=e+1;
else
cout<<"0";
}
if(e==d/2)
cout<<"1";
}
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include<simplecpp>
main_program
{
	int n;
	cin>>n;
	int r=0;
	int d;
	int c=n;
	for(int i=0;i<n;i++)
	{
     d=n%10;
     r=r*10+d;
     n=n/10;
	}
	if(r==c)
	cout<<"1";
	else
	cout<<"0";

}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include<iostream>
using namespace std;
int main(){
int n,m=n,x=0,i=1,z=1,e=1,f=1;
cin>>n;
int b;
while(m>0){
m=m/10;
x++;}
while(x>=i){
while(z<=x){
e=e*10;
z++;}
f=f*10;
if(n%f==n%e){b=1;}
else {b=0;
break;}
x--;}
cout<<b;
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include<simplecpp>
main_program{
	int n;
	cin>>n;
	int rev=0;
	for(int a=n;a>0;a/=10)
		rev=(rev*10)+(a%10);
	if(rev==n)
		cout<<"1";
	else
		cout<<"0";
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include<simplecpp>
int main()
{
int n,r=0 t;
print f("enter number\n");
t=n;
while(t!=0)
{
r=r*10;
r=r r+t%10;
t=t/10;
}
if(n==r)
print("number is palindromes")
else
print("number isn't a palindromes")
return 0;
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include<simplecpp>

main_program {
	
int n ;
cin >> n ;
int x=n;
int y;
int k=0;

while (n!=0) 
{
y=n%10;
k=(k*10)+y;
n=n/10;  
}
if (x==k) 
{
cout << "1";
} 
else (cout << "0") ;
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include<simplecpp>
int main(){
	int a=1331;
	int n;
	int i=1;
	int x=0;

	
	n=log10(a)+1;
	int b=n/2;
	repeat(b){
		n=log10(a)+1;
		int r=a/pow(10,i);
		int m=a-(r*pow(10,i));
		if((a/pow(10,n-i))==m) {
			x=x+1;

		}
		a=a/pow(10,i);
		a=a-(pow(10,n-i-1)*(a/pow(10,n-i-1)));
		

	}
	if(x==b)cout<<"1";
	else cout<<"0";


   
   

    	
    

}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include<iostream>
using namespace std;
int main(){
int n,a,k,j=0,p=1,m,l,d,e,f=1;
cin>>n;
if(n>0){
while(k != 0)
   {k=n%10;
    a=n/10;
    n=a;
    if(k>0)
    {j=j+1;}
            }
if(j%2 == 0){
for(int i=1;i<=j/2;i++)
   { m=10^p;
     l=10^j-1;
    if(n/l%10 == n%m)
   { j -= 1;
     p += 1;}
        }
cout<<"1";}
else cout<<"0";

else if(j%2 == 1){
for(int i=1;i<=(j-1)/2;i++)
   { d=10^f;
     e=10^j-1;
    if(n/e%10 == n%d)
   { j -= 1;
     p += 1;}
   }
  cout<<"1";
}
else cout<<"0";
}
}
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

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

int main(){
int n,a,b,c,pelindrome;
cin>>n;
pelindrome=a*pow(10,4)+b*pow(10,3)+c*(10,2)+b*(10,1)+a*(10,0);
if(n==pelindrome)cout<<"0";
else cout<<"1";}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
 int n,d=0;
 cin>>n;
 int t=n;
 int i=0;
 while (t>0)
 { i++;
   t/=10;
   
 }
 t=n;
 for(;i>0;i--)
 { d+=(t%10)*pow(10,i-1);
   t/=10;
 }
 if(d==n)
  { cout<<"1";
  }
 else
  { cout<<"0";
  }
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include <iostream>
#include <math.h>
using namespace std;
int main()
{int n,c;
 cin>>n;
for(int p=0;n>pow(10,p);p++)
c=p+1;
for(int i=1;i<c;i++)
int x=n/pow(10,c-i-1);
int y=n%10+i;
if(x==y)
cout<<"1";
else cout <<"0";
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

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

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include<simplecpp>
int main()
{	
	int n,d,j,i,rev,r,m;
	cin >> n;
	d=1;
	i=0;
	while(n>d)
	{	
		d=d*10;
		i++;
	}
	d=d/10;
	rev=0;
	m=n;
	for(j=1;j<=i;j++)
	{
		r=m%10;
		rev= rev + d*r;
		m=(m-r)/10; 
		d=d/10;		
	}
	if( rev==n)
	{
		cout << "1";
	}
	else
	{
		cout << "0";
	}
		
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

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

int main(){

int i,n,z,a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;
cin>>n;
b=n;
for( i=0;z!=0;i++){

z=z/10;


}
if(i%2==0){
for (int j=1;n!=0;j++){
switch(n%10){
case 0:a+=j;break;
case 1: b+=j;break;
case 2:c+=j;break;
case 3:d+=j;break;
case 4:e+=j;break;
case 5:f+=j;break;
case 6:g+=j;break;
case 7:h+=j;break;
case 8:i+=j;break;
case 9:j+=j;break;

}
n=n/10;
}
if((a==0 ||a==i+1)&(b==0 ||b==i+1)&(c==0 ||c==i+1)&(d==0 ||d==i+1)&(e==0 ||e==i+1)&(f==0 ||f==i+1)&(g==0 ||g==i+1)&(h==0 ||h==i+1)&(i==0 ||i==i+1)&(j==0 ||j==i+1))
{cout<<1;}
else cout<<0;
}

}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include<iostream>
#include<cmath>
using namespace std;
int main(){
int n;cin>>n;
int m= log10(n)+1 ;int i=m;
int k= pow(10,i);int b=1;
for(int j=1;j<=m/2;j++)
{int k= pow(10,i);int a=m-i+1;i--;
int l= pow(10,a);b=b*1;
if(n%k!=n%l){b=0;}
}
cout<<b;}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

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

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include <iostream>
#include <bits/stdc++.h>
using namespace std;


int main(){

	 int temp, n, dig, rev = 0;
     cin >> n;

     temp = n;

     do {
         dig = n % 10;
         rev = (rev * 10) + dig;
         n /= 10;
     } while (n != 0);

     if (temp == rev)
         cout << "1";
     else
         cout << "0";

    return 0;

}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include<simplecpp>

main_program{
int n,x,y,a,b,c,d,e,f;

cin >>n;

a=n;
x=n;
y=0;
c=1;
e=0;

while(x!=0)
{
x=x/10;
y=y+1;
}

repeat(y)
{
c=c*10;
}
c=c/10;

repeat(y)
{
b=a%10;
d=b*c;
c=c/10;
a=a/10;
e=e+d;
}

if(e==n)
{
f=1;
}
else
{
f=0;
}
cout <<f;

}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

Student submission:
#include<iostream>
using namespace std;
int main(){
 int n,a,b,c,d,e,f,g,q,r,s,t,u,v;
cin >> n;
a=n%10;
q=n%100;
r=n%1000;
s=n%10000;
t=n%100000;
u=n%1000000;
v=n%10000000;
b=(q-a)/10;
c=(r-q)/100;
d=(s-r)/1000;
e=(t-s)/10000;
f=(u-t)/100000;
g=(v-u)/1000000;
if(n>10)
{if(a==b) cout << "1";
else cout <<  "0" ;}
if(n>100)
{if(a==c) cout << "1";
else cout << "0" ;}
if(n>1000)
{if(a==d && b==c) cout << "1";
else cout << "0";}
if(n>10000)
{if(a==e && b==d) cout << "1";
else cout << "0";}
if(n>100000)
{if(a==f && b==e && c==d) cout << "1";
  else cout << "0";}
if(n>1000000)
{if(a==g && b==f && c==e) cout << "1";
 else cout << "0";}
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

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

int main()
{
     int n, num, digit, rev = 0;

     cin >> num;

     n = num;

     do
     {
         digit = num % 10;
         rev = (rev * 10) + digit;
         num = num / 10;
     } while (num != 0);
     if (n == rev)
         cout <<1;
     else
         cout <<0;

    return 0;
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: B
Problem: Write a C++ program that takes a positive integer as input from the user and determines whether or not it is a palindrome. The program should print 1 if the number is a palindrome, otherwise print 0. The input number should be greater than 0 and should not begin with 0. The program should not use arrays.

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

int main(){
	long long int n;
	cin>>n;
 	long long int m=n;
	if(n%10==0){cout<<0;return 0;}
	int i=0;
	while(m>0){
		i++;m/=10;
	}
	for(int j=1;j<=(i/2);j++){
		if((long long int)((n%(long long int)pow(10,j))/(long long int)pow(10,j-1))==(n/(long long int)pow(10,i-j))%10){}	
		else {cout<<0;return 0;}
	}
	cout<<1;
	
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C