#6629: 實在是沒法子了


justinj (黑旋風)


#include <iostream>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;

int main()
{
    char ch[1000];
    while(scanf("%s",ch)!=EOF)
    {
        int len=strlen(ch);
        int n=ch[len-1]-48;
        if(len==1 && n==0) return 0;
        n=n%2;
        int t;
        int sum=n;
        while(scanf("%d",&t)!=EOF)
        {
            if(t==0) break;
            if(sum==0) sum+=t%2;
            else sum-=t%2;
        }
        if(sum==0)
        {
            if(n%2==0) putchar('1');
            else putchar('2');
        }
        else putchar('0');
        putchar('\n');
    }
    return 0;
}

 

不知道第8,9..2個測點那裡錯誤了....