Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int T, n, m, begin, i;
- scanf("%d", &T);
- for (i=0; i<T; i++)
- {
- scanf("%d%d", &n, &m);
- if (m>n)
- {
- int temp = n;
- n = m;
- m = temp;
- }
- if (10-n<=0) begin = 1;
- else begin = 10 - n;
- printf("There are %d ways to get the sum 10.", m-begin+1);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement