Go4Expert Founder
17Nov2006,18:24   #11
shabbir's Avatar
They will appear once on a page. You will see it on the seventh post of the thread.
Newbie Member
18Dec2006,10:14   #12
insamd's Avatar
hey guys,

Was just interested if with the GCD function if its possible to find the GCD of 3 different numbers rather than just 2? Would be interested to see it.

Thanks
Go4Expert Member
27Dec2006,13:13   #13
BlasterBlang's Avatar
helloo
Light Poster
17Jul2007,13:59   #14
sharma_atul13's Avatar
liked the way to do manipulations done in LCM and GCD programs
Ambitious contributor
22Jul2007,15:03   #15
clocking's Avatar
hi everyone!
I have code following:
You see and shift it
Code:
struct ths
{
  char ht[24];
  char tt[21];
  int sobd;
  float m,l,;
};
class ts
{
   private:
    int sots;
    ths *ts;
  public:
   ts()
   {
    sots = 0 ;
    ts = NULL;
   }
void swap();
};

void ts::swap()
{
  int n = sots;
  for ( int i = 1; i < n; ++i)
  for (int j = i + 1; j <= n; ++j)
  if (ts[i].m < ts[j].m)
  {
     ths tmp = ts[i];
     ts[i] = ts[j];
     ts[j] = tg;
  }
}
// thanks.

Last edited by shabbir; 22Jul2007 at 19:57.. Reason: Code block - http://www.go4expert.com/forums/misc.php?do=bbcode#code
Go4Expert Founder
22Jul2007,20:00   #16
shabbir's Avatar
Offtopic comment:
Use code tag ([ code][/code ]) when you have code snippets in the post.
Ambitious contributor
23Jul2007,07:10   #17
clocking's Avatar
Quote:
Originally Posted by shabbir
Offtopic comment:
Use code tag ([ code][/code ]) when you have code snippets in the post.
Thanks so much, my friend!
this is code in C++, how do you see ?
ofcourse, Class in C++ is difficult.
What way do you help me to express easy?
Ambitious contributor
23Jul2007,07:15   #18
clocking's Avatar
hi everybody!
Follow you, Can we do in swap 2 structs easier?
Code:
tmp = ts[i] ;
ts[i] = ts[j];
ts[j] = tmp;
thanks.
Go4Expert Founder
23Jul2007,08:28   #19
shabbir's Avatar
You can swap the struct if they are addresses and not the objects can be done in that way unless they have the overloaded = operator.
Ambitious contributor
23Jul2007,12:49   #20
clocking's Avatar
thank, but can we do easier for it ?
not tmp.