URI / BEE CROWD 1113 - Ascending and Descending - Solution in C,C++,Python | URI - BEECROWD - BEE 1113 Solution in C,C++,Python

URI / BEE CROWD 1113 - Ascending and Descending - Solution in C,C++,Python | URI - BEECROWD - BEE 1113 Solution in C,C++,Python

                                                                                        beecrowd | 1113

Ascending and Descending

Adapted by Neilor Tonin, URI  Brazil

                                                                                             Timelimit: 1


URI / BEE CROWD 1113 - Ascending and Descending - Solution in C,C++,Python | URI - BEECROWD - BEE 1113 Solution in C,C++,Python:

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”.

Input SampleOutput Sample

5 4
7 2
3 8
2 2

Decrescente
Decrescente
Crescente

                                                          Demonstration:

This program takes user inputs . Then check the conditions for each test case contains two integer number x and y and compare those two numbers if x is less than y , then  X and Y are in ascending order.

Print “Crescente”, if the values X and Y are in ascending order, otherwise print “Decrescente”

Finally print the result.

N.B: Don't copy paste the code as same. Just try to understand it and try yourself.

  URI / BEE 1113 Solution in C :   

  URI / BEECROWD Online Judge 1113 Solve  in C :                                          

#include<stdio.h>
int main()
{
	int x,y;
	while(1)
	{
		scanf("%d %d",&x,&y);

		if(x==y)
			break;

		else
		{
			if(x<y)
			{
				printf("Crescente\n");
			}
			else
			{
				printf("Decrescente\n");
			}
		}
	}
	return 0;
}

0 Response to URI / BEE CROWD 1113 - Ascending and Descending - Solution in C,C++,Python | URI - BEECROWD - BEE 1113 Solution in C,C++,Python

Post a Comment