11942 - Lumberjack Sequencing
Moderator: Board moderators
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
11942 - Lumberjack Sequencing
Use this thread to discuss this problem.
Check input and AC output for thousands of problems on uDebug!
Re: 11942 - Lumberjack Sequencing
#include<iostream>
using namespace std;
int main()
{
int N,i,j;
cin>>N;
cout<<"Lumberjacks:"<<endl;
if(N>0 && N<20)
{
for(i=1;i<=N;i++)
{
int arr[10];
for(j=0;j<10;j++)
{
cin>>arr[j];
}
if((arr[0]<arr[1] && arr[1]<arr[2] && arr[2]<arr[3] && arr[3]<arr[4] && arr[4]<arr[5])||(arr[0]>arr[1] && arr[1]>arr[2] && arr[2]>arr[3] && arr[3]>arr[4] && arr[4]>arr[5]))
{
cout<<"Ordered"<<endl;
}
else
{
cout<<"Unordered"<<endl;
}
}
}
}
what is the problem here?
using namespace std;
int main()
{
int N,i,j;
cin>>N;
cout<<"Lumberjacks:"<<endl;
if(N>0 && N<20)
{
for(i=1;i<=N;i++)
{
int arr[10];
for(j=0;j<10;j++)
{
cin>>arr[j];
}
if((arr[0]<arr[1] && arr[1]<arr[2] && arr[2]<arr[3] && arr[3]<arr[4] && arr[4]<arr[5])||(arr[0]>arr[1] && arr[1]>arr[2] && arr[2]>arr[3] && arr[3]>arr[4] && arr[4]>arr[5]))
{
cout<<"Ordered"<<endl;
}
else
{
cout<<"Unordered"<<endl;
}
}
}
}
what is the problem here?