fork(1) download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <cstdlib>
  4. #include <math.h>
  5. #include <time.h>
  6. using namespace std;
  7.  
  8. int main() {
  9. int dig[9]={1,2,3,4,5,6,7,8,9};
  10. long n1,n2;
  11. srand(time(0));
  12. while(1)
  13. {
  14. n1=100000*dig[0]+10000*dig[2]+1000*dig[4]+100*dig[6]+10*dig[7]+dig[8];
  15. n2=100000*dig[1]+10000*dig[3]+1000*dig[5]+100*dig[4]+10*dig[3]+dig[0];
  16. if(n1+n2==925764)
  17. {
  18. cout<<"TAMING = "<<n1<<endl<<"HELMET = "<<n2<<endl<<endl;
  19. cout<<"IMAGINE = "<<dig[6]<<dig[4]<<dig[2]<<dig[8]<<dig[6]<<dig[7]<<dig[3];
  20. return 0;
  21. }
  22. random_shuffle(&dig[0],&dig[9]);
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0.04s 3460KB
stdin
Standard input is empty
stdout
TAMING = 378921
HELMET = 546843

IMAGINE = 9871924