import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
String str = sc.next();
if (str.charAt(0)=='#') {
break;
}
int count = 0;
for (int i = 0; i < str.length()-1; i++) {
char c = str.charAt(i);
if (c=='1') {
count++;
}
System.out.print(c);
}
if (str.charAt(str.length()-1)=='e') {
if (count%2==0) {
System.out.println(0);
}else{
System.out.println(1);
}
}else{
if (count%2==1) {
System.out.println(0);
}else{
System.out.println(1);
}
}
}
sc.close();
}
}
HDOJ 2700 Parity(水)
最新推荐文章于 2018-05-08 19:44:00 发布