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<simplecpp>
main_program{
	int start,end;
	cin>>start>>end;
	int count=0;
	for(int a=start;a<=end;a++)
	{
		for(int b=a+1;b<=end;b++)
		{
			int sum=a*a+b*b;
			int c=sqrt(sum);
			float x=sqrt(sum);
			if ((c==x)&&(c<=end)){
				bool valid=true;
				for(int i=2;i<=a;i++){
					if ((a%i==0)&&(b%i==0)&&(c%i==0)){
						valid=false;
					}
				
				}
				if (valid){
					cout<<a<<" "<<b<<" "<<c<<endl;
					count=count+1;
				}
			}
		}

	}
	if(count==0){
		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 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;
	a=start;
	b=a+1;
	c=a+2;
        while(a>=start && a<=end){
		while(b>=start && b<=end){
			while(c>=start && c<=end){
                                if(a>b && b>c && pow(a,2)==pow(b,2)+pow(c,2)){
			cout<<a<<" "<<b<<" "<<c<<endl;c++; break;}
	                 if(a>c && c>b && pow(a,2)==pow(c,2)+pow(b,2)){
				 cout<<b<<" "<<c<<" "<<a<<endl;c++; break;}
			 if(b>a && a>c && pow(b,2)==pow(a,2)+pow(c,2)){
				 cout<<c<<" "<<a<<" "<<b<<endl;c++; break;}
			 if(b>c && c>a && pow(b,2)==pow(c,2)+pow(a,2)){
				 cout<<a<<" "<<c<<" "<<b<<endl;c++; break;}
			 if(c>a && a>b && pow(c,2)==pow(a,2)+pow(b,2)){
				 cout<<b<<" "<<a<<" "<<c<<endl;c++; break;}
			 if(c>b && b>a && pow(c,2)==pow(b,2)+pow(a,2)){
				 cout<<a<<" "<<b<<" "<<c<<endl;c++; break;}
					}
			c=c-end+a+2;
		
			b++;}
		b=b-end+a+1;
	
	
		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
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;
	cin >> start>>end;
	a=start;
	b=a+1;
	c=b+1;
	while(a<end){
		while(b<end){
			for(a=a;c<end;c=c+1){
				if( a*a + b*b == c*c) cout << a << b<< c<< endl;
			};
			b=b+1;
		};
		a=a+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: 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 x = end;

  while(x != 0){
         for( int i = 1; i++; i <= x){
	 double a = x*x - i*i;
         double b = x%(x+1);
	 double c = pow(a, 0.5);
         double d = c - b;

	 if(d == 0){
		 cout << i << c << x;
	 }
         }
	 x--;
  }
	 




}

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 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 n1,n2;
	cin>>n1>>n2;
	int a,b,c;
	while(a<n2)
		b=a+1;
	while(c<n2)
		c=sqrt(a*a+b*b);
	if( c is int)

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 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;
int a=start;
int b;
int c;

for(a=start; a<=end; a++)
	{
		for(b=a; b<=end; b++)
			{
				for(c=b; c<=end; c++)
				{
				int j=a*a+b*b;
				if(c*c==j)


					{      int flag=0;
						int k=2;
						for(k=2; k<=a;k++)
							{	if((a%k==0)&&(b%k==0))
								flag=1;
								break;
							}
						if(flag==0)
						{
						cout<<a<<" "<<b<<" "<<c<<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 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 s=true,r=true;
	cin>>start>>end;
	for(;start<=end-2;start++){
		for(int i=start+1;i<=end-1;i++){
			for(int j=i+1;j<=end;j++){
				if(start*start+i*i==j*j){
					r=true;
					int a=start,b=i,c=j;
					for(int k=2;k<=j;k++){
						if(a%k==0 && b%k==0 && c%k==0){
							r=false;
							break;
						}
					}
					if(r){
					        cout<<start<<" "<<i<<" "<<j<<endl;
					        s=false;
					}
				}
			}
		}
	}
	if(s) 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 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>>b;
	int count=0;
	for(int i=a;i<=b-2;i++){
		for (int j=i+1;j<=b-1;j++){
			for(int k=j+1;k<=b;k++){
				bool flag=1;
				if(i*i+j*j==k*k){
					for(int d=2;d<=i;d++){
						if((i/d)*(i/d)+(j/d)*(j/d)==(k/d)*(k/d) and i%d==0 and j%d==0 and k%d==0)
							{flag=0;
							break;
					}
					}
					if(flag==1){count++;
						cout<<i<<" "<<j<<" "<<k<<endl;}
					
				}	
			}
		}
	}
	if(count==0){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 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-2;a++){
		for(int b=a+1;b<=end-1;b++){
			for(int c=a+2;c<=end;c++){
				if(sqrt(a*a+b*b)==c){
					cout<<a<<" "<<b<<" "<<c<<endl;
					break;
				}
			}
		}
	}
}

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 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,cnt=0;
	cin>>start>>end;
	int square,c;
	for(int a=start;a<=end;a++){
		for(int b=a;b<=end;b++){
			square=a*a + b*b;
			c=sqrt(square);
			if(c*c==square && c<=end){
				int temp=a,flag=1;
				while(temp>1){
					if(a%temp==0 && b%temp==0){
						flag=0;
					}
					temp--;
				}
				if(flag==1){
						cout<<a<<" "<<b<<" "<<c<<" "<<endl;
						cnt++;
					}
			}
		}
	}
	if(cnt==0){
		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 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 ;
	bool isTriplet = false;
	int trip = 0 ;
	for ( int i = start ; i < end/1.414 ; i++ ) {
		for ( int j = i+1 ;  j <= end ; j++ ) {
			for ( int k = j ; k <= end ; k++ ){
				bool hasFactor = false ;
				if (k*k == i*i + j*j )
					isTriplet = true ;
				//	cout << i << j << k << endl ;
				else 
					isTriplet = false ;
				for ( int w = 2 ; w <= i ; w ++ ) {
					if ( i % w == 0 && j % w == 0 && k % w == 0 ){
					        hasFactor = true ;
						break;
					}
				}
				if ( hasFactor == false && isTriplet == true ){
					  cout << i <<" " << j<< " " << k <<" "<< endl ;
					  trip ++ ; 
				}
			}
		}
	}
	if ( trip == 0 ) {
		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 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 <math.h>
using namespace std;
int main() {
    int start, end, l, m, x, y, z, a, b;
    float i, j, k;
    cin >> start >> end;
    i = start;
    j = start + 1;
    a = i;
    b = j;
    for (i; i < end; i++) {
            while (j <= end) {
                k = pow((i * i + j * j), 0.5);
                l = pow((i * i + j * j), 0.5);
                if ((k == l) && (l <= end) && (i <= j))  {
                    while (m <= a) {
                        x = a % m;
                        if (x == 0) {
                            y = b % m;
                            z = l % m;
                            if ((y == 0) && (z == 0)) {
                                break;
                            }
                        }
                        m++;
                    }
                    if ((y != 0) && (z != 0)) {
                    cout << i << " " << j << " " << l << endl;
                    }
                }
                j++;
                if (j > end) {
                    j = i + 1;
                    break;
                }
            
            }
    }
    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 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,i,j,z,flag=1,m,c1=1;
double c;
	cin>>a>>b;
for(i=a;i<=b;i++)
{
for(j=i;j<=b;j++)
{
c=sqrt(i*i +j*j);
m=(int)sqrt(i*i + j*j);
if((m-c)==0.0)
{
for(z=2;z<=i;z++)
{	if(i%z==0)
	{
	if(j%z==0)
	{flag=0;
	}


}

}
if(flag==1 && c<=b)
{cout<<i<<" "<<j<<" "<<m<<endl; c1=0;}
}
flag=1;
}
}
if(c1==1)
	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 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 = 0;
	cin >> start >> end;
	for (int i = start; i <= end; i++)
	{
		int isq = i*i;
		for (int j = i; j <= end; j++)
		{
			int jsq = j*j;
			for (int k = j; k <= end; k++)
			{
				int ksq = k*k;
				int s = isq + jsq;
				if (s == ksq)
				{
					a = 1;
					int f = 1;					
					for (int z = 2; z <= i; z++)
					{
						if (i%z == 0 and j%z == 0)
						{
							f = 0;
						}
					}
					if (f == 1)
					{
						cout << i << " " << j << " " << k << endl;
					}	
				}
				
			}
		}
	}
	if (a == 0)
	{
		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 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;
	cin>>start>>end;
	int a,b,c;
	for(a=start;a<=end;a++){
		for(b=a;b<=end;b++){
			int d=a*a+b*b;;
			for(c=start;c<=end;c++){
				if (c*c==d)
				cout<<a<<" "<<b<<" "<<c<<"\n";
				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 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{
}

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 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 x,y,k;
	cin>>x>>y;
	int a=x,b=x,c=x;
	repeat(y-x){b=x;
		repeat(y-x){c=x;
			repeat(y-x){
				k=a*a+b*b-c*c;
				if(a<b&&b<c&&k==0){
					cout<<a<<" "<<b<<" "<<c<<endl;
				}
				c++;
			}
			b++;
		}
		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: 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;
	bool b=0;
	cin>>start>>end;
	for(int i=start;i<=end;i++){
		for(int j=i+1;j<=end;j++){
			int gcd1,firstnum1=i,secondnum1=j;
			while(true){
				if(secondnum1%firstnum1==0){gcd1=firstnum1;
					break;
				}
				else{
					int temp1=firstnum1;
					firstnum1=secondnum1%firstnum1;
					secondnum1=temp1;
				}
			}
			for(int k=j+1;k<=end;k++){
				 int gcd2,firstnum2=j,secondnum2=k;
                        while(true){
                                if(secondnum2%firstnum2==0){gcd2=firstnum2;
                                        break;
                                }
                                else{
                                        int temp2=firstnum2;
                                        firstnum2=secondnum2%firstnum2;
                                        secondnum2=temp2;
                                }
                        }
			 int gcd,firstnum,secondnum;
			 if(gcd1-gcd2>=0){firstnum=gcd2;
				 secondnum=gcd1;
			 }
			 else{
				 firstnum=gcd1;
				 secondnum=gcd2;
			 }
                        while(true){
                                if(secondnum%firstnum==0){gcd=firstnum;
                                        break;
                                }
                                else{
                                        int temp=firstnum;
                                        firstnum=secondnum%firstnum;
                                        secondnum=temp;
                                }
                        }
			if(gcd==1 && i*i+j*j==k*k){
				cout<<i<<" "<<j<<" "<<k<<endl;
				b=1;
			}
			}
		}
	}
	if(b==0){
		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 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;
	int a, b;
	while (a>=start && b<=end && a<b) {
		if (float c=sqrt((a*a)+(b*b))){

		cout << a << b << c << 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 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;
	float divisible=true;
	cin>>start>>end;
	for(int i=start;i<end-2;i++){
		//int a = i*i;
		divisible=true;
		for(int j=i+1;j<end-1;j++){
			//int b = j*j;
			divisible=true;
			for(int k=j+1;k<end;k++){
				divisible=true;
				if(i*i + j*j == k*k){
					divisible=true;
					if(i*i + j*j == k*k){
						divisible=true;
						for(int n=2;n<i;n++){
							divisible=divisible && !(i%n==0 && j%n==0 && k%n==0);}
						if(divisible==true){
					 		cout<<i<<' '<<j<<' '<<k<<'\n';}
					//if(divisible==false){break;}
					}
				}
			}
		}
	}
}

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 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,p,x,y,z,i;
	cin>>start>>end;
	for(a=start;a<=end;a++){
		for(b=start;b<=end;b++){
		if(a<b){
			for(c=start;c<=end;c++){
				if(b<c){
				p=c*c;
				}
					if(p==a*a+b*b){
					cout<<a<<" "<<b<<" "<<c<<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 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,c,i,j,start,end;
cin>>start;
cin>>end;
repeat(end-start){
a=start;
i=pow(a,2);
	repeat(end-start){
	b=start
	j=pow(b,2);
	c=pow(a+b,0.5);
	if((c%2==0 || c%2==1)&&(c<=end)){
	cout<<a<<b<<c;
	}
b++;
}
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
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>>b; // Take values of end and start..
    bool found = 0;
    
    for (int i = a; i<=b;i++){   // loop for first element...

        for (int j = i; j <= b; j++){  // loop for second element...

            for (int k = j; k<= b; k++){  // loop for third element...

                if ((i*i) + (j*j) == (k*k)){  // Check if the numbers form triplet or not...
                    
                    bool flag = 1;     // Check if the triplet has a common factor and if so reject that..
                    for (int c=2; c<=i; c++){

                        if ((i%c == 0) && (j%c == 0) && (k%c == 0)){
                            flag = 0;
                            break;
                        }

                    }

                    if (flag){  // If not common factor then print the triplet..
                        cout<<i<<" "<<j<<" "<<k<<endl;
                        found = 1;
                    }
                }
            }
        }
    }

    if (!found){
        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