1064: 不明飞行物(ufo)

#include<iostream>
#include<string>
using namespace std;

int main(){
    string a,b ;
    long m,n;
    m=1;n=1;
    cin>>a>>b;
    
    for(int i = 0 ; i < a.length(); i++) 
    {
        m *= (a[i] - 64);
        m = m % 47;
    }
        
        
    for(int i = 0 ; i < b.length(); i++) 
    {
        n *= (b[i] - 64);
        n = n % 47;
    }
        
    if(m % 47 == n % 47)    
    {
            cout<<"GO"<<endl;
            cout<<"r1=r2="<<m%47<<endl;
    }
    else 
    {
        cout<<"STAY"<<endl;
        cout<<"r1="<<m%47<<" r2="<<n%47<<endl;
    }
    //cout<<m<<" "<<n<<endl;
    return 0;
}

 

posted @ 2017-03-24 20:08  shiningrise  阅读(215)  评论(0编辑  收藏  举报
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css