WA,WA,还是WA

P1603 斯诺登的密码

liao @ 2018-09-08 18:00:08


(╬ ̄皿 ̄)=○
------------
60分代码
```cpp
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
int number[21],s;
char str[30];
int tonum(char ch[]) {
    if(strcmp(str,"one")==0)return 1;
    if(strcmp(str,"two")==0)return 2;
    if(strcmp(str,"three")==0)return 3;
    if(strcmp(str,"four")==0)return 4;
    if(strcmp(str,"five")==0)return 5;
    if(strcmp(str,"six")==0)return 6;
    if(strcmp(str,"seven")==0)return 7;
    if(strcmp(str,"eight")==0)return 8;
    if(strcmp(str,"nine")==0)return 9;
    if(strcmp(str,"ten")==0)return 10;
    if(strcmp(str,"eleven")==0)return 11;
    if(strcmp(str,"twelve")==0)return 12;
    if(strcmp(str,"thirteen")==0)return 13;
    if(strcmp(str,"fourteen")==0)return 14;
    if(strcmp(str,"fifteen")==0)return 15;
    if(strcmp(str,"sixteen")==0)return 16;
    if(strcmp(str,"seventeen")==0)return 17;
    if(strcmp(str,"eighteen")==0)return 18;
    if(strcmp(str,"nineteen")==0)return 19;
    if(strcmp(str,"twenty")==0)return 20;
    return -123;
}
int main() {
    for(int i=1; i<=6; i++) {
        cin>>str;
        if(tonum(str)!=-123)
            number[++s]=(tonum(str)*tonum(str))%100;
    }
    sort(number+1,number+1+s);
    bool flag=false;
    for(int i=1; i<=s; i++)
        if(!flag) {
            if(number[i]) {
                cout<<number[i];
                flag=1;
            }
        } else
            printf("%.2d",number[i]);
    if(!flag)putchar('0');
    return 0;
}
```
蛋疼

by liao @ 2018-09-08 18:01:09

2

5

都错了


by WA鸭鸭 @ 2018-09-08 18:32:16

@liao 你的a,second这种呢


by liao @ 2018-09-08 18:35:58

@WA鸭鸭 return -123啦呀


by WA鸭鸭 @ 2018-09-08 18:37:23

@liao 不是,a表示1;second表示2


by liao @ 2018-09-08 18:37:45


by WA鸭鸭 @ 2018-09-08 18:38:11

a 1

both 2

another 3

first 1

second 2

third 3


by liao @ 2018-09-08 18:38:55

谢谢Thanks♪(・ω・)ノ


by WA鸭鸭 @ 2018-09-08 18:39:53

@liao 不用谢QwQ


by liao @ 2018-09-08 18:43:45

100!!


by Alkaid @ 2018-09-08 19:21:10

还是你菜

你看见了吗,我前天刚拿了 rk2


| 下一页