Advertisement
Guest User

Arf

a guest
Feb 19th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include<stdlib.h>
  4. #include <math.h>
  5. int main() /* Arf!!! Welcome to my Nomstrong number divider */
  6. {
  7. int Noms;
  8. Noms=0;
  9. char Arf[100];
  10.  
  11. int CD;
  12. int CDx;
  13. int Output=0;
  14. int Storage;
  15.     puts("Give me a number! :3");
  16.     scanf("%s",Arf);
  17.     CD=strlen(Arf);
  18.     CDx=CD;
  19.     Noms=atoi(Arf);
  20.     int Original=Noms;
  21.        while(CD>0){
  22.         Storage=Noms;
  23.         Noms=Noms % 10;
  24.         Output=Output+pow(Noms,CDx);
  25.             printf("%d\n%d\n",Output,CDx);
  26.  
  27.         Storage=Storage/10;
  28.         Noms=Storage;
  29.  
  30.  
  31.         CD--;
  32.     }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement