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>
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: 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 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: 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 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: 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 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: 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 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: 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 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: 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 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: 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 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: 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 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: 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 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;
cin >>n;
int arr[n];

for(int i=0;i<n;i++){

cin >> arr[i];
}

for(int i=0;i<n;i++){

for(int j=n+1;j<n-1;j++){
if(arr[i] < arr[j]){
 int temp=arr[j];

arr[j] = arr[i];
arr[i] = temp;
}
}
}

cout << arr[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 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=100;
	
	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: 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 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 indexf(int *a,int n,int k);
void swap(int *(a+i),int *(a+m));
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 m=indexf(a,n,i)

      swap(a[i],a[m]);


	}

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


	}


}



	

	int indexf(int *a,int n,int k)
	{
	int min=10000,index=0;
	for(int i=k;i<n;i++)
	{
     if(a[i]<min)
     {
      index=i;


     }


	}

	return index;

	void swap(int *(a+i),int *(a+m))
	{
	int temp=a[i];
	a[i]=a[index];
	a[index]=a[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: 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; cin>>n;
	if(n<25)
	{
	int A[n];int x,temp;
	for (int i=0;i<n;i++)
	{
		cin>>x;
		A[i]=x;
	}
	for(int i=0;i<n-1;i++)
	{
		for(int j=i+1;j<n;j++)
		{
			if(A[i]>A[j])
			{
				temp=A[i];
			    A[i]=A[j];
			    A[j]=temp;
			}
		}
	}
	for(int i=0;i<n;i++)
	{
		cout<<A[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: 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;temp=b;
	return;
}

int func(int a[],int n)
{
	int i,j;
   for(int i=0;i<n;i++)
   {
   	cin>>a[i];
   }
   for(i=1;i<n;i++)
   {
   	for(j=0;j<n;j++)
   	{
   	if(a[j]>a[i])
   		swap(a[j],a[i]);

   	}	

   }
   return a[j];
}

int main()
{
	int n;
	cin>>n;
	int arr[n];

	cout<<func(arr,n);

}

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 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 argmin( float *elements, int n)
{
int minindex=0;
for(int j=1;j<n;j++)
{ if(elements[minindex] > elements[j] ) minindex = j;
}
return minindex;
}

void selection_sort (float *data, int n)
{ for(int i=1;i<n;i++)
{ int minindex = argmin(data,i);
swap(&data[minindex],&data[i-1]);
}
}

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

selection_sort(A,n);
for(i=0;i<n;i++)
{
cout << A[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: 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;
temp=*a;
*a=*b;
*b=temp;
}
int main()
{
int n,i,j,k,min=0;
cin>>n;
int a[n];
for(j=0;j<n;j++)
{
cin>>a[j];
}
for(i=0;i<n;i++)
{
for(k=i;k<n;k++)
{
if(a[k]<a[min])
min=k;
else 
continue;
}
swap(&(a[i]),&(a[min]));
}
for(int i=0;i<n;i++)
cout<<a[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: 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;
	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<n;j++){
	    if(A[i]>=A[j]){
	      int temp;
	      temp = A[i];
	      A[i] = A[j];
	      A[j] = temp;
	    }
	  }
	}
      
	
	for(int i=0;i<n;i++){
		cout<<A[i]<<" ";
	}
	
	
	return 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 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;
	
	cin>>n;
	
	int A[n];
	
	for(int i = 0; i<n; i++)
	{
		cin>>A[i];
	}
	
	
	for(int i = 0; i<n; i++)
	{
		int min = A[i];
		
		for(int j = 0; j<n; j++)
		{
			if(A[j] < min)
			{
				min = A[j];
				
				int temp = A[i];
				A[i] = A[j];
				A[j] = temp;
			}
		
		}
	
		
	}
	
	for(int k = (n-1); k>=0; k--)
	{
		cout<<A[k]<<" ";
	}
	
	return 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 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 ()
{
	let;
    int ("any number")
	"take number n and an array A";
	int ( "a to i" );
	make a formet (A1 , A2, A3, ----------- An);
	int ("A1>A2>A3>--------->An");
	it should find the element with minimum value;
	int "somthing";
	make an array;
	cin <A1, A2, A3, --------- An>
		cout make an array;
	cin < "1 to infinite" >;
	cout ("very least number");
	return 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 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>
#include <algorithm>
using namespace std;

int main() {
int n ; cin >> n; //Taking the array size
int a[1000];
for(int l=0; l<n;l++){cin >> a[l];}; //Taking the array elements

int m=10000;
int i =0;
while (i<n-3){
for (;i<n-3;i++) // for loop for getting the minimum element
	{
int temp1 = min(a[i],a[i+1]);
int temp2 = min(a[i+2],a[i+3]);
if (m > temp1 ||  m > temp2){m = min(temp1,temp2);};
	
for(int j =0;j<n;j++)
        {
swap(a[j],m);
       	
	}
	}
i++;
}
for(int z =0;z<n;z++) cout << a[z] << " ";
}

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 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(float *a,float *b)
{
	float * temp=0;
	temp=a;
	a=b;
	b=temp;
}

void  accendingorder(float a[],int n)
{
	for (int i=0;i<n;i++)
	{
		for (int j=i+1;j<n;j++)
		{
 			if(a[i]>a[j]) swap(a[i],a[j]);
		}
	}



}
int main()
{
	int n;
	cin>>n;
	float a[n];
	for (int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	accendingorder(a,n);
	for(int i=0;i<n;i++)
	{
		cout<<a[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: B