UVA 10324 - Zeros and Ones

Problem PDF

Solution:

#include
#include

int main()
{
    char s[1000015];
    int t=1,n,p1,p2,i,c,tem;
    while(scanf("%s",s)==1)
    {
        if(strcmp(s,"\n")==0)
        break;
        scanf("%d",&n);
        printf("Case %d:\n",t++);
        while(n--)
        {
            scanf("%d%d",&p1,&p2);
            if(p1>p2)
            {
            tem=p1;
            p1=p2;
            p2=tem;
            }
            if(p1==p2)
            {
               printf("Yes\n");
               continue;
            }
            for(i=p1;i
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/10324/10324.cpp