Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- #include <cstdio>
- #include <math.h>
- using namespace std;
- int main(int argc, char** argv) {
- int flap1;
- int flap2;
- int aux;
- int sumador;
- int i;
- int numPer;
- int numPer2;
- int cont;
- i = 1;
- sumador = 0;
- cont = 0;
- for (numPer = 370 ; numPer > i; i++) {
- aux = numPer%i;
- if (aux == 0)
- sumador = sumador + i;
- }
- if (numPer == sumador)
- printf("Es Perfecto\n");
- else
- printf("No Es Perfecto\n");
- numPer2 = numPer;
- while (numPer > 0){
- numPer = numPer /10;
- cont++;
- }
- sumador = 0;
- numPer = numPer2;
- for (i = 0; i <= cont; i++){
- sumador = sumador + pow(numPer % 10,cont)+0.5;
- numPer = numPer / 10;
- }
- if (numPer2 == sumador)
- printf("Es narcisista");
- else
- printf("No Es narcisista");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement