My issue
where is the error in the program??
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int lenght,i,j,temp,arayy[1000];
scanf("%d",&lenght);
for(i=0;i<lenght;i++)
{
scanf("%d",&arayy[i]);
}
for(i=0;i<lenght-1;i++)
{
for(j=0;j<lenght-i-1;j++)
{
if(arayy[j]>arayy[j+1])
{
temp=arayy[j];
arayy[j]=arayy[j+1];
arayy[j+1]=temp;
}
}
}
printf("%d\n",arayy[0]);
return 0;
}
Learning course: Roadmap to 3*
Problem Link: https://www.codechef.com/learn/course/klu-roadmap-3star/KLURMP300B/problems/LPYAS170