#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; cout<<n<<"="; int i=2; while(n!=1) { bool temp=true; while(temp) { if(n%i==0) { cout<<i; n/=i; if(n!=1) cout<<"*"; } else temp=false; } i++; } }
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; cout<<n<<"="; int t = n; int i = 2; while(n != 1) { while(n % i == 0) { if(t != n) cout<<"*"; cout<<i; n /= i; } i++; } return 0; }
Using your lizikid universal account