URAL1785解题报告

来源:互联网 发布:java修改文件编码格式 编辑:程序博客网 时间:2024/05/16 14:20

这道题完全是水题啊

1785. Lost in Localization

Time limit: 1.0 second
Memory limit: 64 MB
The Lavin Interactive Company, which has developed the turn-based strategy Losers-V, is constantly extending its target market by localizing the game to as many languages as it can. In particular, they are interested in creating a version of the game in Anindilyakwa, which is one of the languages spoken by indigenous Australians.
However, the localization is complicated by the fact that Anindilyakwa has no numerals. How can a phrase such as “You have seven black dragons and your enemy has forty black dragons” be translated into this language? The localizers have decided to translate it as follows: “You have few black dragons and your enemy has lots of black dragons.” They have compiled a table showing the rule of replacing numbers of monsters by Anindilyakwa words.NumberDesignation in Anindilyakwafrom 1 to 4fewfrom 5 to 9severalfrom 10 to 19packfrom 20 to 49lotsfrom 50 to 99hordefrom 100 to 249throngfrom 250 to 499swarmfrom 500 to 999zoundsfrom 1000legionHelp the localizers automatize the process. Write a program that would output the appropriate word given the number of monsters.

Input

The only line contains the number of monsters n (1 ≤ n ≤ 2000).

Output

Output the word corresponding to the given number of monsters in the Anindilyakwa language.

Samples

inputoutput
7
several
40
lots
一堆判断完全可以解题;

代码如下:

  1. #include<iostream>
  2. #include<cstring>
  3. using namespace std;
  4. int main()
  5. {
  6. int a;
  7. while(cin>>a)
  8. {
  9. if(a>=1&&a<=4)cout<<"few"<<endl;
  10. else if(a>=5&&a<10)cout<<"several"<<endl;
  11. else if(a>=10&&a<20)cout<<"pack"<<endl;
  12. else if(a>=20&&a<50)cout<<"lots"<<endl;
  13. else if(a>=50&&a<100)cout<<"horde"<<endl;
  14. else if(a>=100&&a<250)cout<<"throng"<<endl;
  15. else if(a>=250&&a<500)cout<<"swarm"<<endl;
  16. else if(a>=500&&a<1000)cout<<"zounds"<<endl;
  17. else if(a>=1000)cout<<"legion"<<endl;
  18. }
  19. return 0;
  20. }

0 0
原创粉丝点击