题解 | #质数因子#
质数因子
https://www.nowcoder.com/practice/196534628ca6490ebce2e336b47b3607?tpId=37&tqId=21229&rp=1&ru=/exam/oj/ta&qru=/exam/oj/ta&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D37&difficulty=undefined&judgeStatus=undefined&tags=&title=
#include "stdio.h" int main() { long int n; scanf("%ld", &n); for (int i=2; i*i<=n; i++) { while (n%i == 0) { printf("%d ", i); n /= i; } } if (n!= 1) printf("%ld ", n); }