zoukankan      html  css  js  c++  java
  • (水题)洛谷

    https://www.luogu.org/problemnew/show/P1603

    有毒,大小写不检测,句号也不管。

    #include<bits/stdc++.h>
    using namespace std;
    #define ll long long
    
    int num[10];
    int top=0;
    
    char s[30];
    
    int tonum(){
        int n=strlen(s);
        if(strcmp(s,"one")==0)
            return 1;
        else if(strcmp(s,"two")==0)
            return 2;
        else if(strcmp(s,"three")==0)
            return 3;
        else if(strcmp(s,"four")==0)
            return 4;
        else if(strcmp(s,"five")==0)
            return 5;
        else if(strcmp(s,"six")==0)
            return 6;
        else if(strcmp(s,"seven")==0)
            return 7;
        else if(strcmp(s,"eight")==0)
            return 8;
        else if(strcmp(s,"nine")==0)
            return 9;
        else if(strcmp(s,"ten")==0)
            return 10;
        else if(strcmp(s,"eleven")==0)
            return 11;
        else if(strcmp(s,"twelve")==0)
            return 12;
        else if(strcmp(s,"thirteen")==0)
            return 13;
        else if(strcmp(s,"fourteen")==0)
            return 14;
        else if(strcmp(s,"fifteen")==0)
            return 15;
        else if(strcmp(s,"sixteen")==0)
            return 16;
        else if(strcmp(s,"seventeen")==0)
            return 17;
        else if(strcmp(s,"eighteen")==0)
            return 18;
        else if(strcmp(s,"nineteen")==0)
            return 19;
        else if(strcmp(s,"twenty")==0)
            return 20;
        else if(strcmp(s,"a")==0)
            return 1;
        else if(strcmp(s,"another")==0)
            return 1;
        else if(strcmp(s,"first")==0)
            return 1;
        else if(strcmp(s,"both")==0)
            return 2;
        else if(strcmp(s,"second")==0)
            return 2;
        else if(strcmp(s,"third")==0)
            return 3;
        return 0;
    }
    
    ll ans;
    
    void solve(){
        for(int i=0;i<6;i++){
            num[i]=(num[i]*num[i])%100;
        }
    
        sort(num,num+6);
    
        ll sum=0;
        for(int i=0;i<6;i++){
            sum=sum*100+num[i];
        }
    
        ans=sum;
    }
    
    int main(){
        for(int i=0;i<6;i++){
            scanf("%s",s);
            int n=strlen(s);
            for(int j=0;j<n;j++){
                s[j]=tolower(s[j]);
                if(s[j]=='.')
                    s[j]='';
            }
            num[top++]=tonum();
        }
        solve();
        printf("%lld
    ",ans);
    }
  • 相关阅读:
    安恒X计划12月月赛
    IDA 7.0在Mojava更新后打不开的问题
    ev3_basic——HITCON CTF 2018
    护网杯划水
    python开发中容易犯的错误整合
    使用gunicorn部署Flask项目
    记两个国外CTF的弱pwn
    MongoDB和pymongo自用手册
    深入理解python之二——python列表和元组
    深入理解python之一——python3对象的一些特性
  • 原文地址:https://www.cnblogs.com/Yinku/p/10317524.html
Copyright © 2011-2022 走看看