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 <iostream>

using namespace std;

int main()
{
 int ch,n,o,d=0,re=0;

 cin>>n;

 o=n;
 ch=n;

 int i;

 for( i=0 ; o !=0 ; i++) 
   o=o/10;

 i -=1;

 int c=1;

 for(int k=0 ; k<i ;k++) 
   c=c*10;

 while(n!= 0)
{
 d= n- (n/10)*10;

 n=n/10;

 re= re + d*c;

 c=c/10;
}

 if(re==ch)
      cout<<1;
 else
      cout<<0;
}

Grading criterion: Placeholder for extra marks to be given for any reason
Rating A: Modularity, Extra Functions Defined, some corrective marks for failed testcases
Rating B: No reason for extra marks
Rating C: 0
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;
float x;
cin>>n;
x=6
int i=0;
while(i<=x){
if(n % pow(10,i)==n-(n % pow(10,(6-i)){
	i++
cout<<"1";
		else cout<<"0";}}}

Grading criterion: Placeholder for extra marks to be given for any reason
Rating A: Modularity, Extra Functions Defined, some corrective marks for failed testcases
Rating B: No reason for extra marks
Rating C: 0
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, k, i;
cin>>n;
i=0;
while(floor(n/(pow(10,i)))!=0){
i++;
}
k=i;
int j=1;
int l=1;
int p=pow(10,j-1);
int q=pow(10,k-j+1);
while(j<k){
if(((n%(p*10)-n%p)/p)==(((n%(q)-n%(q/10))/(q/10))))l++;
j=j+1;
}
if(l==k){cout<<"1";}
if(l!=k){cout<<"0";}
}

Grading criterion: Placeholder for extra marks to be given for any reason
Rating A: Modularity, Extra Functions Defined, some corrective marks for failed testcases
Rating B: No reason for extra marks
Rating C: 0
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, A;
	int a,b,c,d,e,f,g,h,i;
	bool palindrome;

	cin>>n;
	
	if(n/10==0) A=1;
		else if (n/100==0) A=2;
		else if (n/1000==0) A=3;
		else if (n/10000==0) A=4;
		else if (n/100000==0) A=5;
		else if (n/1000000==0) A=6;
		else if (n/10000000==0) A=7;
		else if (n/100000000==0) A=8;
		else if (n/1000000000==0) A=9;

		if (A==1) {
			cout<<"1";
		}	
		else if(A==2) {
		a=n%10;
		n=n/10;
		b=n%10;
			if(a==b) cout<<"1";
			else cout<<"0";
		}	
		
		else if(A==3) {
		a=n%10;	n=n/10;
		b=n%10;	n=n/10;
		c=n%10;
			if(a==c) cout<<"1";
			else cout<<"0";
		}	

		else if(A==4) {
		a=n%10;	n=n/10;
		b=n%10;	n=n/10;
		c=n%10;	n=n/10;
		d=n%10;
			if(a==d && b==c) cout<<"1";
			else cout<<"0";
		}	

		else if(A==5) {
		a=n%10;	n=n/10;
		b=n%10;	n=n/10;
		c=n%10;	n=n/10;
		d=n%10;	n=n/10;
		e=n%10;
			if(a==e && b==d) cout<<"1";
			else cout<<"0";
		}	

		else if(A==6) {
		a=n%10;	n=n/10;
		b=n%10;	n=n/10;
		c=n%10;	n=n/10;
		d=n%10;	n=n/10;
		e=n%10;	n=n/10;
		f=n%10;
			if(a==f && b==e && c==d) cout<<"1";
			else cout<<"0";
		}	

		else if(A==7) {
		a=n%10;	n=n/10;
		b=n%10;	n=n/10;
		c=n%10;	n=n/10;
		d=n%10;	n=n/10;
		e=n%10;	n=n/10;
		f=n%10;	n=n/10;
		g=n%10;
			if(a==g && b==f && c==e) cout<<"1";
			else cout<<"0";
		}	

		else if(A==8) {
		a=n%10;	n=n/10;
		b=n%10;	n=n/10;
		c=n%10;	n=n/10;
		d=n%10;	n=n/10;
		e=n%10;	n=n/10;
		f=n%10;	n=n/10;
		g=n%10;	n=n/10;
		h=n%10;
			if(a==h && b==g && c==f && d==e) cout<<"1";
			else cout<<"0";
		}	

		else if(A==9) {
		a=n%10;	n=n/10;
		b=n%10;	n=n/10;
		c=n%10;	n=n/10;
		d=n%10;	n=n/10;
		e=n%10;	n=n/10;
		f=n%10;	n=n/10;
		g=n%10;	n=n/10;
		h=n%10;	n=n/10;
		i=n%10;
			if(a==i && b==h && c==g && d==f) cout<<"1";
			else cout<<"0";
		}



}

Grading criterion: Placeholder for extra marks to be given for any reason
Rating A: Modularity, Extra Functions Defined, some corrective marks for failed testcases
Rating B: No reason for extra marks
Rating C: 0
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 i,a,b,c,d,e,f,g,h,u,j,k,l,m,n,o,p,q,r,s,t,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10;
cin>>i;
if(i<10)
cout<<"0";
else if(10<=i<=99){
a=i/10;
b=i%10;
if(a==b)
cout<<"1";
else cout<<"0";}

else if(100<=i<=999){
c=i/100;
r1=i%100;
d=r1/10;
e=r1%10;
if(c==e && 0<=d<=9)cout<<"1";
else cout<<"0";}

else if(1000<=i<=9999){
f=i/1000;
r2=i%1000;
g=r2/100;
r3=r2%100;
h=r3/10;
u=r3%10;
if(u==f && g==h)
cout<<"1";
else cout<<"0";}

else if(10000<=i<=99999){
j=i/10000;
r4=i%10000;
k=r4/1000;
r5=r4%1000;
l=r5/100;
r6=r5%100;
m=r6/10;
n=r6%10;
if(j==n && k==m && 0<=l<=9)
cout<<"1";
else cout<<"0";}

else if(100000<=i<=999999){
o=i/100000;
r7=i%100000;
p=r7/10000;
r8=r7%10000;
q=r8/1000;
r9=r8%1000;
r=r9/100;
r10=r9%100;
s=r10/10;
t=r10%10;
if(o==t && p==s && q==r)
cout<<"1";
else cout<<"0";}
}

Grading criterion: Placeholder for extra marks to be given for any reason
Rating A: Modularity, Extra Functions Defined, some corrective marks for failed testcases
Rating B: No reason for extra marks
Rating C: 0
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 power(int j){
int a=1;
for(int i=0;i<j;i++){
a*=10;}
return a;
}
main_program{
int n;
cin>>n;
int a=1;
int s=0;
while(n%(power(a))>0){
a++;
}
if (a%2==0){
	for(int i=0;i<a/2;i++){
	        int b=(n%(power(i+1)))/power(i);
	        int c=(n%(power(i+a)))/(power(i+a-1));
		if (b==c){
		continue;
		}
	        if (b!=c){s=1;
	        break;}
			       }
	    }
else{
	for(int i=0;i<(a-1)/2;i++){
	        int b=(n%(power(i+1)))/power(i);
	        int c=n%(power(i+a))/(power(i+a-1));
		if (b==c){
		continue;
		}
	        if (b!=c){s=1;
	        break;}
			       }

}
if (s==0) cout<<"1";
if (s==1) cout<<0;
}

Grading criterion: Placeholder for extra marks to be given for any reason
Rating A: Modularity, Extra Functions Defined, some corrective marks for failed testcases
Rating B: No reason for extra marks
Rating C: 0
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,k=0,sum=0,t=1,p=0,flag,temp,s=0,d;
cin>>n;
temp=n;
while(true){d=n%10;
            sum=sum+d;
            n=n/10;
            if(n==0) break;
            k++;}
 for(int i=0;i<k;i++) {t=t*10;}  
 while(true){temp=temp/t;
              s=s+temp;
              t=t/10;
              if(temp==0) break;
              }
 
 if(sum==s){ flag=1; cout<<flag;}
 else cout<<0;
}

Grading criterion: Placeholder for extra marks to be given for any reason
Rating A: Modularity, Extra Functions Defined, some corrective marks for failed testcases
Rating B: No reason for extra marks
Rating C: 0
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, r=0;
	cin>>n;
	m=n;
	while(n!=0){
		int d=n%10;
		r=r*10 + d;
		n=n/10;
	}
	if(m==r){
		cout<<"1";
	}
	else{
		cout<<"0";
	}
	return 0;
}

Grading criterion: Placeholder for extra marks to be given for any reason
Rating A: Modularity, Extra Functions Defined, some corrective marks for failed testcases
Rating B: No reason for extra marks
Rating C: 0
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;
if (n%10==n/10000  && (n/10)%10==(n/1000)%10)
{cout<<"1";}
else {cout<<"0";}
}

Grading criterion: Placeholder for extra marks to be given for any reason
Rating A: Modularity, Extra Functions Defined, some corrective marks for failed testcases
Rating B: No reason for extra marks
Rating C: 0
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, a, k=0 , m1, m2;
	int j=0;
	cin>>n;

	a=n;
	m1 = m2 = n;
	while(a>0){
		a=a/10;
		k++;
	}

	if(k%2==0){
			for(int i=1; i<=k/2; i++){
				m1 = m1/pow(10,k-i);
				m2 = m2%10;
					if(m1==m2)
				{
					j++;
				}
				m1 = n - (m1*pow(10,k-i));
				m2 = (n - m2)/10;
			}
			if(j==k/2 || j==(k-1)/2){
				cout<<"1";
			}
			else cout<<"0";
		}
		else{
				for(int i=1; i<=(k-1)/2; i++){
				m1 = m1/pow(10,k-i);
				m2 = m2%10;
					if(m1==m2)
				{
					j++;
				}
				m1 = n - (m1*pow(10,k-i));
				m2 = n - m2;
			}
			if(j==k/2 || j==(k-1)/2){
				cout<<"1";
			}
			else cout<<"0";
		}
}

Grading criterion: Placeholder for extra marks to be given for any reason
Rating A: Modularity, Extra Functions Defined, some corrective marks for failed testcases
Rating B: No reason for extra marks
Rating C: 0
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(){ 
string x;
	cin>>x;
	long long int n=x.length();
	long long int count=0;
	if(n%2==0){ 
	for(int i=0; i<n/2; i++){ 
	if(x[i]==x[n-1-i]){count++;}	
	}
		if(count==n/2){cout<<"1";}
		else{cout<<"0";}
	}
	
	else{
		for(int i=0; i<(n-1)/2; i++){ 
	if(x[i]==x[n-1-i]){count++;}	
	}
		if(count==(n-1)/2){cout<<"1";}
		else{cout<<"0";}
	}
	}

Grading criterion: Placeholder for extra marks to be given for any reason
Rating A: Modularity, Extra Functions Defined, some corrective marks for failed testcases
Rating B: No reason for extra marks
Rating C: 0
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,r,q;
	cin >> n;

	int rev=0;
	int m = n;
	while(m>0)
	{
		r = m%10;
		q = m/10;
		m = q;
		rev = rev*10 + r;
	}
	if (rev == n)
	{
		cout << "1";
	}
	else if (rev != n)
	{
		cout << "0";
	}
}

Grading criterion: Placeholder for extra marks to be given for any reason
Rating A: Modularity, Extra Functions Defined, some corrective marks for failed testcases
Rating B: No reason for extra marks
Rating C: 0
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;

cout<< the number is polindrome;
 if (  n is polindrome )
{
cout<<then enter "1";
}
else
{
cout<<then enter "0";
}

return 0;
}

Grading criterion: Placeholder for extra marks to be given for any reason
Rating A: Modularity, Extra Functions Defined, some corrective marks for failed testcases
Rating B: No reason for extra marks
Rating C: 0
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,m;
cin>>n;
int c=0;
m=n;
while (m>0){
m=m/10;
c++;
}
int p,t=0,i=1,r,q;
q=n;
r=c;
while (i<=c){
p=q%10;
t=t+(pow(10,r))*p;
r=r-1;
i++;
q=q/10;
}
if (n==t/10) cout<<"1";
else cout<<"0";
}

Grading criterion: Placeholder for extra marks to be given for any reason
Rating A: Modularity, Extra Functions Defined, some corrective marks for failed testcases
Rating B: No reason for extra marks
Rating C: 0
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, remainder, reverse;
cin>>n;
int m=n;
reverse=0;

while(n/10>0){
remainder=n%10;
reverse=reverse*10+remainder;
n=n/10;
}

remainder=n%10;
reverse=reverse*10+remainder;

if(reverse==m) cout<<1<<endl;
else cout<<0<<endl;
}

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 q;
int a=1;
int b=0;
cin>>q;

if(q==121){
cout<<a;}
else if(q==1221){
cout<<a;}
else if(q==12321){
cout<<a;}
else if(q==1234321){
cout<<a;}
else if(q==62326){
cout<<a;}
else{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,k=0,j=n,a=1;
	cin>>n;
	//to find how many digits are in 'n'
	for(int i=1;i<100;i++){
		j = j/10;
			k++;
			if(j==0){
				break;
			}
	}
	for(int l=1;l<k;l++){
		a = a*10;
	}
	if(k==1){
		cout<<"1";
	}
	if(k==3 || k==2){
	if(n%10 == n/a){
		 // if((n%100)/10 == (n/(a/10))%10){
		 // 	if((n%1000)/100 == (n/(a/100))%100){
		 // 		if((n%10000)/1000 == (n/(a/1000))%1000){
		 cout<<"1";
		 // }
		 // 	}
		 // }
	}
	else{
		cout<<"0";
	}
	}
	if(k==4 || k==5){
	if(n%10 == n/a){
		  if((n%100)/10 == (n/(a/10))%10){
		 // 	if((n%1000)/100 == (n/(a/100))%100){
		 // 		if((n%10000)/1000 == (n/(a/1000))%1000){
		 cout<<"1";
		 // }
		 // 	}
		 }
	}
	else{
		cout<<"0";
	}
	}
	if(k==6 || k==7){
	if(n%10 == n/a){
		  if((n%100)/10 == (n/(a/10))%10){
		 	if((n%1000)/100 == (n/(a/100))%100){
		 // 		if((n%10000)/1000 == (n/(a/1000))%1000){
		  cout<<"1";
		 // }
		 	}
		  }
	}
	else{
		cout<<"0";
	}
	}
	if(k==8 || k==9){
	if(n%10 == n/a){
		  if((n%100)/10 == (n/(a/10))%10){
		  	if((n%1000)/100 == (n/(a/100))%100){
		 		if((n%10000)/1000 == (n/(a/1000))%1000){
		  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: A
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";

}

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 , p = 0, i = 0, q , j = 0,r;
cin >> n ;
r = q = n ;
while(r >0)
{
j++;
r = r/10;
}
//cout << j << endl;
while (n > 0)
{

p += (n%10)*int(pow(10,j-i-1)) ;
n = n/10 ;
i++;
//cout << p << endl ;

}
// p = p/100 ;
//cout << p << endl;
//cout << q << endl;
if( q == p)
{
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: A
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;
}

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,a,b,c;
	if (n=a+10b+100c+1000b+10000a) 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 d=0,c=0,res=0;
int a=n,a1=n;
while(a1>0)
{
c++;
a1=a1/10;
}
while(a>0)
{
c--;
d=a%10;
res=res+(int)(d*pow(10,c));
;
a=a/10;
}
if(res==n)
{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: 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,s,p;
cin>>n;
int a=n;s=0;
while(a!=0){
p=a%10;
s=p+s*10;a=a/10;}
if(s==n){cout<<"1"<<endl;}
else{cout<<"0"<<endl;}
}

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,a,k=1,num;
cin>>n;
a=n;
for (k=1;k>=1;k++)
{

num= a%10;
cout<<"num"<<k<<" "<<num<<endl;
a=n/10;
}









}

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 n(int a){
int i=0;
while (a>0){i++;a=a/10}
return i;
}

int f(int n){
int r=n(n),k=0,a=0;
for (int i=0;i<n(n);i++){
r--;
a=
k=k+n/pow(10,r)
}
return k;
}
int main (){

int a;
cin >> a;
cout << f(a);

}

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