Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int NWD (int a, int b)
- {
- int c;
- while (b != 0)
- {
- c = a % b;
- a = b;
- b = c;
- }
- return a;
- }
- int main(int argc, char *argv[])
- {
- int a = 0, b =0;
- int t = 0;
- scanf("%d", &t);
- int i = 0;
- for(i = 0; i < t; i++)
- {
- scanf("%d %d" ,&a, &b);
- printf(NWD(a,b));
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment