CodeGraderBench/CodeGraderBench huggingface dataset:
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include<simplecpp>
int gcd(int n, int m)
{
	int rem;
	while (m%n != 0)
	{
		rem = m%n;
 		m = n;
		n = rem;
	}
	return n;
}	
int main()
{
	int n1, n2;
	cin >> n1 >> n2;
	int hcf = gcd(n1, n2);
	cout << (n1*n2)/hcf;
}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include<simplecpp>
unsigned int lcm(unsigned int a,unsigned  int b)
{
	unsigned int l=a>b?a:b;
	while(!(l%a==0 && l%b==0))
	{
		l++;
	}
	return l;
}

main_program
{
	unsigned int n1,n2;
	cin>>n1>>n2;
	cout<< lcm(n1,n2);
}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include<simplecpp>
int lcm( int a , int b ){
	int term = a*b;
       int remainder;
while (a%b!=0){
remainder = a%b;
a=b;
b= remainder;}
return term/b;}
main_program{
	int a , b;
	cin >> a >> b;
	cout<<lcm(a,b);
}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include<simplecpp>
int lcm
(int a, int b){
	if(b>a){
		int temp;
		temp = a;
		a = b;
		b = temp;
	}
	int p =a*b;
	while(a%b != 0){
		int remain = a%b;
		a=b;
		b=remain;
	}
	int l =p/b;
	return l;

}
main_program{
	int x,y;
	cin >>x >>y;
	int LCM =lcm(x,y);
	cout << LCM;
}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include <simplecpp>

main_program{
	int A, B;
	cin >> A >> B;
	int lcm = A;
	while(lcm % B != 0){
		lcm = lcm + A;
	}
	cout << lcm;
}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
nclude<simplecpp>
main_program
{
	int a,b;
	cin>>a>>b
}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include <simplecpp>

int GCD(int m, int n) {
  while(m%n != 0) 
     {int Remainder = m%n;
	     m=n;
	     n=Remainder;}
     return n;
}

int LCM(int a, int b) {
	return (a*b)/GCD(a,b);}
main_program {
	int x;
      	int y;

	cin >> x >> y;

	if(x>=y) {
	cout << LCM(x,y);}
	else {cout << LCM(y,x);}
     
}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include <simplecpp>
main_program{
	int m,n;
	cin>>m;
	cin>>n;
	while(m%n!=0){
		int remainder;
		remainder=m%n;
		m=n;
		n=remainder;
	}
	cout<<"lcm is :"<<m*n/remainder;
}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include<simplecpp>
main_program{
	int a, b, remainder = 1, hcf, prod;
	cin>>a>>b;
	prod = a*b;
	while(remainder != 0)
	{
		remainder = a%b;
		a = b;
		b = remainder;
	}
	hcf = a;
	cout<<prod/hcf<<endl;
}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include<simplecpp>
int lcm(int n,int m)
{
	int a =n;
	int b=m;
	int remainder;
	while(n%m!=0)
	{
		remainder = n%m;
		n=m;
		m =remainder;
	}
	return((a*b)/m);
}
main_program
{
	int n,m;
	cin>>n>>m;
	if(n>m)
	cout<<lcm(n,m);
	else
		cout << lcm(m,n);
}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include<simplecpp>
int lcm(int m, int n)
{
int x;
if(m>n)
x=n;
else
x=m;
int l;
int gcd;
for(int i=1; i<=x; i++)
{
if(m%i==0 && n%i==0)
gcd=i;
}
l= (m*n)/gcd;
return l;
}
main_program
{
int a,b;
cin>>a>>b;
cout<<lcm(a,b)<<endl;
}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include<simplecpp>
main_program{
	int a,b;
	cin>>a>>b;
	int i=1;
	while(i*a%b!=0){
		i++;
	}
	int n=i*a;
	cout<<n<<endl;
}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include<simplecpp>
int n1,n2;
int func(int n1 , int n2)
if(n1>n2){
	n1=n1-n2;
}
if(n2>n1){n2=n2-n1;}
if(n1=n2) break;

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include<simplecpp>
int gcd(int &n , int &m){while (m%n!=0){ int remainder = m%n;
	                 m=n;
			 n=remainder;}
			 return(n);}
int lcm(int &n , int &m){int l = m*n/gcd(n,m);
	                 return l;}
main_program{
	int n,m; cin>>n>>m;
	cout<<lcm(n,m);}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include<simplecpp>
int gcd(int m,int n){
	int remainder;
	while(m%n!=0){
		remainder=(m%n);
		m=n;
		n=remainder;}
	return n;}
main_program
{int m,n;
	cin>>m>>n;
        int lcm;
	lcm=m*n/gcd(m,n);
	cout<<lcm;}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include<simplecpp>

int gcd(int m , int n)
{
	int remainder;
	while(m%n !=0)
	{
		remainder = m%n;
		m=n;
		n=remainder;
	}
	return n;
}

int lcm(int a, int b)
{

	return (a*b)/gcd(a,b) ;
}
main_program{

	int a,b;
	cin>>a>>b;

	cout<<lcm(a,b)<<endl;
}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include<simplecpp>
void gcd(int m, int n)
{
	while(m%n!=0)
	{
		int r=m%n;
		m=n;
		n=r;
	}
	return n;

	lcm(int m,int n)= m*n/gcd(int m, int n)
}
main_program
{
	int x,y;
	cin>>x>>y;
	lcm(x,y);

}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include<simplecpp>
int lcm(int a,int b)
{
	int rem, result;
	result = a*b;
	while(b%a!=0)
 {
  rem=b%a;
  b=a;
  a=rem;
 }
	result = result/a;
	return result;
}
main_program
{
 int num1, num2;
 cin>>num1>>num2;
 cout<<lcm(num1,num2)<<endl;
}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include<simplecpp>
int lcm(int a,int b)
{int number;
       	if(b>a)
	 number=b;
		else number=a;
	while(true)
	
	if (number%a==0 && number%b==0)
		break;
		else ++number;
		return number;

}
main_program{
	int c,d;
	cin>>c>>d;
	lcm(c,d);
	cout<<lcm(c,d);
}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include<simplecpp>
int LCM(int p,int q){
	int x=p;
	int y=q;
	int rem;
	while(p%q!=0){
	rem=p%q;
	p=q;
	q=rem;}
	return (x*y)/q;}
main_program{
	int A,B;
	cin>>A>>B;
	if (A<B){
	cout<<LCM(A,B)<<endl;
	}
	else if(A>B){
		cout<<LCM(B,A)<<endl;
	}
}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include<simplecpp>
int hcf(int n1,int n2){
	int r;
	while(n1%n2>0){
		r=n1%n2;
		n1=n2;
		n2=r;
	}
	return n2;
}

int lcm(int m1,int m2){
 	return (m1*m2)/hcf(m1,m2);
}
main_program{
	int a,b;
	cin>>a>>b;
	cout<<lcm(a,b);
}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include<simplecpp>
int gcd(int m,int n)
{while(m%n!=0){ 
int remainder=m%n;
m=n;
n=remainder;}
return n;}
main_program{
int lcm,a,b;
cin>>a>>b;
lcm=a*b/gcd(a,b);
cout<< lcm<< endl;}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
int_main {
float x,y;
cout<<"enter two numbers"<<endl;
  cin>>"x,y">>;
x=(2^-2)+(2^-1)+(2^0);
if(x=y) {
cout<<"y is decmal form of x"<<endl;
}
}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that takes two positive integers A and B as input, passes them to a function that computes the LCM, and finally prints the result in the main function.

Student submission:
#include<simplecpp>
int lcm(int x,int y)
{
	int ans=0;
	if(x>y)
	{
	for(int i=x;i<=(x*y);i++)
	{
		if(i%x==0 && i%y==0)
		{
			ans=i;
			break;
		}
	}
	}
	else 
	{
		for(int i=y;i<=(x*y);i++)
        {
                if(i%x==0 && i%y==0)
                {
                        ans=i;
                        break;
                }
        }

	}
	return ans;
}
main_program
{
	int a,b;
	cin>>a>>b;
	cout<<lcm(a,b);
}

Grading criterion: is LCM correctly implemented ?
Rating A: if the least common factor is correctly calculated by using loop and conditional execution
Rating B: if least common factor is not calculated directly
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program to take two inputs from the user, the year N, and d, the day of the week that January 1st falls on. Assume that the days are encoded as follows: (Mon: 1, Tues: 2, Wed: 3,   Sun: 7). Based on this, print all the dates on which Sunday falls on in that year.You must also take into account if the year is a leap year or not. The year is said to be a leap year if the year is divisible by four, except for end-of-century years where the year should be divisible by 400.

Example:Let s say you were interested in finding out all the dates when Sunday is going to be this year i.e. 2024, then the input to your code should be:2024 1Explanation for the above input: 2024 is the year and 1st Jan happened to be on Monday this year, hence was number-encoded as 1The output should list the dates of all Sundays in the year N, month-wise on a new line.

Constraints (Assume)1000 <= N (Year) <= 35001 <= d <= 12

Student submission:
#include<simplecpp>
main_program{int y, d;
	cin >> y >> d;
	if(y%400==0){for(int i=0; d+2+i<=31; i=i+7){cout << "Month 1: " << 1+(7-d)+i;}}
	             			      

	else if(y%100==0)



	else if(y%4==0)



	else }

Grading criterion: Eg Use of functions beyond what was instructed or any other nice quality
Rating A: Some extra nice qualities
Rating B: Nothing extra
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a C++ program to take two inputs from the user, the year N, and d, the day of the week that January 1st falls on. Assume that the days are encoded as follows: (Mon: 1, Tues: 2, Wed: 3,   Sun: 7). Based on this, print all the dates on which Sunday falls on in that year.You must also take into account if the year is a leap year or not. The year is said to be a leap year if the year is divisible by four, except for end-of-century years where the year should be divisible by 400.

Example:Let s say you were interested in finding out all the dates when Sunday is going to be this year i.e. 2024, then the input to your code should be:2024 1Explanation for the above input: 2024 is the year and 1st Jan happened to be on Monday this year, hence was number-encoded as 1The output should list the dates of all Sundays in the year N, month-wise on a new line.

Constraints (Assume)1000 <= N (Year) <= 35001 <= d <= 12

Student submission:
#include<simplecpp>
main_program{
	int n,d,sum=0;
	cin>>n>>d;
	//if(n%100==0){
		//if(n%400==0){
			for(int i=1; i<=12; ++i){
				cout<<"Month"<<i<<":";
				for(int j=1; j<=4; ++j){
					sum = d;
					d = d+7;
				  	cout<<sum<<" ";
				}
				cout<<endl;
			}
}

Grading criterion: Eg Use of functions beyond what was instructed or any other nice quality
Rating A: Some extra nice qualities
Rating B: Nothing extra
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a C++ program to take two inputs from the user, the year N, and d, the day of the week that January 1st falls on. Assume that the days are encoded as follows: (Mon: 1, Tues: 2, Wed: 3,   Sun: 7). Based on this, print all the dates on which Sunday falls on in that year.You must also take into account if the year is a leap year or not. The year is said to be a leap year if the year is divisible by four, except for end-of-century years where the year should be divisible by 400.

Example:Let s say you were interested in finding out all the dates when Sunday is going to be this year i.e. 2024, then the input to your code should be:2024 1Explanation for the above input: 2024 is the year and 1st Jan happened to be on Monday this year, hence was number-encoded as 1The output should list the dates of all Sundays in the year N, month-wise on a new line.

Constraints (Assume)1000 <= N (Year) <= 35001 <= d <= 12

Student submission:
#include<simplecpp>
main_program{
	int x,y,d,w,m;
	cin>>y>>d;
	w=1;
	x=d;
	cout<<"Month 1:";
	repeat(31-x){
		d=d+1;
		w=w+1;
		if(w==7){
			cout<<d<<" ";
			w=0;
		}
	}
	d=0;
	cout<<endl;
	cout<<"Month 2:";
	if(y%4==0);
	while(d<=29){
		d=d+1;
		w=w+1;
		if (w==7){
			cout<<d<<" ";
			w=0;
		}
	}
	if(y%4!=0){
		while(d<=28){
			d++;
			w++;
			if(w==7){
				cout<<d<<" ";
			       w=0;	
			}
		}
}
m=3;
while(m<=12){
	d=1;
//f(m==3)
//d=2;
//f (m==4);
//=0;
cout<<endl<<"Month "<<m<<":";
if(m==3||m==5||m==7||m==8||m==10||m==12){
	while(d<=31){
		if(w==7){
			cout<<d<<" ";
			w=0;
		}
		d++;
		w++;
	}
}
	if(m==4||m==6||m==9||m==11){
		while(d<30){
			if(w==7){
				cout<<d<<" ";
				w=0;
			}
			d++;
			w++;

		}
	}
	m++;

}
}

Grading criterion: Eg Use of functions beyond what was instructed or any other nice quality
Rating A: Some extra nice qualities
Rating B: Nothing extra
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a C++ program to take two inputs from the user, the year N, and d, the day of the week that January 1st falls on. Assume that the days are encoded as follows: (Mon: 1, Tues: 2, Wed: 3,   Sun: 7). Based on this, print all the dates on which Sunday falls on in that year.You must also take into account if the year is a leap year or not. The year is said to be a leap year if the year is divisible by four, except for end-of-century years where the year should be divisible by 400.

Example:Let s say you were interested in finding out all the dates when Sunday is going to be this year i.e. 2024, then the input to your code should be:2024 1Explanation for the above input: 2024 is the year and 1st Jan happened to be on Monday this year, hence was number-encoded as 1The output should list the dates of all Sundays in the year N, month-wise on a new line.

Constraints (Assume)1000 <= N (Year) <= 35001 <= d <= 12

Student submission:
#inlcude<simplecpp>
main_program{
	int N,d;
	cin >> N >>d;
	// for checking leap year
	if((N%4==0 && N%100 !=0) || (N%400 == 0)){
		
	}
	switch(command){
case1: 
case2:// for checking leap year
        if((N%4==0 && N%100 !=0) || (N%400 == 0)){
        month2 has 29 days        
        }











	cout << "Month 1:"<< 8-d<<" "<<15-d<<" "<<22-d<<" "<<29-d;<<endl;
	cout << "Month 2:"<< 5-d<<" "<<12-d<<" "<<19-d<<" "<<25-d;<<endl;
	cout << "Month 3:"<< 4-d<<" "<<12-d<<" "<<19-d<<" "<<26-d;<<endl;
	cout << "Month 4:"<< 8-d<<" "<<15-d<<" "<<22-d<<" "<<29-d;<<endl;
	cout << "Month 5:"<< 6-d<<" "<<13-d<<" "<<20-d<<" "<<27-d;<<endl;
	cout << "Month 6:"<< 3-d<<" "<<10-d<<" "<<17-d<<" "<<29-d;<<endl;
	cout << "Month 7:"<< 8-d<<" "<<15-d<<" "<<22-d<<" "<<29-d;<<endl;
	cout << "Month 8:"<< 8-d<<" "<<15-d<<" "<<22-d<<" "<<29-d;<<endl;
	cout << "Month 9:"<< 8-d<<" "<<15-d<<" "<<22-d<<" "<<29-d;<<endl;
	cout << "Month 10:"<< 8-d<<" "<<15-d<<" "<<22-d<<" "<<29-d;<<endl;
	cout << "Month 11:"<< 8-d<<" "<<15-d<<" "<<22-d<<" "<<29-d;<<endl;
	cout << "Month 12:"<< 8-d<<" "<<15-d<<" "<<22-d<<" "<<29-d;<<endl;
}

Grading criterion: Eg Use of functions beyond what was instructed or any other nice quality
Rating A: Some extra nice qualities
Rating B: Nothing extra
Rating C: 0
Rating D: 0
Assigned grade: B