fork(3) download
  1. #include <stdio.h>
  2. int main()
  3. { int a,b,c=0;
  4. printf("a b = ");
  5. scanf("%d %d", &a, &b);
  6. while (a * b)
  7. {
  8. c += (a % 10 == b % 10);
  9. a /= 10;
  10. b /= 10;
  11. }
  12. printf("answer = %d\n", c);
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 2252KB
stdin
110 119
stdout
a b = answer = 2