P1063为何每次评测都多0?

P1603 斯诺登的密码

多功能的苟或 @ 2017-04-11 17:24:25

自己运行都可以,没有0,放到评测就有0,请各位大佬看看哪里有问题,谢谢。

#include<iostream>
#include<cstdlib>
#include<map>
#include<string>
#include<cstdio>
#include<algorithm>                                                 //请忽略我的头文件
using namespace std;
map<string,int>biao;
int ac1[6],ac2[6];
long long da1,da2;
bool csh()
{
    biao["one"]=1;        biao["two"]=4;        biao["three"]=9;    biao["four"]=16;        biao["five"]=25;        biao["six"]=36;
    biao["seven"]=49;    biao["eight"]=64;    biao["nine"]=81;    biao["eleven"]=21;        biao["twelve"]=44;        biao["thrteen"]=69;    
    biao["fourteen"]=96;biao["fifteen"]=25;    biao["sixteen"]=56;    biao["seventeen"]=89;    biao["eighteen"]=24;    biao["nineteen"]=61;
    biao["a"]=1;        biao["both"]=4;    biao["another"]=1;    biao["first"]=1;        biao["second"]=4;        biao["third"]=9;
}
int main()
{
    csh();
    for(int i=0;i<=5;i++)
    {
        string v;    
        cin>>v;
        if(biao.count(v)==1)
        {
                ac1[i]=biao[v];
                cout<<"ac1["<<i<<"]="<<ac1[i]<<endl;
        }
    }
    sort(ac1+0,ac1+6);
    for(int i=0;i<=5;i++)
    {
        if(ac1[i]==0)
            da1=da1;
        else if(ac1[i]<=10)
            da1=da1*10+ac1[i];
        else
            da1=da1*100+ac1[i];
        cout<<"da1第"<<i+1<<"次="<<da1<<endl;
    }
    cout<<da1;
}

|