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 a, b, c;

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 a,b;
	cin>>a;
	cin>>b;
	int j=a;
	int d=a;
	int count=0;
	repeat(b-a){
		int i=d, f=1, h=1;
		repeat(b-a){
			float c=sqrt((i*i)+(j*j));
			int d=c;
			int m=c;
			if(c==d && c<=b){
				repeat(j){
					if(j%f==0 && i%f==0 && m%f==0){
						h=f;
					}
					f++;
				}
				if(h==1){
				cout<<j<<" "<<i<<" "<<c<<endl;
				count++;
				}
			}
			i++;
		}
		j++;
		d++;
	}
	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 n_start, n_end;
	cin >> n_start;
	cin >> n_end;

	int a, b, c;
	bool no_triplet = true;
	

	for (int i = n_start ; i < n_end ; i++ ){

		a = i*i;

		for (int j = i ; j < n_end ; j++){

			b = j*j;
			
			for (int k = j ; k <= n_end ; k++){

				c = k*k;
				
				if ( a + b == c){

					bool unique = true;

					for  (int l = 2 ; l <= k ; l ++){

						if (i%l == 0 && j%l == 0 && k%l == 0){
							unique = false;
							
						}

					}

					if ( unique ){

						no_triplet = false;
						cout << i << " " << j << " " << k << endl;

					}
				}
			
			}

		}

	}

	if (no_triplet){
		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;
    bool flag = false;
    bool nflag = false;
    cin >> start >> end;
    for (int i = start; i <= end; i++){
        for( int j = i+1; j <= end; j++){
            float k;
            nflag = false;
            k = sqrt(i*i + j*j);
            for (int n = 2; n <= i; n++){
                if( (i % n) == 0 && (j % n) == 0 && k < end && (k - int(k)) == 0){
                    nflag  = true;
                    break;
                }}
                if (k < end && (k - int(k)) == 0 && nflag == false){
                    cout << i << " " << j << " " << k << endl;
                    flag = true;
                }
            
        }
    }
    if( flag == false){
        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;
	bool found=false;
	
	for(int i=start; i<=end; i++)
		for(int j=i; j<=end; j++)
			for(int k=j; k<=end; k++)
			{
				if(i*i+j*j==k*k)
				{
				bool toprint=true;	
				for(int l=2; l<=i;l++)
					{
						if(i%l==0 && j%l==0 && k%l==0)
							{
							toprint=false;
							break;
							}
					}
					if(toprint)
						{	
							found = true;
							cout<<i<<" "<<j<<" "<<k<<endl;
						}
				}	
			}
	
	
	if(!found)
		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,d=0,count=0;
	cin>>start>>end;
	for(int i=start;i<=end;i++){
		for(int j=start;j<=end;j++){
			double cd=sqrt((i*i)+(j*j));
			int c=sqrt((i*i)+(j*j));
			if((c>=start && c<=end) && (c*100 == cd*100) && (i<j)){
				d=0;
				for(int k=2;k<=c;k++){
                                	if(i%k==0 && j%k==0){
                                        	d++;
                                	}
                        	}
				if(d==0){
					count++;
					cout<<i<<" "<<j<<" "<<c<<endl;
				}
			}
		}
	}
	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{
  float start,end;
  cin>>start>>end;

  bool exist=false;

 for(int a=start; a<=end; a++){
    for(int b=(a+1);b<=end;b++){
        
	    float x=sqrt(a*a+b*b);
       for(int c=(a+2);c<=end;c++){

	       if(c==x){
		        bool cond=true;
		     for(int k=2;k<=a;k++){
		          if(a%k==0 && b%k==0 && c%k==0){ cond=false;
		                                          break; 
			                                }
	              }
                     
                    if(cond){ cout<<a<<" "<<b<<" "<<c<<endl;
                              exist=true;
		    }
	       }
       }
    }
 }    

if(!exist) 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 a,b,c,i,j,k,l,start,end;
cin>>start;
cin>>end;
if(start>=1&&end<=1000)
{
	for(a=start; a<=end;a++)
	{
	i=a*a;
	for(b=start; b<=end; b++)
	{
	j=b*b;
	l=i+j;
	if(l<=(end*end))
	{
		for(c=start; c<=end;c++)
		{
		k=c*c;
		if(k==l)
		{
			if(a<b&&b<c)
			{
				
				if(b%a!=c%b)
				{
				
		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 x,y,a,b,c;

	cin>>x>>y;


	while(a<y && b<y && c<y){
	if{pow(a,2)+pow(b,2)=pow(c,2)}
		cout<<a<<b<<c;}
         
	else{(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 x,y,flag=0;
	cin>>x>>y;
	int a;
	for(a=x+1;a<y;a++){
		int b;
		for(b=a+1;b<y;b++){
			float c;
			c=pow(a*a+b*b,0.5);
			int r;
			r=c;
			if(c>x && c<y && c/r==1){
				cout<<a<<" "<<b<<" "<<c<<endl;
				flag=1;
		}
		}
	}
	if(flag==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;
	cin >> start >> end;

	for(int a = start+2; a<=end; a++) {
		for(int b = start+1; b<a; b++) {
			for(int c = start; c<b; c++) {
				
				float fab, fac, fbc;
				int ta=a, tb=b, tc=c;

				while(true) {
					if (ta%tb==0) {
						fab = tb;
						ta = a; tb = b;
						break;
					}
					else {
						ta = tb;
						tb = ta%tb;
					}
				}

				while(true) {
                                        if (ta%tc==0) {
                                                fac = tc;
                                                ta = a; tc = c;
                                                break;
                                        }
                                        else {
                                                ta = tc;
                                                tb = ta%tc;
                                        }
                                }

				while(true) {
                                        if (tb%tc==0) {
                                                fbc = tc;
                                                tb = b; tc = c;
                                                break;
                                        }
                                        else {
                                                tb = tc;
                                                tc = tb%tc;
                                        }
                                }

				if (fab==1 && fac==1) {
					if (fbc == 1) {

					int a2 = a*a, b2 = b*b, c2 = c*c;
					int b2c2 = b2 + c2;
					if (a2 == b2c2) { cout << c << b << a << 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>
int main (){
	int n,m,a,b,c,k,p,q,r;
	if ((n>=1)&&(n<=pow(10,4))&&(m>=1)&&(m<=pow (10,4))){
		cin>>n>>m;
		c=n;

		while((a<m)&&(a>n)&&(c<m){
				
				int a=m;
				while(c<m){
				int b=n;
				while ((b<m)&&(b<a)){
				k=a%((b*b)+(c*c));
				b++;
			
				if (k==0){
				cout << a<< " "<< b<< " " << c<< endl }
				
				}
				a--;
				}
				c++;
	}
}

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,count=0;
cin>>start>>end;
 for(int i=start; i<=end; i++)
 {
    for(int j=i; j<=end; j++)
    {
         for(int k=i; k<=end; k++)
         {
           if( i*i + j*j == k*k ){    if((i%2==1 && j%2==1 )  || (i%2==1 && k%2==1 )  || (k%2==1 && j%2==1 ) ) { count++; cout<<i<<" "<<j<<" "<<k<<endl;}}
         }

    }



 }
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 start, end;
    int a, b, c, i;
    int gcd = 1;
    bool flag = true;
    int k = 0;

    cin >> start >> end;
    
    for(a = start; a <= end; a++)
    {
        for(b = a; b <= end; b++)
        {
            for(c = b; c <= end; c++)
            {
                flag = true;
                for(i = 1; i <= a; i++)
                {
                    if((a % i == 0 && b % i == 0) || (a % i == 0 && c % i == 0) || (c % i == 0 && b % i == 0))
                    {
                        gcd = i;
                    }
                }
                if(gcd != 1)
                {
                    flag = false;
                }
                if(flag == true)
                {
                    if(a * a + b * b == c * c)
                    {   
                        cout << a << " " << b << " " << c << endl;
                        k = k + 1;
                    }
                }
                
            }
        }
    }
    if(k == 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,i,j,remainder,count = 0;
	cin>>start;
	cin>>end;
	for(i = start; i<end;i++)
	{
		for(j=i+1; j<end;j++)
		{
			int m = j, n = i;
			int gcd;
			if( m%n==0)
			{
				gcd = m;
			}
			else
			{
				while(m%n !=0)
				{
					remainder = m%n;
					m= n;
					n =remainder;
					if(m%n == 0)
					{
						gcd = n;
					}
				}
			}

				if(gcd == 1)
				{
				int root1 = sqrt(i*i + j*j);
				float root2 = sqrt(i*i + j*j);
				if(root1 == root2 && root1<=end)
				{
					cout<<i<<" "<<j<<" "<<root1<<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 start,end,a,b,c;
cin>>start>>end;
a=start;
b=a+1;
c=a+2;
while(a<b)
{if(a*a+b*b==c*c){
cout<<a<<b<<c<<"\n";}
else{
 while(b<c) {
	 if(a*a+b*b==c*c){
         cout<<a<<b<<c<<"\n";}
         else{
          while(c<=end){
            if(a*a+b*b==c*c){
              cout<<a<<b<<c<<"\n";}
            else{
                c++;}}
         c=a+3;
         b++;}
}}
b=a+2;
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: 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,c,start,end;
	cin>>start,end;

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 x,y,a,b,c,p,q,r, i=0;
	cin >> x>>y;
	for(a=x;a<=y;a++){
		for(b=a;b<=y;b++){
			for(c=b;c<=y;c++){
				if(c== sqrt(a*a + b*b)){
					cout << a <<" " << b <<" " << c<< endl;
				}
					else{
						cout << i;
					}	       
				
			}
		}
	}

}

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=2;
	cin>>start>>end;
	a=start; b=start; c=start;
	while(a>=start && a<=end){
		b=a+1;
		while(b<=end){
			c=b+1;
			while(c<=end){
				if((a*a)+(b*b)==(c*c)) {
					while(d<end){
						if(a%d==0 && b%d==0 && c%d==0)
						{cout<<a<<" "<<b<<" "<<c<<"\n";} d++;}
				c++;}
			b++;}
		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: 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,i;
	a=start;
	b=start+1;
	c=start+2;
	while(a>=start){
	start=a;
	while(a<b){
		b=a+1;
		while(b<c){
			c=b+1;
			while(c<=end){
				if(c*c == a*a + b*b){
					cout<<a<<" "<<b<<" "<<c<<endl;
				}
				c=c+1;
			}
			b=b+1;
		}
		a=a+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