#include<iostream> using namespace std; int main() { int n,min,d,c,n1,nmin; cout<<"n="; cin>>n; min=10000; while(n>0) { n1=n; c=0; d=2; while(n>1) { if(n%d==0) { c++; while(n%d==0) n=n/d; } else d++; } if(c<=min){ min=c; nmin=n1; } cout<<"n="; cin>>n; } cout<<nmin; }