#include <iostream>
#include<cstdio>
using namespace std;
int main()
{
int test,ary[200],i,j,c;
cin>>test;
cout<<"Lumberjacks:"<<endl;
while(test--)
{
for(i=0;i<10;i++)
{
cin>>ary[i];
}
c=0;
if(ary[0]<ary[1])
{
for(i=0;i<10;i++)
{
for(j=i+1;j<10;j++)
{
if(ary[i]>ary[j])
{
c++;
if(c==1)break;
}
}
}
if(c==0)
cout<<"Ordered"<<endl;
else
cout<<"Unordered"<<endl;
}
if(ary[0]>ary[1])
{
for(i=0;i<10;i++)
{
for(j=i+1;j<10;j++)
{
if(ary[i]<ary[j])
{
c++;
if(c==1)break;
}
}
}
if(c==0)
cout<<"Ordered"<<endl;
else
cout<<"Unordered"<<endl;
}
}
return 0;
}
#include<cstdio>
using namespace std;
int main()
{
int test,ary[200],i,j,c;
cin>>test;
cout<<"Lumberjacks:"<<endl;
while(test--)
{
for(i=0;i<10;i++)
{
cin>>ary[i];
}
c=0;
if(ary[0]<ary[1])
{
for(i=0;i<10;i++)
{
for(j=i+1;j<10;j++)
{
if(ary[i]>ary[j])
{
c++;
if(c==1)break;
}
}
}
if(c==0)
cout<<"Ordered"<<endl;
else
cout<<"Unordered"<<endl;
}
if(ary[0]>ary[1])
{
for(i=0;i<10;i++)
{
for(j=i+1;j<10;j++)
{
if(ary[i]<ary[j])
{
c++;
if(c==1)break;
}
}
}
if(c==0)
cout<<"Ordered"<<endl;
else
cout<<"Unordered"<<endl;
}
}
return 0;
}
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন