fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5. int n, m, res = 0;
  6.  
  7. if (scanf("%d %d", &n, &m) != 2 || n < 0 || m < 0) {
  8. printf("Inpute error");
  9. return 0;
  10. }
  11.  
  12. for(int i = 0; i <= n; i++) {
  13. for(int j = 0; j <= m; j++) {
  14. if (i + j >= 10) {
  15. goto l_res;
  16. }
  17.  
  18. res += (i + j);
  19. }
  20. }
  21.  
  22. l_res: printf("%d", res);
  23.  
  24. return 0;
  25.  
  26. }
  27.  
  28.  
Success #stdin #stdout 0s 5312KB
stdin
4 10
stdout
45