[URI Online Judge] – 1113 – Ascending and Descending

Read an undetermined number of pairs of integer values. Write a message for each pair indicating if this two numbers are in ascending or descending order.

Input

The input file contains several test cases. Each test case contains two integer numbers X and Y. The input will finished when X = Y.

Output

For each test case print “Crescente”, if the values X and Y are in ascending order, otherwise print “Decrescente”.

Sample Input Sample Output
5 4
7 2
3 8
2 2
Decrescente
Decrescente
Crescente

my solution:


#include <cstdio>

int main(){
int a, b;
while(scanf("%d %d", &a, &b) && a != b)
if (a < b)
printf("Crescente\n");
else
printf("Decrescente\n");
return 0;
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s