1004: 不明飞行物(ufo)

#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <string>
using namespace std;
int main(){
    string s1;
    string s2;
    long m,n;
    m=1;
    n=1;
    cin>>s1>>s2;
    for(int i = 0 ; i< s1.length(); i++)
    {
        m *= (int)s1[i] - (int)'A' + 1;
    }
    
    for(int i = 0 ; i< s2.length(); i++)
    {
        n *= (int)s2[i] - (int)'A' +1;
    }
    if(m % 47 == n % 47)
        cout<<"GO"<<endl<<"r1=r2="<<m%47<<endl;
    else
        cout<<"STAY"<<endl<<"r1="<<m%47<<"r2="<<n%47<<endl;;
    //cout<<m % 47 <<n % 47 <<endl;
    //cout<<count<<endl;
    
//    cout<<setiosflags(ios::fixed)<<setprecision(4)<<s<<endl;
//    cout<< setiosflags(ios::fixed)<<setprecision(4) <<c<<endl; 
}

 

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