CodeGraderBench/CodeGraderBench huggingface dataset:
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

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

int main(){
	int start , end , count = 0 ;
	cin >> start >> end ;
	
	
		for(int i = start ; i <= end; i++)
		{
			for(int j = i+1 ; j <= end ; j++)
			{
				for(int k = j+1 ; (k <= end) ; k++)
				{
				       	 int ksq = k*k;
					 int jsq = j*j;
					 int isq = i*i ;
					 bool factor = 1;  
					 for(int a = 2 ; a <=100 ; a++)
					 {
						  
						 if(((k%a)==0)  &&((j%a)==0) &&((i%a)==0)){factor = 0 ;break;}
						 
						
					 } 
					
					if( ksq == (jsq + isq))
					{
						if(factor){
						cout << i <<" " << j <<" "<< k << endl ;
						count++ ;
						}		
					}
				}
			}
		}

		if(count == 0){cout << "0";}
	

}

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

Student submission:
#include<simplecpp>
main_program{
	int a,b;
	cin>>a;
	cin>>b;
	int x=a;
	int y=a;
	int z=a;
		while(x<=b && x>=a){
		   while(y<=b && y>=a){
		      while(z<=b && z>=a){
		      if (x*x+y*y ==z*z){
			      cout<<x<<" "<<y<<" "<<z;
		               z++;}
		      else{z++;}
		      }
		      y++;
		   }
		    x++;
		}
}

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

Student submission:
#include<simplecpp>

main_program{
	int start, end;
	bool z=false;
	cin >> start >> end;

	for(int a=start;a<=end;a++){
		for(int b=a;b<=end;b++){
			float j=sqrt(a*a+b*b);
			int k=sqrt(a*a+b*b);

			if((j-k==0)&&(k<=end)){
				
				bool r=false;
				for(int q=start;q<=end;q++){
					bool t=true;
					for(int i=2;i<q;i++){
						t=t && (q%i !=0);
					}

					if(t){
						if(a%q!=0 && b%q!=0 && k%q!=0) r=true;
					}
				}
				if(r){
					z=true;
                                cout << a << " " << b << " " << k << endl;

				}
	
			}
		}
	}
	if(z==false){
		cout << "0" << endl;
	}
}

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

Student submission:
#include<simplecpp>
main_program{

	int start,end,a,b,c,sum,third;
	cin>>start;cin>>end;
	a=start,b=start,c=start;
	if(start>=1 && end <=10000 && start<=end //(a%2!=0 && b%2!=0 && c%2!=0)){
		){
	//	if(a%2!=0 && b%2!=0 && c%2!=0){
		//	if((a>=start&&a<=end) && (b>=start&&b<=end) && (c>=start&&c<=end)){
		//	if(a<b && b<c){
			//	while(true){
			//	while(a<=end && b<=end && c<=end){
				//	a=start,b=start,c=start;
				while(false){
				sum=a*a+b*b;
				third = c*c;if(sum==third){
			//	sum==third;
				cout <<a <<" "<<b<<" " <<c<<" "<<endl;
			}a=a+2;b=b+3;c=c+4;}
			
			}
		}

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

Student submission:
#include<simplecpp>
main_program {
	
int start;
int end;

cin >> start >> end;
while(true){
	float a;
	float b;
	float c;
if(start > end)break;
if(start < end){
	if(start <= a && start <= b && start <=c && end >= a && end >=b && end >= c){
		if(c=pow((a*a*1.0 + b*b*1.0),0.5))
		{
			if(a<b){
				cout << "a b c" << endl;
			}
			else{
				cout << "b a c" << endl;
			}
 		}
		else continue;
			

	}
	else break;
}
}










}

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

Student submission:
#include <simplecpp> 
main_program { 
	int start, end ; 
	int a=end-2,b=end-1,c=end ; 
	cin >> start >> end ; 
	bool f = true ; 
	if (a + b < c || a + c < b || b + c < a) {
		f = false ;
		while() {
	       while (a > 0) { 	
	if (a*a + b*b = c*c) { 
		cout << a <<" "<< b <<" "<< c ; 
		a-- ; 
	}
	       }
	       }

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

Student submission:
#include<simplecpp>
main_program{
	int start,end;
	int a,b,c;
	cin>>start;
	cin>>end;
	int flag=0;
	
	a=start;b=a;c=b;
	for(a=start;a<end;a++){
		for(b=a;b<end;b++){
			for(c=b;c<end;c++){
				if(c*c==(a*a)+(b*b)){
					
					for(int i=2;i<=c;i++){
						if(a%i==0 && b%i==0 && c%i==0){
							flag=0;
							break;}

						else{ 
					  	flag=1;
						}

						}if(flag==1)
					cout<<a<<" "<<b<<" "<<c<<endl;
					}
				
				}
			}
		}
	}

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

Student submission:
#include<simplecpp>
main_program{
int start, end;
cin >> start  >> end;
/*if (start<1 || start>end){
       cin>>start;
}
if (end>10000){
	cin >>end;
}
*/
int a=0, b=0, c=0, i=0, f=0, j=0, k=0;
a=start;
b=a+1;
c=a+2;
cout<< "ready to enter loop" <<endl;
for (i=0; end>=c; i++, c++){
	cout<< "loop1" << endl;
	for (j=0; c>b; j++, b++){
		cout<< "loop2" <<endl;

		for (k=0; b>a; k++, a++){
			cout << "loop3" <<endl;
 			if ((a*a + b*b)==c*c){
				cout<< "yes"<<endl;
				if (b%a!=0){
					cout<<a<< " " <<b<< " "<< c<<endl;
					f++;
					cout<<f;
				}
			}
		}
	}
}
if (f==0) {cout<<0;}
}

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

Student submission:
#include<simplecpp>
main_program{
	int start,end;
	cin>>start>>end;
	int a,b,c,d;	;
        for(int i=start;i<=end,i++){
		a=i;
	}
		for(int j=start;j<=end,j++){
		b=j;
		}
			for(int k=start;k<=end,k++){
				c=k;
}
				d=a*a+b*b;
				if(d==(c*c)){

		if(a>b && b<c){
	bool ncf=true;
		}
for( int l=2;l<a,l++){
(b%l==0 && c%l==0){
	ncf=false;
	break;
}
}
if(ncf){
	cout<<a<<" "<<b<<" "<<c<<" "<<endl;

}
}
if(printed==false){
}
}

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

Student submission:
#include <simplecpp>
main_program{
int start, end;
cin>>start;
cin>>end;
for (int i=start; i<end+1;i++){
    int p= (i-1)/2;
    for (int j =i+1; j<end+1; j++){
       int s= i*i +j*j;
       float r;
       float b=0;
       for (int k=0; k<(s/2)+1;k++){
          if (s/(k*k)==1){
	   r=k;
	   b=1;
	   
	  
	  }}
          if (b==1){
	   
	    cout<<i<<" "<<j<<" "<<r;
	  
	  
	  } 
       
       }
    
    
    }
  

}

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

Student submission:
#include<simplecpp>
main_program{
        int start,end;
        cin>>start>>end;
        int i = start;
        while(i<end){
                for (int n = i+1;n<end;n++){
			float c=pow((pow(i,2)+pow(n,2)),(1.0/2));
			if(c%1==0){
				for(int l=i;i%l==0;l--){
					if(n%l==0||c%l==0){
						break;}
					else{
						cout<<i<<" "<<n<<" "<<c;}}}else{cout<<"none";}}i=i+1;}}

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

Student submission:
#include <simplecpp>

main_program 
{
int start , end;
cin>>start>>end;

 int a,b,c;
char space=32;
bool found=false;
for(a=start;a<=end;a++)
	{
	for(b=a;b<=end;b++)
		{
			c=sqrt(a*a+b*b);
	                if (c*c==a*a+b*b   &&  c<=end ) { cout<<a<<space<<b<<space<<c<<endl;found=true;}     	


		} 
	}

if (found) cout<<0;

}

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

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

int main(){
	int start;
	int end;
	int a;
	int b;
	int c;
	int sum ;
	cin>>start;
	cin>>end;
	int j1=start;
	int k1=start;
	for(int i=start;i<=end;i++){
		for(int j =j1;j<=end;j++){
			for(int k=k1;k<=end;k++){
				a=i*i;
				b=j*j;
				c=k*k;
			
				sum=a+b;
				if((b>a)&&(c>b)&&(c==sum)){
					cout<<i<<" "<<j<<" "<<k<<endl;
					j1=j;
					k1=k;
					}
					}
					}
					}
}

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

Student submission:
#include<simplecpp>
main_program{
int start,end,a,b,c,d,x,y,i;
cin>>start>>end;
a=start;
b=start+1;
while(b<=end){
if(a>=start){x=a;}
if(b>=a){y=b;}
if(a>b){d=b;}
else{d=a;}
i=2;
bool found=false;
c=sqrt(a*a+b*b);
while(i<d){if(a%i==0&&b%i==0){found=true;break;}
	
i++;}
if(!found){cout<<a<<' '<<b<<' '<<c<<' ';}
else{cout<<'0';}
a++;
b++;}

}

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

Student submission:
#include<simplecpp>

main_program {
	int start, end;
	cin >> start >> end;
	for ( int a = start; a <= end ; a++ ) {
		for ( int b = start; (a <= b) && ( b <= end); b++) {
			for (int c = start; (b <= c) && (c <= end); c++) {
				if ( ((pow(a,2)) + (pow(b,2))) == (pow(c,2)) ) {
					cout << a << " " << b << " " << c << "\n";
				}
			}
		}
	}
}

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

Student submission:
#include<simplecpp>
main_program{
	start=1;
	end=1000;
}

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

Student submission:
#include <simplecpp>
main_program {
	int a;
	int b;
	cin >> a >> b ;
	if(b-a==30) {
		cout<<0;
	}
	if(b-a==29) {
		cout<< "3 4 5\n";
		cout<< "5 12 13\n";
		cout<< "7 24 25\n";
		cout<< "8 15 17\n";
		cout<< "20 21 29\n";
	}
	if(b-a==50) {
		cout<< "65 72 97";
	}
	if(b-a==100) { 
		cout<<"104 153 185\n";
		cout<<"119 120 169\n";
	}
	if(b-a==500) {
		cout <<"504 703 865\n";
		cout <<"533 756 925\n";
		cout<<"540 629 829\n";
		cout <<"555 572 797\n";
		cout <<"580 741 941\n";
		cout <<"615 728 953\n";
		cout<< "616 663 905\n";
		cout<< "696 697 985\n";
	}
}

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

Student submission:
#include<simplecpp>
main_program{
	int start,end;
	cin>>start;
	cin>>end;
	int a,b,c;
        a=start;
	b=a+1;
	c=b+1;
	repeat(end-a){
		repeat(end-b){
			if(a*a + b*b ==c*c){
				if((c%b!=0 && c%a!=0) && b%a!=0){
				       cout<<a<<' '<<b<<' '<<c<<endl;
				}		
			}
			c++;
			if(c>end) break;
		}
		b++;
		if(b>end) break;
	}
}

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

Student submission:
#include<simplecpp>
main_program{
int i,j,s,start,end;
cin>>start>>end;
for(s=start;s<=end;s++)
{for(i=0;i<=end;i++)
{for(j=1;j<=end;j++)
{ if((start+i)*(start+i) + (start+j)*(start+j)==s*s)
   cout<<start<<s<<end;
   else
   cout<<0;}}}
   }

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

Student submission:
#include <simplecpp>

main_program{
	int start, end, a, b, c;
	int count = 0;		//to store number of triplets
	cin>>start>>end;
	bool flag = true;	//to store true or false depending on if the triplet has a common factor

	for(a = start; a<=end; a++){
		for(b = a; b <= end;b++){
			for(c = b; c<= end; c++){
				flag = true;
				float p = sqrt((a*a)+(b*b));
				//checking pythagorean condition
				if(p==c){
					for(int i = 2; i <= a; i++){
						//to check for common factor
						if(a%i==0 && b%i == 0 && c%i==0){
							flag = false;
							break;
						}
					}
					if(flag){
						count++;
						cout<<a<<" "<<b<<" "<<c<<endl;
					}
				}
			}
		}
	}
	//if no triplets then prints 0
	if(count == 0)
		cout<<0<<endl;
}

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program to accept two numbers from the user start and end and print the Pythagorean triplets within the range of start to end, both inclusive, but the triplets should not have any common factor. If no such triplets exist, then print 0. The triplets should be in increasing order.

Student submission:
#include<simplecpp>
main_program{
int start , end , a , b, c , cfactor;
cin >> start >> end;
a = start;

repeat(end-start+1){
	b = a +1;
	repeat(end-start+1-a){
		c = sqrt(a*a + b*b);
		cfactor = b % a;
		
		if((c*c == a*a + b*b) && c <= end && cfactor!=0 && cfactor!=1 && c % cfactor != 0) {cout << a << " " << b << " " << c << endl;
													}
		if ((c*c == a*a + b*b && c <= end && cfactor == 1) && c <= end) {cout << a << " " << b << " " << c << endl;
													}
		b = b + 1;
		}
	a =a+1;
	}
	
}

Grading criterion: Overall program correctness
Rating A: Common requirements  of a Program are correct - i.e. header (includes, using namespace, etc) main syntax variables declaration overall syntax
Rating B: Problems are present in the code(eg: printing unnecessary strings, missing semicolons & braces, wrong/missing declarations, wrong header files)
Rating C: 0
Rating D: 0
Assigned grade: A