fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5. int a, b, na[1000], nb[1000], i = 0, j = 0, x, y, num, count = 0;
  6.  
  7. scanf("%d%d", &a, &b);
  8.  
  9. while (a > 0)
  10. {
  11. na[i] = a % 10;
  12. a /= 10;
  13. i++;
  14. }
  15.  
  16. while (b > 0)
  17. {
  18. nb[j] = b % 10;
  19. b /= 10;
  20. j++;
  21. }
  22.  
  23. for (x = i - 1, y = j - 1; x >= 0 || y >= 0; x--, y--)
  24. {
  25. num = na[x] + nb[y];
  26. if (num > 9)
  27. {
  28. count++;
  29. }
  30. }
  31.  
  32. if (count > 0)
  33. {
  34. printf("Yes");
  35. }
  36. else
  37. {
  38. printf("No");
  39. }
  40.  
  41. return 0;
  42. }
Success #stdin #stdout 0s 5388KB
stdin
19
 3
stdout
No