Sunday, August 28, 2016

uri- 1240 - Fit or Dont Fit I

#include<stdio.h>
int main()
{
    int n;
    long long int a,b;
    scanf("%d",&n);
    while(n--){
           // start:
        scanf("%lld %lld",&a,&b);
     if(a >= b)
        {
            while(b != 0)
            {
                if(b%10 != a%10)
                {
                    printf("nao encaixa\n");
                    goto finishhim;
                }
                a/=10;
                b/=10;
            }
            printf("encaixa\n");
        }
        else
        {
            printf("nao encaixa\n");
        }
        finishhim:;
    }
    return 0;
}

No comments: