Ad Code

Responsive Advertisement

Uri - Beecrowd | 1050 | DDD

beecrowd | 1050

DDD

Adapted by Neilor Tonin, URI Brazil


Read an integer number that is the code number for phone dialing. Then, print the destination according to the following table:


uri DDD

If the input number isn’t found in the above table, the output must be:
DDD nao cadastrado
That means “DDD not found” in Portuguese language.

Input

The input consists in a unique integer number.

Output

Print the city name corresponding to the input DDD. Print DDD nao cadastrado if doesn't exist corresponding DDD to the typed number.

Input Sample Output Sample

11

Sao Paulo

N.B.: It's better if you solve this by your own. Thank you!


  URI - BEECROWD Online Judge 1050 Solve  in C :                                          

//Solved by Intesar
#include <stdio.h>

int main() {

    int code;
    scanf("%d",&code);

    if(code==61)
        printf("Brasilia\n");
    else if(code==71)
        printf("Salvador\n");
    else if(code==11)
        printf("Sao Paulo\n");
    else if(code==21)
        printf("Rio de Janeiro\n");
    else if(code==32)
        printf("Juiz de Fora\n");
    else if(code==19)
        printf("Campinas\n");
    else if(code==27)
        printf("Vitoria\n");
    else if(code==31)
        printf("Belo Horizonte\n");
    else
        printf("DDD nao cadastrado\n");

    return 0;
}

Post a Comment

0 Comments

Ad Code

Responsive Advertisement