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 a;
cin>>a;
if (a<100) cout<<"1";
else cout<<"0";
}

Grading criterion: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
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;
	cin>>n;
	int n1=n;
	int n2=n;
	int c=0;
	while(n1>0){
		n1=n1/10;
		c++;


	}
	int c2=0;
	int i;
	int n3=0;
	int n4;
	c=c-1;
	while(n2>0 && c>=0){
		n4=n2%10;
		n2=n2/10;
		n3=n3+(pow(10,c)*n4);
		c--;

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

}

Grading criterion: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
Rating C: 0
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 a,c;
	cin>>a;
	c=a;
	int b=0;
	while(a>0){
		int d=a%10;
		b=b*10+d;
		a/=10;
	}
	if (b==c)
	{cout<<"1";
	}
	else{
		cout<<"0";
	}return 0;
			
}

Grading criterion: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
Rating C: 0
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<simplecpp>
main_program{

int n ;
cin>>n;

if(n==101||n==111||n==121||n==131||n==141||n==1001||n==1111||n==1221||n==1331||n==1441||n==1551||n==1661||n==1771||n==1881||n==1991||n==2002||n==2112||n==2222||n==2332||n==2442 ||n==2552||n==2662||n==2772||n==2882||n==2992||n==3003||n==10001||n==10201||n==10101||n==10301||n==10401||n==10501||n==10601||n==10701||n==1245421||n==12321||n==556655||n==5656565||n==10801||n==10901||n==20002  ){
cout<<"1";

}
else{
cout<<"0";
}







}

Grading criterion: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
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 main(){
int n;
cin>>n;
int a,b,c;
cin>>a>>b>>c>>b>>a;
if(n=abcba){
cout<<1;
}
}

Grading criterion: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
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;
	cin >> n;

	int no_of_digits;
	for(int i = 1; i <= n; i++){
		if (n / int(pow(10, i)) == 0){
			no_of_digits = i;
			break;
		}
	}

	int n1 = n, n2 = n;
	bool is_palindrome = true;
	while (n1 > 0){
		int digit_1 = n1 % 10;
		n1 = n1 / 10;
		int digit_2 = n2 / int(pow(10, no_of_digits - 1));
		n2 = n2 % int(pow(10, no_of_digits - 1));
		if (digit_1 != digit_2){
			is_palindrome = false;
			break;
		}
		no_of_digits--;
	}

	if (is_palindrome) cout << 1; else cout << 0;
}

Grading criterion: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
Rating C: 0
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 k,n,l,ktest=0;
cin>>k;
l=k;
while(k>0){
n=k%10;
k=k/10;
ktest= 10*ktest+n;
}
if(l==ktest){
cout<<"1";
}
else if(l!=ktest){
cout<<"0";
}
return 0;
}

Grading criterion: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
Rating C: 0
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<simplecpp>
main_program{
int a, b, c, s,n;
cin >> n;
 s=0, a=n, b=n, c=0;
while(a!=0){
c=a%10;
s=s*10+c;
a=a/10;
}
if(b==s)
cout << "1";

else
cout << "0";

}

Grading criterion: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
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>

main_program{

int a,i,d=0 ;

cin>> n;

i=n;

while(i>0) {
	
int 


}






}

Grading criterion: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
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>
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: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
Rating C: 0
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(){
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: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
Rating C: 0
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>
#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: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
Rating C: 0
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>
#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: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
Rating C: 0
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;
	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: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
Rating C: 0
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;
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: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
Rating C: 0
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<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: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
Rating C: 0
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<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: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
Rating C: 0
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<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: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
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>
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: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
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=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: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
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>
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: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
Rating C: 0
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<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: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
Rating C: 0
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<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: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
Rating C: 0
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<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: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
Rating C: 0
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,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: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
Rating C: 0
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>
#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: Is the loop iterated correctly for updating all digits of the number to the final number
Rating A: Correct while or for loop which runs till the correct reversal happens and then terminates
Rating B: Wrong loop which runs for an incorrect number of times causing a different final number
Rating C: 0
Rating D: 0
Assigned grade: B