866 afișări Ardelean Alexandru Paul (Alecs2133) 24.05.2022 www.pbinfo.ro
Etichete: nicio etichetă

#include <bits/stdc++.h>

using namespace std;

int main()
{ int n,d=2,p; cin>>n; while (d*d<=n) { p=0; while (n%d==0) { p++; n=n/d; } if (p) cout<<d<<”^”<<p<<endl; d++; } if (n>1) cout<<n<<”^”<<1; return 0;
}


866 afișări Ardelean Alexandru Paul (Alecs2133) 24.05.2022 www.pbinfo.ro