fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3. char n[20];
  4. int main()
  5. {
  6. scanf("%s",&n);
  7. int ok=2,scs=strlen(n);
  8. if((int)(n[scs-1]-'0')%2)ok=1;
  9. if(scs%2==1&&ok==1)printf("1");
  10. else if(scs%2==0&&ok==2)printf("0");
  11. else printf("-1");
  12. }
  13.  
Success #stdin #stdout 0s 5296KB
stdin
Standard input is empty
stdout
Standard output is empty