CodeGraderBench/CodeGraderBench huggingface dataset:
Problem: Write a C++ program to sort an array A of n numbers strictly using the given algorithm:

1. Find the minimum element in the array.
2. Swap the minimum element with the first element of the array.
3. Find the minimum element in the remaining array.
4. Swap the minimum element with the second element of the array.
5. Repeat steps 3 and 4 until the entire array is sorted.

Constraints:

* n < 25

Input Format:

* Non-negative integer n
* Array A of n elements

Output Format:

* Print the sorted array with a space between adjacent elements.

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



int main()
{

    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){

        cin>>a[i];
    }




    for(int j=0;j<n-1;j++){
        int m=a[j];
        int x=j;

        for(int i=j;i<n-1;i++){
            if(m>a[i+1]){
                m=a[i+1];
                x=i+1;
            }
        }
        a[x]=a[j];
        a[j]=m;
 
}
    for(int i=0;i<n;i++){

        cout<<a[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 C++ program to sort an array A of n numbers strictly using the given algorithm:

1. Find the minimum element in the array.
2. Swap the minimum element with the first element of the array.
3. Find the minimum element in the remaining array.
4. Swap the minimum element with the second element of the array.
5. Repeat steps 3 and 4 until the entire array is sorted.

Constraints:

* n < 25

Input Format:

* Non-negative integer n
* Array A of n elements

Output Format:

* Print the sorted array with a space between adjacent elements.

Student submission:
#include <iostream>
using namespace std;
int min_index(int *a,int n,int j)
{
	int min=n;
	for(int i=n-1;i>=j;i--)
	{
		if(a[min]>a[i]) min=i;
	}
	return min;
}
int main()
{
	int n;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++) cin>>a[i];
	for(int i=0;i<n;i++)
	{
		int min=min_index(a,n,i);
		int temp=a[i];
		a[i]=a[min];
		a[min]=temp;
	}
	for(int i=0;i<n;i++) cout<<a[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 C++ program to sort an array A of n numbers strictly using the given algorithm:

1. Find the minimum element in the array.
2. Swap the minimum element with the first element of the array.
3. Find the minimum element in the remaining array.
4. Swap the minimum element with the second element of the array.
5. Repeat steps 3 and 4 until the entire array is sorted.

Constraints:

* n < 25

Input Format:

* Non-negative integer n
* Array A of n elements

Output Format:

* Print the sorted array with a space between adjacent elements.

Student submission:
#include<simplecpp>
main_progaram{
int n , i ;
cin>>n;
a[i];
for(i=0;i<<n;i++) {
cin>>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: B
Problem: Write a C++ program to sort an array A of n numbers strictly using the given algorithm:

1. Find the minimum element in the array.
2. Swap the minimum element with the first element of the array.
3. Find the minimum element in the remaining array.
4. Swap the minimum element with the second element of the array.
5. Repeat steps 3 and 4 until the entire array is sorted.

Constraints:

* n < 25

Input Format:

* Non-negative integer n
* Array A of n elements

Output Format:

* Print the sorted array with a space between adjacent elements.

Student submission:
#include<iostream>
using namespace std;
void swap (int &a, int &b){
int temp = a; a = b; b = temp;
return;
}
int min (float &arr[25], int n){
int minindex = 0; int &l=0;
for(int j=l; j<n; j++){
if(arr[minindex] > arr[j]) minindex = j;
}
return minindex;
}

	int n ; float A[25];
cin>>n;
for (int i = 0; i < n; i++) cin >> A[i];
int k=0;
for(int i =0; i<n;i++){
	minindex = min(A[25],n);
	swap(A[minindex],A[k]);
	k=k+1;
	l=l+1;
}
for (int i = 0; i < n; i++) cout<<A[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: B
Problem: Write a C++ program to sort an array A of n numbers strictly using the given algorithm:

1. Find the minimum element in the array.
2. Swap the minimum element with the first element of the array.
3. Find the minimum element in the remaining array.
4. Swap the minimum element with the second element of the array.
5. Repeat steps 3 and 4 until the entire array is sorted.

Constraints:

* n < 25

Input Format:

* Non-negative integer n
* Array A of n elements

Output Format:

* Print the sorted array with a space between adjacent elements.

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

int sort(int A[], int n){
int p,r;
for(p=0; p<n; p++){
    for(r=0; r<n-1; r++){
       if(A[r]<A[r+1]){
        A[r+1]=A[r];
       }
     swap(A[r+1], A[p]);
}
}
return A[n];
}

int main{
int A[], n;
cin>>n;
for(int i=0; i<n; i++){
cin>>A[i];
}
 sort(A , n);
 int m = sort(int A[], int n);
cout<<m;
}

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 C++ program to sort an array A of n numbers strictly using the given algorithm:

1. Find the minimum element in the array.
2. Swap the minimum element with the first element of the array.
3. Find the minimum element in the remaining array.
4. Swap the minimum element with the second element of the array.
5. Repeat steps 3 and 4 until the entire array is sorted.

Constraints:

* n < 25

Input Format:

* Non-negative integer n
* Array A of n elements

Output Format:

* Print the sorted array with a space between adjacent elements.

Student submission:
#include<iostream>
using namespace std;
int swap(int *A,int *B){
	int temp=*A;
	*A=*B;
	*B=temp;
	return 0;
}

int main(){
	int n;
	cin>>n;
	int arr[n];
	for(int i=0;i<n;i++){
		cin>>arr[i];
	}
	
		for(int i=0;i<n-1;i++){
			for(int j=i+1;j<n;j++){
				if(arr[j]<arr[i]){
					int temp=arr[j];
					arr[j]=arr[i];
					arr[i]=temp;
				}
			}
		}
		
	for(int i=0;i<n;i++){
		cout<<arr[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 C++ program to sort an array A of n numbers strictly using the given algorithm:

1. Find the minimum element in the array.
2. Swap the minimum element with the first element of the array.
3. Find the minimum element in the remaining array.
4. Swap the minimum element with the second element of the array.
5. Repeat steps 3 and 4 until the entire array is sorted.

Constraints:

* n < 25

Input Format:

* Non-negative integer n
* Array A of n elements

Output Format:

* Print the sorted array with a space between adjacent elements.

Student submission:
#include<simplecpp>
void swap(float *a,float *b)
{
float temp;
temp=*a;
*a=*b;
*b=temp;}
int avgmin(float *marks,int L)
  {
int minindex=0;
for(int j=0;j<L;j++)
{
  if(marks[minindex]<marks[j])  minindex=j;}
return minindex;
}
void selection_sort(float *A,int n)
{ for(int i=n;i>1;i--)
  {
	int minindex=avgmin(A,i);
	swap(&A[minindex],&A[i-1]);}}


main_program{
	float A[100];
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>A[i];
	selection_sort(A,n);
	for(int i=0;i<n;i++)
		cout<<A[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 C++ program to sort an array A of n numbers strictly using the given algorithm:

1. Find the minimum element in the array.
2. Swap the minimum element with the first element of the array.
3. Find the minimum element in the remaining array.
4. Swap the minimum element with the second element of the array.
5. Repeat steps 3 and 4 until the entire array is sorted.

Constraints:

* n < 25

Input Format:

* Non-negative integer n
* Array A of n elements

Output Format:

* Print the sorted array with a space between adjacent elements.

Student submission:
#include <iostream>
using namespace std;
void swap(int& a,int& b){
int temp = a;
a = b;
b = temp;
return;
}
int main(){
int n;
cin>>n;
int a[n];
for(int i=0;i<n<25;i++){
cin>>a[i];
}
for(int j=0;j<n<25;j++){
    for(int k=1;k<n<25;k++){
while(a[k]<a[j]){
   swap(a[j],a[k]);
  }
}
  }
for(int y=0;y<n<25;y++){
  cout<<a[y];
    }
 return 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 C++ program to sort an array A of n numbers strictly using the given algorithm:

1. Find the minimum element in the array.
2. Swap the minimum element with the first element of the array.
3. Find the minimum element in the remaining array.
4. Swap the minimum element with the second element of the array.
5. Repeat steps 3 and 4 until the entire array is sorted.

Constraints:

* n < 25

Input Format:

* Non-negative integer n
* Array A of n elements

Output Format:

* Print the sorted array with a space between adjacent elements.

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

void swap(int *a, int *b){
	int temp = *a;
	*a = *b;
	*b = temp;
}

void selection_sort(int len, int *a){
	for(int i=0; i<len; i++){
		int index_min=i;
		for(int j=i; j<len; j++){
			if(a[index_min]>=a[j]){
				index_min = j;
			}
		}
		swap(&a[index_min], &a[i]);	
	}
}

int main(){
	int n;
	cin >> n;
	int arr[n];
	for(int i=0; i<n; i++){
		cin >> arr[i];
	}
	
	selection_sort(n, arr);
	
	for(int i=0; i<n; i++){
		cout << arr[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 C++ program to sort an array A of n numbers strictly using the given algorithm:

1. Find the minimum element in the array.
2. Swap the minimum element with the first element of the array.
3. Find the minimum element in the remaining array.
4. Swap the minimum element with the second element of the array.
5. Repeat steps 3 and 4 until the entire array is sorted.

Constraints:

* n < 25

Input Format:

* Non-negative integer n
* Array A of n elements

Output Format:

* Print the sorted array with a space between adjacent elements.

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

int main(){

	int n,d;
	cin >> n;
	
	int a[n];
	
	for(int i=0;i<n;i++){
	
	cin >> a[i];
	}
	int min=a[0];
	for(int j=1,k=1,l=0;j<(n);j++,l++){
	
	for(;k<n;k++){
	if(min>a[k]){
	
	min=a[k];
	d=k;
	}
	}
	k=j+1;
	
	int temp=a[l];
	a[l]=min;
	a[d]=temp;
	min=a[j];
	}
	
	for(int i=0;i<n;i++){
	
	cout << a[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 C++ program to sort an array A of n numbers strictly using the given algorithm:

1. Find the minimum element in the array.
2. Swap the minimum element with the first element of the array.
3. Find the minimum element in the remaining array.
4. Swap the minimum element with the second element of the array.
5. Repeat steps 3 and 4 until the entire array is sorted.

Constraints:

* n < 25

Input Format:

* Non-negative integer n
* Array A of n elements

Output Format:

* Print the sorted array with a space between adjacent elements.

Student submission:
#include<simplecpp>

/*void myswap (float *a, float *b){
	float temp;
	temp = *a;
	*a = *b
	*b = temp;
	}*/
	
int Min(float *A,int n, int m){
	int Minindex=m-n;
	for(int j=Minindex;j<m;j++){
		if(A[Minindex]>A[j]) Minindex=j;
		}
	return Minindex;
	}
	
void Sort(float *B, int m){
	for(int i=m;i>1;i--){
		int minindex=Min(B,i, m);
		int temp =B[minindex];
		B[minindex]=B[m-i];
		B[m-i]=temp;
		
		}
	}

main_program{
	int n;
	cin>>n;
	float A[n];
	for(int i=0;i<n;i++){
		cin>>A[i];
		}
	Sort(A,n);
	for(int i=0;i<n;i++){
		cout<<A[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 C++ program to sort an array A of n numbers strictly using the given algorithm:

1. Find the minimum element in the array.
2. Swap the minimum element with the first element of the array.
3. Find the minimum element in the remaining array.
4. Swap the minimum element with the second element of the array.
5. Repeat steps 3 and 4 until the entire array is sorted.

Constraints:

* n < 25

Input Format:

* Non-negative integer n
* Array A of n elements

Output Format:

* Print the sorted array with a space between adjacent elements.

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

void swap(int*a,int*b)
{
int temp;
temp = *a;
*a=*b;
*b=temp;
}

int findmin(a[],n)
{
int k=0;
for(int i=0;i<n;i++)
{
 if(a[k]>a[i])
	k=i;
	 return k;

}
}

void sort(a[],n)
{
	int m;
for(int i=0;i<n;i++)
{
m=findmin(a,n-i);
swap(&a[m],&a[i])
}
}

int main()
{
int n,i;
cin>>n;
int a[n];
for(i=0;i<n;i++)
{
cin>>a[i];
}
sort(a,n);

for(i=0;i<n;i++)
{
cout<<a[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: B
Problem: Write a C++ program to sort an array A of n numbers strictly using the given algorithm:

1. Find the minimum element in the array.
2. Swap the minimum element with the first element of the array.
3. Find the minimum element in the remaining array.
4. Swap the minimum element with the second element of the array.
5. Repeat steps 3 and 4 until the entire array is sorted.

Constraints:

* n < 25

Input Format:

* Non-negative integer n
* Array A of n elements

Output Format:

* Print the sorted array with a space between adjacent elements.

Student submission:
#include <simplecpp>


void swap ( float *a, float *b) {

float temp;
temp=*a;
*a=*b;
*b=temp; }

int smallestindex (float *A, int L) {

int smallestindex= L-1;
for (int j=L-2;j>=0;j--) {
if (A[j] < A[smallestindex]) smallestindex=j;} 
return smallestindex;}

void sort (float*A, int n) {

for (int k=n; k>=2; k--) {
int small= smallestindex (A,k);
swap (&A[small],&A[n-k]);
} }

main_program {
int n;
cin >> n;
float A[n];
for (int i=0;i<n;i++) {
cin >> A[i];}

sort (A,n);
for (int i=0;i<n;i++) {
cout << A[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 C++ program to sort an array A of n numbers strictly using the given algorithm:

1. Find the minimum element in the array.
2. Swap the minimum element with the first element of the array.
3. Find the minimum element in the remaining array.
4. Swap the minimum element with the second element of the array.
5. Repeat steps 3 and 4 until the entire array is sorted.

Constraints:

* n < 25

Input Format:

* Non-negative integer n
* Array A of n elements

Output Format:

* Print the sorted array with a space between adjacent elements.

Student submission:
#include<iostream>
using namespace std;
void myswap(int* a, int& b){
  int temp =a ; a =b ; b= temp;
  return;
}
int main()
{
   int n;
   cin>>n;
   int A[n];
   for(int i=0; i<n;i++) { cin>>A[i];}
   int min=0
   for(int j=0; j<n; j++) 
   {
      if(a[j] < a[j+1]) {min=a[j];}
   }
   for(int x=0;x<n;x++) { myswap(a[i],min);}
   for(int y=0;y<n;y++) {cout << a[y] ;}
}

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 C++ program to sort an array A of n numbers strictly using the given algorithm:

1. Find the minimum element in the array.
2. Swap the minimum element with the first element of the array.
3. Find the minimum element in the remaining array.
4. Swap the minimum element with the second element of the array.
5. Repeat steps 3 and 4 until the entire array is sorted.

Constraints:

* n < 25

Input Format:

* Non-negative integer n
* Array A of n elements

Output Format:

* Print the sorted array with a space between adjacent elements.

Student submission:
#include<iostream>
using namespace std;
int main(){

int array[]={2,-2,5,6,8}
int size=5;

for(inti=0;i<size;i++)






return 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: B
Problem: Write a C++ program to sort an array A of n numbers strictly using the given algorithm:

1. Find the minimum element in the array.
2. Swap the minimum element with the first element of the array.
3. Find the minimum element in the remaining array.
4. Swap the minimum element with the second element of the array.
5. Repeat steps 3 and 4 until the entire array is sorted.

Constraints:

* n < 25

Input Format:

* Non-negative integer n
* Array A of n elements

Output Format:

* Print the sorted array with a space between adjacent elements.

Student submission:
#include<iostream>
using namespace std;
int main(){
	int n,l,i,b,f;
	cin>>n;
	int A[n];
	for(int k=0;k<n;k++){
		cin>>A[k];
	}
	for(i=0;i<n;i++){
		int q=A[i];b=i;
   for(f=i;f<n;f++){
	if (q>A[f]){
			q=A[f];
		}

	}
   for(int i=0;i<n;i++){
		if (q==A[i]){
			l=i;
		}}
		int temp=A[b];
	A[b]=A[l];
	A[l]=temp;
		
	}
	for(int k=0;k<n;k++){
		cout<<A[k]<<" ";
	}
	}

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

1. Find the minimum element in the array.
2. Swap the minimum element with the first element of the array.
3. Find the minimum element in the remaining array.
4. Swap the minimum element with the second element of the array.
5. Repeat steps 3 and 4 until the entire array is sorted.

Constraints:

* n < 25

Input Format:

* Non-negative integer n
* Array A of n elements

Output Format:

* Print the sorted array with a space between adjacent elements.

Student submission:
#include<simplecpp>

main_program{
int n;
cin>>n;
int A[n];
for(int i=0;i<n;i++)
  {
     cin>>A[i];
  }
for(int i=0; i<n; i++)
 {for(int j=i;j>0 && A[j-1]>A[j];j--)   //minindex=j
   {  //swap function
     int temp=A[j-1];
     A[j-1]=A[j];
     A[j]=temp;}}
for(int i=0;i<n;i++)
  {
     cout<<A[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 C++ program to sort an array A of n numbers strictly using the given algorithm:

1. Find the minimum element in the array.
2. Swap the minimum element with the first element of the array.
3. Find the minimum element in the remaining array.
4. Swap the minimum element with the second element of the array.
5. Repeat steps 3 and 4 until the entire array is sorted.

Constraints:

* n < 25

Input Format:

* Non-negative integer n
* Array A of n elements

Output Format:

* Print the sorted array with a space between adjacent elements.

Student submission:
#include<iostream>

using namespace std;
int main(){
int n;
int a[n];
cin>>n;
int i;
cin>>a[0];
for(i=0;i<n;i++)
  {
int j;
 for(j=i+1;j<n;j++)
  {cin>>a[j];
    {if(a[j]<a[i])
 {
int temp;
a[i]=temp;
a[j]=a[i];
temp=a[j];
cout<<a[j];
}}}}

return 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