#include <iostream>Using namespace std;Void fun(int n);Int main(){ int n=126; fun(n); return 0;}Void fun(int n){ int k, r; cout<<n<<"="; for(k=2; k*k<=n; k++) { r=n%k; while(r==0) { cout<<k; n= n/k; if(n>1) cout<<"*"; r=n%k; } } if(n!=1) cout<<n<<endl;}
发布时间:2024-07-17 21:08:09