Last active
August 29, 2015 14:17
-
-
Save rajurayhan/80fca5006fb88aba65b4 to your computer and use it in GitHub Desktop.
URI Online Judge Solutions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
class DDD{ | |
private: | |
int a; | |
public: | |
void get_data(){ | |
cin>>a; | |
} | |
void display(){ | |
switch(a){ | |
case 61: cout<<"Brasilia"<<endl; | |
break; | |
case 71: cout<<"Salvador"<<endl; | |
break; | |
case 11: cout<<"Sao Paulo"<<endl; | |
break; | |
case 21: cout<<"Rio de Janeiro"<<endl; | |
break; | |
case 32: cout<<"Juiz de Fora"<<endl; | |
break; | |
case 19: cout<<"Campinas"<<endl; | |
break; | |
case 27: cout<<"Vitoria"<<endl; | |
break; | |
case 31: cout<<"Belo Horizonta"<<endl; | |
break; | |
default: cout<<"DDD nao cadastrado"<<endl; | |
break; | |
} | |
} | |
}; | |
int main(){ | |
DDD d; | |
d.get_data(); | |
d.display(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment