注册 登录
编程论坛 C++论坛

这段代码我看不出问题 ,可是为什么会输不出数据呢

国际新生 发布于 2016-10-04 01:15, 1190 次点击
程序代码:
#include <iostream>
#include <string>
using namespace std;
int main(){
    int n;
    string a[100]={"LING","YI","ER","SAN","SI","WU","LIU","QI","BA","JIU","SHI"};
    while(cin>>n)
    {    if(n<0||n>99)
            cout<<"CUO LE"<<endl;
        else if(n>=0||n<=10)
            cout<<a[n]<<endl;
        else if(n==20||n==30||n==40||n==50||n==60||n==70||n==80||n==90)
            cout<<a[n/10]<<" SHI"<<endl;
        else if(n>10&&n<20)
            cout<<"SHI "<<a[n%10]<<endl;
        else
            cout<<a[n/10%10]<<" SHI "<<a[n%10]<<endl;
    }   
    return 0;
}
0 回复
1