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;
	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 of variable names
Rating A: Good variable names
Rating B: Ok Variable Names
Rating C: Poor Variable Names
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;
	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 of variable names
Rating A: Good variable names
Rating B: Ok Variable Names
Rating C: Poor Variable Names
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 of variable names
Rating A: Good variable names
Rating B: Ok Variable Names
Rating C: Poor Variable Names
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 of variable names
Rating A: Good variable names
Rating B: Ok Variable Names
Rating C: Poor Variable Names
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,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 of variable names
Rating A: Good variable names
Rating B: Ok Variable Names
Rating C: Poor Variable Names
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; // 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 of variable names
Rating A: Good variable names
Rating B: Ok Variable Names
Rating C: Poor Variable Names
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;
if(1<=start && end<=10000 && start<=end)
{	
float a,b,r,o=12;
float c=0;
for(a=start;a<=end;a=a+1)
	 {
	 for(b=start;b<=end;b=b+1)
		  {if(b>a)
			 {		  
		          c=pow((a*a+b*b),0.5);
		          int q=c;
		          if(c<=end && c-q==0 && a<c && b<c)
			  	 { int d=a,f=b,g=c;
			  	 for(int x=2 ; x<=d ; x=x+1)
					  {
					  if( d%x==0 && f%x==0 && g%x==0)
					  	{r=1;
						break;}
					  else {r=0;}
					  }
				 if(r==0)
				 { cout<<a<<" "<<b<<" "<<c<<endl;
				  o=1;}
			
				}
			 }
	     		 
		  }
	 }
if(o==12)
	{
	cout<<0;
	}
}}

Grading criterion: Quality of variable names
Rating A: Good variable names
Rating B: Ok Variable Names
Rating C: Poor Variable Names
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 w=0;	int s,e;
	cin>>s>>e;int t;
	int i=s;
	while(i<=e)
	{
		int j=i+1;
		while(j<=e)
			{
				int sq = i*i + j*j;
				float r = sqrt(sq);
				int c = sqrt(sq);
				if( c == r)
					 t=c;
				else
					 t=0;
				int f=0;
				int k =2;
				while(k <= i){
					if(t%k==0 && i%k==0 && j%k==0)
					{f++;break;}
					k++;
				}
				if(f==0 && t<=e && t!=0)
				{cout<<i<<" "<<j<<" "<<t<<endl;w++;}
				j++;
			}
		i++;
	}
	if(w==0)
		cout<<"0";
}

Grading criterion: Quality of variable names
Rating A: Good variable names
Rating B: Ok Variable Names
Rating C: Poor Variable Names
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 i,j,k;
    int x,y,z;
    int flag=0;
    int m=b,n=a,inter=0,gcd=1;
    i=a;
    while(i<b){
        x=i*i;
        j=i+1;
        while(j<b){
            y=j*j;
            k=j+1;
            while(k<(a+b)){
                z=k*k;
                if(z==(x+y)) {
                    flag=1; 
                    break;
                    }
                k++;
            }
            if (flag==1) {
                m=j,n=i,inter=0,gcd=1;
                while(1){
                    if(m%n==0) {
                        gcd=n;
                        break;
                    }
                    else {
                        inter=m%n;
                        m=n;
                        n=inter;
                    }
                }
                if (k%gcd!=0 || gcd==1) cout << i<<" "<<j<<" "<<k<<" "<<endl;
                }
            flag=0;
            j++;
        }
        i++;
    }
}

Grading criterion: Quality of variable names
Rating A: Good variable names
Rating B: Ok Variable Names
Rating C: Poor Variable Names
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;
cin >> start >> end;

bool printed = false;
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++){
						if(a%l==0 && b%l==0 && c%l==0){
							ncf = false;
							break;
						}
					}
					if(ncf){
						printed = true;
						cout << a << " " << b << " " << c << "\n";
					}
				}
			}
		}
	}
}
if(printed == false){
	cout << 0;
}
}

Grading criterion: Quality of variable names
Rating A: Good variable names
Rating B: Ok Variable Names
Rating C: Poor Variable Names
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 n1, n2;
	cin>>n1>>n2;

	float c;
	int a=n1, b=a+1;

	while ( a < n2 ) {
		b = a+1 ;
		c = 1;
		while ( c < n2 ) {

			c = sqrt( a*a + b*b );
			int m = c;
			float dec = c - m;
			if ( dec == 0 ){
			 cout<<a<<" "<<b<<" "<<c<<endl;
				}
			b++;
			}
		a++;
		}
}

Grading criterion: Quality of variable names
Rating A: Good variable names
Rating B: Ok Variable Names
Rating C: Poor Variable Names
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;
	cin>>x>>y;

	if(x==40 && y==70){
		cout<<"0";
	}

	if(x==1 && y== 30){
		cout<<"3 4 5"<<endl<<"5 12 13"<<endl<<"7 24 25"<<endl<<"8 15 17"<<endl<<"20 21 29"<<endl;

	}

	if(x==50 && y==100){
		cout<<"65 72 97"<<endl;
	}

	if(x==100 && y==200){
		cout<<"104 153 185"<<endl<<"119 120 169";
	}









}

Grading criterion: Quality of variable names
Rating A: Good variable names
Rating B: Ok Variable Names
Rating C: Poor Variable Names
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;
	bool c=true,d=false;
 cin>>a>>b;
 for(int i=a  ; i<=b ; i++)
 {
	  for(int j=a  ; j<=b ; j++)
	  {
                   for(int k=a  ; k<=b ; k++)
		   {
			   if(k*k+j*j==i*i&&j<k)
			   {
				   c=true;
				  for(int l=2 ; l<=b ; l++)
				  {
					  	 if(k%l==0&&j%l==0&&i%l==0)
					          {
						   c = false;
					          }
				   }
		 		 if(c==true)
		 		 {
			 		 cout<<j<<" "<<k<<" "<<i<<'\n';
					d = true; 
		 		 }
	                    }
                   }
           }} 
if(d==false){
	cout<<0;
}
}

Grading criterion: Quality of variable names
Rating A: Good variable names
Rating B: Ok Variable Names
Rating C: Poor Variable Names
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 = 0;
	int end = 0;
	int commonfactor = 0;
	int notriplet = 1;
	cin >> start >>end;
	for(int a = start;a<=end;a++)
	{
		for(int b =a;b<=end;b++)
		{
		
			float c = sqrt(a*a+b*b);
			if(int(c)==c and c<=end)
			{
				for(int i = 2;i<=c;i++)
				{
					if(a%i==0 and b%i==0 and int(c)%i==0)
					{
						 commonfactor = 1;
						 break;
					}
				}
				if(commonfactor==0)
				{
					cout << a << " " << b << " " << c << endl;
					notriplet = 0;
				}	
			}
			commonfactor = 0;

		}
		

	}
	if(notriplet == 1)
	{
	cout << 0;
	}

}

Grading criterion: Quality of variable names
Rating A: Good variable names
Rating B: Ok Variable Names
Rating C: Poor Variable Names
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 n,i,b,c;
	cin>>n>>i;
	int a=n;
	b=n+1;
	c=n+2;
	while(c<=i-2){
	if(pow(a,2)+pow(b,2)==pow(c,2)){
		cout<<a <<b <<c;
	}
c++;

	}}

Grading criterion: Quality of variable names
Rating A: Good variable names
Rating B: Ok Variable Names
Rating C: Poor Variable Names
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
{double a,b;
cin>>a>>b;
for(double i=a+1; i<=b; i++)
{
for(double j=i; j<=b-1; j++)
{
for(double k=b-1; k>=j; k--)
{
if((k*k==((i*i)+(j*j))))
{cout<<i<<" ";
cout<<j<<" ";
cout<<k<<" ";
}
}
}
}

}

Grading criterion: Quality of variable names
Rating A: Good variable names
Rating B: Ok Variable Names
Rating C: Poor Variable Names
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 i = 0;
int a,b;
int m = 3;
cin>>a>>b;
if(a>3 || b<5){
while(a<((m*m)-1) && a<2*m && ((m*m)+1)<b)
{
cout<<2*m<<" "<<(m*m)-1<<" "<<((m*m)+1)<<endl;
m++;
i++;
}}
if(a<3 && b>5)
{
	cout<<3<<" "<<4<<" "<<5<<endl;
while(a<((m*m)-1) && a<2*m && ((m*m)+1)<b)
{
cout<<2*m<<" "<<(m*m)-1<<" "<<((m*m)+1)<<endl;
m++;
i++;
}
}

if(i == 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;
	     cin>>end;
	     int a;int b; int c;
	     
	     a=start;b=a+1;
	    
	     
	     
             while(start<=a && a<=end){
		     while(start<=b && b<=end){c=pow(((a*a)+(b*b)),0.5);
			     
			     if(start<=c && c<=end )
			     
			     {
				     cout<<a<<" "<<b<<" "<<c<<endl;}
			     b++;} 
		     a++;}


}
















































/*	int m,n;
	cin>>m;
	cin>>n;
	int small;
	int large;
	large=m;
	small=n;
	if(n>m){large=n;
		small=m;}
	for(int i=1;i<=small;i++){
	   if(large%i==0 && small%i==0){cout<<i<<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 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 flag=0;
   while(start<end){
         int a,b,c;
	 float d;
	 a=start;
	
	   for(b=a+1;b<end;b++){
          c=sqrt(a*a + b*b);
	  d=sqrt(a*a + b*b);
	      if (c==d && c<=end){
		    /*     
		      int e;
		      for(e=2; e<a; e++){
			      if(a%e==0 && b%e==0 && c%e==0  ){
	                              flag=1;     
			      }
		   }
		        
                            if (flag=0){*/
			       cout << a << " "<< b << " " << c<< endl;
			      }
	      }
	
	   start++;
	      
           }
       
   
   }

  
 /* 
   if (flag==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: 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;
	cin>>start>>end;
	int a=1,b=2,c=3;
	while(end>=start&&a<b<c){
		if(c*c==a*a+b*b){
			cout<<a<<b<<c;}
		else{
			c++;
			if(a*a+b*b==c*c){
				cout<<a<<b<<c;}
			else{
				b++;
				if(a*a+b*b==c*c){
					cout<<a<<b<<c;}
				else{
					a++;
				if(a*a+b*b==c*c){
						cout<<a<<b<<c;}}}
	}}
}

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;
   }

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,count=0;
	bool div=true;
	cin >> start >> end;
	for (int i=start;i<=end-2;i++){
		for (int j=i+1;j<=end-1;j++){
			for (int k=j+1;k<=end;k++){
				if (i*i+j*j==k*k){
					a=i;
					b=j;
					c=k;
					div=true;
					for (int l=2;l<=i;l++){
						if ((i%l==0) and (j%l==0)){
							div=false;		
							break;
						}
					}
					if (div){
                				cout << a<< ' ' << b << ' ' << c << endl;
						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 a,b,c,d;
cin>>a>>b;
for(d=a;d<b;d++)
{
for(c=a+1;c<b;c++)
{
float p= a*a+ c*c;
float s=pow(p,0.5);
int h=pow(p,0.5);
if(s==h){ cout<<a<<" "<<c<<" "<<h<<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