Skip to content

Instantly share code, notes, and snippets.

@rajurayhan
Last active August 29, 2015 14:17
Show Gist options
  • Save rajurayhan/80fca5006fb88aba65b4 to your computer and use it in GitHub Desktop.
Save rajurayhan/80fca5006fb88aba65b4 to your computer and use it in GitHub Desktop.
URI Online Judge Solutions
#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