Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int nod(int a, int b)
- {
- int r;
- while (b != 0) {
- r = a % b;
- a = b; b = r;
- }
- return a;
- }
- int main(void)
- {
- int m, n, aux;
- scanf("%d%d", &m, &n);
- aux = nod(m, n);
- m /= aux; n /= aux;
- printf("%d / %d", m, n);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement