这个题思路没错,但是要似乎出bug了
我在cf上交过了,在vj上交错了
看了数据,一带是对的,不知哪里出错了。。
还是用sqrt写吧
代码如下
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int main()
{
int n;
scanf("%d",&n);
int p=sqrt(n);
for( ;p>=1;p--)
{
if(n%p==0) break;
}
printf("%d %d\n",p,n/p);
}