Escolar Documentos
Profissional Documentos
Cultura Documentos
/* run this program using the console pauser or add your own getch,
system("pause") or input loop */
using namespace std;
while(1){
int i,num_dig=0,soma=0;
system("cls");
system("color 07");
cout<<"\t\t**********************************************
**********\n"
"\t\t******************* DIGITE UM NUMERO
*******************\n"
"\t\t********************************************************\
n";
cin>>num_dig;
if(num_dig!=0 && num_dig>=1){
if(num_dig % i == 0){
cout<<" "<<i;
if (soma != num_dig){
system("color 47");
cout<<"\t\t SOMA = "<<soma<<" O NUMERO NAO E
PERFEITO\n\n";
}else {
system("color 27");
cout<<"\t\t SOMA = "<<soma<<" O NUMERO E
PERFEITO\n\n";
}system("pause");
}
// ************** CASO DIGITAR UM NUMERO NEGATIVO
***************
else {
cout<<"\t\t APENAS NUMEROS POSITIVOS E MAIOR QUE 0\n";
system("pause");}
}
return 0;
}