Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <locale.h>
- using namespace std;
- int fac(int x){
- if ((x==1)||(x==0))
- return 1;
- int y=x*fac(x-1);
- return y;
- }
- int main(void)
- {
- int i, j, a, c;
- for (i=1;i<=6;i++)
- for (j=1;j<=6;j++)
- for (c=1;c<=6;c++){
- a=i*100+j*10+c;
- if ((fac(i)+fac(j)+fac(c))==a)
- cout<<a<<endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment