湘潭大学oj1214

#include
using namespace std;
int main()
{
    int k;
    cin>>k;
    while(k--)
    {
        int a,b,c;
        char n,m;
        cin>>a>>n>>b>>m>>c;
        int flag=1,count=1,p=a;
        if(c%(a+b)==0){cout<<0<         while(1)
        {


            a*=10;
            int temp=a+b;
            if(temp>c)break;

            if(c%temp==0){flag=0;cout<             count++;
        }
       if(flag){
            count=1;
       a=p;
        while(1)
        {

            b*=10;
            int temp=a+b;
            if(temp>c)break;

            if(c%temp==0){cout<<-count<             count++;
        }
       }
    }
    return 0;
}

你可能感兴趣的:(湘潭大学oj1214)