Advertisement
StoneHaos

843

Nov 2nd, 2019
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. //843
  2. #include <cstdio>
  3. #include <cmath>
  4.  
  5. int main(void) {
  6.     FILE* fin = fopen("input.txt", "r");
  7.     FILE* fout = fopen("output.txt", "w");
  8.  
  9.     int n, a, b;
  10.     fscanf(fin, "%d", &n);
  11.     fclose(fin);
  12.     int x = (int)sqrt(n);
  13.     for (int i = 1; i <= x; ++ i) {
  14.         if (n % i == 0) {
  15.             a = i;
  16.             b = n / i;
  17.         }
  18.     }
  19.     fprintf(fout, "%d %d\n", a, b);
  20.     fclose(fout);
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement