Guest User

Untitled

a guest
Dec 17th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <locale.h>
  3.  
  4. using namespace std;
  5.  
  6. int fac(int x){
  7. if ((x==1)||(x==0))
  8. return 1;
  9. int y=x*fac(x-1);
  10. return y;
  11. }
  12.  
  13. int main(void)
  14. {
  15. int i, j, a, c;
  16.  
  17. for (i=1;i<=6;i++)
  18. for (j=1;j<=6;j++)
  19. for (c=1;c<=6;c++){
  20. a=i*100+j*10+c;
  21. if ((fac(i)+fac(j)+fac(c))==a)
  22. cout<<a<<endl;
  23. }
  24.  
  25. return 0;
  26. }
Add Comment
Please, Sign In to add comment