南邮 OJ 1088 Gnome Sequencing

Gnome Sequencing

时间限制(普通/Java) :  1000 MS/ 3000 MS          运行内存限制 : 65536 KByte
总提交 : 305            测试通过 : 203 

比赛描述

In the book All Creatures of Mythology, gnomes are kind, bearded creatures, while goblins tend to be bossy and simple-minded. The goblins like to harass the gnomes by making them line up in groups of three, ordered by the length of their beards. The gnomes, being of different physical heights, vary their arrangements to confuse the goblins. Therefore, the goblins must actually measure the beards in centimeters to see if everyone is lined up in order.
Your task is to write a program to assist the goblins in determining whether or not the gnomes are lined up properly, either from shortest to longest beard or from longest to shortest.


输入

The input starts with line containing a single integer N, 0 < N < 30, which is the number of groups to process. Following this are N lines, each containing three distinct positive integers less than 100.

输出

There is a title line, then one line per set of beard lengths. See the sample output for capitalization and punctuation.

样例输入

3
40 62 77
88 62 77
91 33 18

样例输出

Gnomes:
Ordered
Unordered
Ordered

题目来源

ACM Mid-Central Regional 2009




#include<stdio.h>
int main(){
	int N,a,b,c;
	scanf("%d",&N);
	printf("Gnomes:\n");
	while(N--){
		scanf("%d%d%d",&a,&b,&c);
		if(a>b&&b>c || a<b&&b<c)
			printf("Ordered\n");
		else
			printf("Unordered\n");
	}
}






评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值