URI / BEE CROWD 1114 - Fixed Password - Solution in C,C++,Python | URI - BEECROWD - BEE 1114 Solution in C,C++,Python

URI / BEE CROWD 1114 - Fixed Password - Solution in C,C++,Python | URI - BEECROWD - BEE 1114 Solution in C,C++,Python

URI / BEE CROWD 1114 - Fixed Password - Solution in C,C++,Python | URI - BEECROWD - BEE 1114 Solution in C,C++,Python

Write a program that keep reading a password until it is valid. For each wrong password read, write the message "Senha inválida". When the password is typed correctly print the message "Acesso Permitido" and finished the program. The correct password is the number 2002.

Input

The input file contains several tests cases. Each test case contains only an integer number.

Output

For each number read print a message corresponding to the description of the problem.

Input SampleOutput Sample

2200
1020
2022
2002

Senha Invalida
Senha Invalida
Senha Invalida
Acesso Permitido

                                                          Demonstration:

This program takes user inputs. Then check the conditions for each test case contains.

Print “Senha Invalida”, if the value is 2002. Otherwise, print “Acesso Permitido

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

  URI / BEE 1114 Solution in C :   

  URI / BEECROWD Online Judge 1114 Solve  in C :                                          

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

		if(n==2002)
		{
			printf("Acesso Permitido\n");
			break;
		}
		else
		{
			printf("Senha Invalida\n");
		}
	}
	return 0;
}

0 Response to URI / BEE CROWD 1114 - Fixed Password - Solution in C,C++,Python | URI - BEECROWD - BEE 1114 Solution in C,C++,Python

Post a Comment