Advertisement
nguyenvanquan7826

B1

Oct 19th, 2013
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int T, n, m, begin, i;
  7. scanf("%d", &T);
  8. for (i=0; i<T; i++)
  9. {
  10. scanf("%d%d", &n, &m);
  11. if (m>n)
  12. {
  13. int temp = n;
  14. n = m;
  15. m = temp;
  16. }
  17. if (10-n<=0) begin = 1;
  18. else begin = 10 - n;
  19. printf("There are %d ways to get the sum 10.", m-begin+1);
  20. }
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement