SSL P2402 世界语

目录:

题目:

世界语 题目

题意:

给出我们一个数字,要求我们转为世界语这里写图片描述

分析:

单纯的模拟,而且还只是个两位数,处理好一些小细节,便可AC

代码:

过水小编就不讲解了

#include<cstdio>
#include<cstring>
#include<iostream>
#include<cmath>
#include<algorithm>
#define LL long long
using namespace std;
inline LL read() {
    LL d=0,f=1;char s=getchar();
    while(s<'0'||s>'9'){if(s=='-')f=-1;s=getchar();}
    while(s>='0'&&s<='9'){d=d*10+s-'0';s=getchar();}
    return d*f;
} 
string a,b;
string x[11];
int main()
{
    int n=read();
    x[1]="unu";x[2]="du";x[3]="tri";x[4]="kvar";x[5]="kvin";
    x[6]="ses";x[7]="sep";x[8]="ok";x[9]="nau";x[10]="dek";
    if(n>10)
    {
        b=x[n%10];
        n/=10;
        a=x[n];
        if(a!="unu") cout<<a;
        cout<<x[10]<<" "<<b;    
    }
    else cout<<x[n];
    fclose(stdin);
    fclose(stdout);
    return 0;
} 

猜你喜欢

转载自blog.csdn.net/qq_35786326/article/details/80028512
SSL
今日推荐