Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
38371 | 奚晨瑞 | 求一个合数的所有质因数 | C++ | Accepted | 0 MS | 244 KB | 289 | 2024-01-26 20:54:38 |
#include<iostream> using namespace std; int main() { int a; cin>>a; for(int i=1;i<=a;i++){ if(a%i==0){ if(i>1){ int x; for(int j=1;j<i;j++) { if(i%j==0){ x=j; } } if(x==1){ cout<<i<<" "; } } } } return 0; }