Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- unsigned f1(int a, int b) {
- if (b == 0)
- return a;
- return f1(b, a % b);
- }
- int main() {
- int a, b;
- FILE *f;
- f = fopen("in.txt", "r");
- fscanf(f, "%d%d", &a, &b);
- fclose(f);
- f = fopen("out.txt", "w");
- fprintf(f, "%u %u", f1(a, b), a*b / f1(a, b));
- fclose(f);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment