题目描述
常规做法,但是挺麻烦的,要学习新方法。
样例
#include<iostream>
using namespace std;
int main()
{
int x;
cin>>x;
if (x==61)
cout<< "Brasilia" <<endl;
else if(x==71)
cout<< "Salvador" <<endl;
else if(x==11)
cout<< "Sao Paulo" <<endl;
else if(x==21)
cout<< "Rio de Janeiro" <<endl;
else if(x==32)
cout<< "Juiz de Fora" <<endl;
else if(x==19)
cout<< "Campinas" <<endl;
else if(x==27)
cout<< "Vitoria" <<endl;
else if(x==31)
cout<< "Belo Horizonte" <<endl;
else
cout << "DDD nao cadastrado" <<endl;
return 0;
}