Click here to Skip to main content
15,924,036 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Detect the path where is running an application VC++ Pin
Gaul8-Dec-02 3:28
Gaul8-Dec-02 3:28 
GeneralRe: Detect the path where is running an application VC++ Pin
Ravi Bhavnani8-Dec-02 12:40
professionalRavi Bhavnani8-Dec-02 12:40 
GeneralRe: Detect the path where is running an application VC++ Pin
pranavamhari8-Dec-02 14:39
pranavamhari8-Dec-02 14:39 
GeneralBig Question Pin
abarker047-Dec-02 17:45
abarker047-Dec-02 17:45 
GeneralRe: Big Question Pin
zarzor7-Dec-02 18:16
zarzor7-Dec-02 18:16 
GeneralRe: Big Question Pin
abarker048-Dec-02 4:56
abarker048-Dec-02 4:56 
GeneralRe: Big Question Pin
Christian Graus8-Dec-02 10:54
protectorChristian Graus8-Dec-02 10:54 
GeneralRe: Big Question Pin
zarzor8-Dec-02 11:58
zarzor8-Dec-02 11:58 
Here's what you asked for, assuming that you have Hexium or 80686 processor Roll eyes | :rolleyes: (searching within 30! (i.e 30*29*28..*1) elements):


#include <stdio.h>

int Check(int,int);
main()
 {
  for(int j1=1;j1<31;j1++)
   for(int j2=1;j2<31;j2++){if(j2==j1)continue;
    for(int j3=1;j3<31;j3++){if(j3==j2 || j3==j1)continue;
     for(int j4=1;j4<31;j4++){if(j4==j3 || j4==j2 || j4==j1)continue;
      for(int j5=1;j5<31;j5++){if(j5==j4 || j5==j3 || j5==j2 || j5==j1)continue;
       for(int j6=1;j6<31;j6++){if(j6==j5 || j6==j4 || j6==j3 || j6==j2 || j6==j1)continue;
        for(int j7=1;j7<31;j7++){if(j7==j6 || j7==j5 || j7==j4 || j7==j3 || j7==j2 || j7==j1)continue;
         for(int j8=1;j8<31;j8++){if(j8==j7 || j8==j6 || j8==j5 || j8==j4 || j8==j3 || j8==j2 || j8==j1)continue;
          for(int j9=1;j9<31;j9++){if(j9==j8 || j9==j7 || j9==j6 || j9==j5 || j9==j4 || j9==j3 || j9==j2 || j9==j1)continue;
           for(int j10=1;j10<31;j10++){if(j10==j9 || j10==j8 || j10==j7 || j10==j6 || j10==j5 || j10==j4 || j10==j3 || j10==j2 || j10==j1)continue;
            for(int j11=1;j11<31;j11++){if(j11==j10 || j11==j9 || j11==j8 || j11==j7 || j11==j6 || j11==j5 || j11==j4 || j11==j3 || j11==j2 || j11==j1)continue;
             for(int j12=1;j12<31;j12++){if(j12==j11 || j12==j10 || j12==j9 || j12==j8 || j12==j7 || j12==j6 || j12==j5 || j12==j4 || j12==j3 || j12==j2 || j12==j1)continue;
              for(int j13=1;j13<31;j13++){if(j13==j12 || j13==j11 || j13==j10 || j13==j9 || j13==j8 || j13==j7 || j13==j6 || j13==j5 || j13==j4 || j13==j3 || j13==j2 || j13==j1)continue;
               for(int j14=1;j14<31;j14++){if(j14==j13 || j14==j12 || j14==j11 || j14==j10 || j14==j9 || j14==j8 || j14==j7 || j14==j6 || j14==j5 || j14==j4 || j14==j3 || j14==j2 || j14==j1)continue;
                for(int j15=1;j15<31;j15++){if(j15==j14 || j15==j13 || j15==j12 || j15==j11 || j15==j10 || j15==j9 || j15==j8 || j15==j7 || j15==j6 || j15==j5 || j15==j4 || j15==j3 || j15==j2 || j15==j1)continue;
                 for(int j16=1;j16<31;j16++){if(j16==j15 || j16==j14 || j16==j13 || j16==j12 || j16==j11 || j16==j10 || j16==j9 || j16==j8 || j16==j7 || j16==j6 || j16==j5 || j16==j4 || j16==j3 || j16==j2 || j16==j1)continue;
                  for(int j17=1;j17<31;j17++){if(j17==j16 || j17==j15 || j17==j14 || j17==j13 || j17==j12 || j17==j11 || j17==j10 || j17==j9 || j17==j8 || j17==j7 || j17==j6 || j17==j5 || j17==j4 || j17==j3 || j17==j2 || j17==j1)continue;
                   for(int j18=1;j18<31;j18++){if(j18==j17 || j18==j16 || j18==j15 || j18==j14 || j18==j13 || j18==j12 || j18==j11 || j18==j10 || j18==j9 || j18==j8 || j18==j7 || j18==j6 || j18==j5 || j18==j4 || j18==j3 || j18==j2 || j18==j1)continue;
                    for(int j19=1;j19<31;j19++){if(j19==j18 || j19==j17 || j19==j16 || j19==j15 || j19==j14 || j19==j13 || j19==j12 || j19==j11 || j19==j10 || j19==j9 || j19==j8 || j19==j7 || j19==j6 || j19==j5 || j19==j4 || j19==j3 || j19==j2 || j19==j1)continue;
                     for(int j20=1;j20<31;j20++){if(j20==j19 || j20==j18 || j20==j17 || j20==j16 || j20==j15 || j20==j14 || j20==j13 || j20==j12 || j20==j11 || j20==j10 || j20==j9 || j20==j8 || j20==j7 || j20==j6 || j20==j5 || j20==j4 || j20==j3 || j20==j2 || j20==j1)continue;
                      for(int j21=1;j21<31;j21++){if(j21==j20 || j21==j19 || j21==j18 || j21==j17 || j21==j16 || j21==j15 || j21==j14 || j21==j13 || j21==j12 || j21==j11 || j21==j10 || j21==j9 || j21==j8 || j21==j7 || j21==j6 || j21==j5 || j21==j4 || j21==j3 || j21==j2 || j21==j1)continue;
                       for(int j22=1;j22<31;j22++){if(j22==j21 || j22==j20 || j22==j19 || j22==j18 || j22==j17 || j22==j16 || j22==j15 || j22==j14 || j22==j13 || j22==j12 || j22==j11 || j22==j10 || j22==j9 || j22==j8 || j22==j7 || j22==j6 || j22==j5 || j22==j4 || j22==j3 || j22==j2 || j22==j1)continue;
                        for(int j23=1;j23<31;j23++){if(j23==j22 || j23==j21 || j23==j20 || j23==j19 || j23==j18 || j23==j17 || j23==j16 || j23==j15 || j23==j14 || j23==j13 || j23==j12 || j23==j11 || j23==j10 || j23==j9 || j23==j8 || j23==j7 || j23==j6 || j23==j5 || j23==j4 || j23==j3 || j23==j2 || j23==j1)continue;
                         for(int j24=1;j24<31;j24++){if(j24==j23 || j24==j22 || j24==j21 || j24==j20 || j24==j19 || j24==j18 || j24==j17 || j24==j16 || j24==j15 || j24==j14 || j24==j13 || j24==j12 || j24==j11 || j24==j10 || j24==j9 || j24==j8 || j24==j7 || j24==j6 || j24==j5 || j24==j4 || j24==j3 || j24==j2 || j24==j1)continue;
                          for(int j25=1;j25<31;j25++){if(j25==j24 || j25==j23 || j25==j22 || j25==j21 || j25==j20 || j25==j19 || j25==j18 || j25==j17 || j25==j16 || j25==j15 || j25==j14 || j25==j13 || j25==j12 || j25==j11 || j25==j10 || j25==j9 || j25==j8 || j25==j7 || j25==j6 || j25==j5 || j25==j4 || j25==j3 || j25==j2 || j25==j1)continue;
                           for(int j26=1;j26<31;j26++){if(j26==j25 || j26==j24 || j26==j23 || j26==j22 || j26==j21 || j26==j20 || j26==j19 || j26==j18 || j26==j17 || j26==j16 || j26==j15 || j26==j14 || j26==j13 || j26==j12 || j26==j11 || j26==j10 || j26==j9 || j26==j8 || j26==j7 || j26==j6 || j26==j5 || j26==j4 || j26==j3 || j26==j2 || j26==j1)continue;
                            for(int j27=1;j27<31;j27++){if(j27==j26 || j27==j25 || j27==j24 || j27==j23 || j27==j22 || j27==j21 || j27==j20 || j27==j19 || j27==j18 || j27==j17 || j27==j16 || j27==j15 || j27==j14 || j27==j13 || j27==j12 || j27==j11 || j27==j10 || j27==j9 || j27==j8 || j27==j7 || j27==j6 || j27==j5 || j27==j4 || j27==j3 || j27==j2 || j27==j1)continue;
                             for(int j28=1;j28<31;j28++){if(j28==j27 || j28==j26 || j28==j25 || j28==j24 || j28==j23 || j28==j22 || j28==j21 || j28==j20 || j28==j19 || j28==j18 || j28==j17 || j28==j16 || j28==j15 || j28==j14 || j28==j13 || j28==j12 || j28==j11 || j28==j10 || j28==j9 || j28==j8 || j28==j7 || j28==j6 || j28==j5 || j28==j4 || j28==j3 || j28==j2 || j28==j1)continue;
                              for(int j29=1;j29<31;j29++){if(j29==j28 || j29==j27 || j29==j26 || j29==j25 || j29==j24 || j29==j23 || j29==j22 || j29==j21 || j29==j20 || j29==j19 || j29==j18 || j29==j17 || j29==j16 || j29==j15 || j29==j14 || j29==j13 || j29==j12 || j29==j11 || j29==j10 || j29==j9 || j29==j8 || j29==j7 || j29==j6 || j29==j5 || j29==j4 || j29==j3 || j29==j2 || j29==j1)continue;
                               for(int j30=1;j30<31;j30++){if(j30==j29 || j30==j28 || j30==j27 || j30==j26 || j30==j25 || j30==j24 || j30==j23 || j30==j22 || j30==j21 || j30==j20 || j30==j19 || j30==j18 || j30==j17 || j30==j16 || j30==j15 || j30==j14 || j30==j13 || j30==j12 || j30==j11 || j30==j10 || j30==j9 || j30==j8 || j30==j7 || j30==j6 || j30==j5 || j30==j4 || j30==j3 || j30==j2 || j30==j1)continue;
                                if(Check(j1,j2)&&Check(j2,j3)&&Check(j3,j4)&&
                                   Check(j4,j5)&&Check(j5,j6)&&Check(j6,j7)&&
                                   Check(j7,j8)&&Check(j8,j9)&&Check(j9,j10)&&
                                   Check(j10,j11)&&Check(j11,j12)&&Check(j12,j13)&&
                                   Check(j13,j14)&&Check(j14,j15)&&Check(j15,j16)&&
                                   Check(j16,j17)&&Check(j17,j18)&&Check(j18,j19)&&
                                   Check(j19,j20)&&Check(j20,j21)&&Check(j21,j22)&&
                                   Check(j22,j23)&&Check(j23,j24)&&Check(j24,j25)&&
                                   Check(j25,j26)&&Check(j26,j27)&&Check(j27,j28)&&
                                   Check(j28,j29)&&Check(j29,j30)){
                                    printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d ",
                                      j1,j2,j3,j4,j5,j6,j7,j8,j9,j10,j11,j12,j13,j14,j15,j16,j17,j18,j19,j20,j21,j22,j23,j24,j25,j26,j27,j28,j29,j30);
                                      getchar();
                                      return 0;}
   }}}}}}}}}}}}}}}}}}}}}}}}}}}}}

  printf("\nNo solution!.");
  getchar();
  return 0;
 }
int Check(int x,int y)
 {
  int c=x+y;
  if(c==4 || c==9 || c==16 || c==25 || c==36 || c==49) return 1;
  else return 0;
 }


Zarzor

ZARZOR13
GeneralRe: Big Question Pin
jhwurmbach8-Dec-02 21:51
jhwurmbach8-Dec-02 21:51 
GeneralRe: Big Question Pin
zarzor10-Dec-02 15:27
zarzor10-Dec-02 15:27 
GeneralRe: Big Question..I found it !! Pin
zarzor11-Dec-02 11:56
zarzor11-Dec-02 11:56 
GeneralCString acting weird Pin
IGx897-Dec-02 15:40
IGx897-Dec-02 15:40 
GeneralRe: CString acting weird Pin
Christian Graus7-Dec-02 16:02
protectorChristian Graus7-Dec-02 16:02 
GeneralRe: CString acting weird Pin
IGx897-Dec-02 16:06
IGx897-Dec-02 16:06 
GeneralRe: CString acting weird Pin
Christian Graus7-Dec-02 16:22
protectorChristian Graus7-Dec-02 16:22 
GeneralRe: CString acting weird Pin
carrie8-Dec-02 6:13
carrie8-Dec-02 6:13 
GeneralRe: CString acting weird Pin
IGx898-Dec-02 8:43
IGx898-Dec-02 8:43 
GeneralRe: CString acting weird Pin
Ravi Bhavnani8-Dec-02 12:45
professionalRavi Bhavnani8-Dec-02 12:45 
GeneralRe: CString acting weird Pin
IGx898-Dec-02 13:08
IGx898-Dec-02 13:08 
GeneralRe: CString acting weird Pin
jhwurmbach8-Dec-02 21:56
jhwurmbach8-Dec-02 21:56 
GeneralRe: CString acting weird Pin
IGx899-Dec-02 4:12
IGx899-Dec-02 4:12 
GeneralRe: CString acting weird Pin
jhwurmbach9-Dec-02 4:28
jhwurmbach9-Dec-02 4:28 
QuestionHow to Notify Parent ? Pin
bumper7-Dec-02 12:56
bumper7-Dec-02 12:56 
AnswerRe: How to Notify Parent ? Pin
Nitron7-Dec-02 13:13
Nitron7-Dec-02 13:13 
GeneralRe: How to Notify Parent ? Pin
bumper7-Dec-02 22:59
bumper7-Dec-02 22:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.