Where's the Marble?

  • + 0 comments

    include

    include

    include

    include

    include

    include

    include

    void swap(int a[],int i,int j){ int temp; temp=a[i]; a[i]=a[j]; a[j]=temp;

    }

    int main(){ int m; int n; scanf("%d %d",&m,&n); int A[10]={0}; A[m-1]=1; for(int a0 = 0; a0 < n; a0++){ int a; int b; scanf("%d %d",&a,&b); // your code goes here swap(A,a-1,b-1);

        //for(int a0 = 0; a0 < n; a0++){ printf(" %d ",A[a0]);}
    
    }
    
     for(int a0 = 0; a0 < 10; a0++){
         if(A[a0]==1)
             {
             printf("%d",a0+1);
             break;
         }
     }
    return 0;
    

    }