Re: Programming Puzzle

From: RoSsIaCrIiLoIA (n_at_esiste.ee)
Date: 07/01/04


Date: Thu, 01 Jul 2004 16:14:31 GMT

On Mon, 28 Jun 2004 04:16:52 +0300, Ioannis Vranos wrote:
> > Given an array (group) of numbers write all the possible sub groups of
> > this group.
>std::next_permutation and std::prev_permutation. An example:
>#include <algorithm>
>#include <string>
>#include <iostream>
>
>
>int main()
>{
> using namespace std;
>
> string s="abcd";
>
>
> do
> cout<<s<<endl;
> while(next_permutation(s.begin(), s.end()));
>}

and if
unsigned s={12222, 839939, 9393999, 9099999, 98394763, 89383883};
Next_permutation is ok?
if not for me next_permutation==fuochino, deve essere modificata
esiste una soluzione non ricorsiva



Relevant Pages

  • Re: Programming Puzzle
    ... >int main ... > using namespace std; ... esiste una soluzione non ricorsiva ...
    (comp.lang.c)
  • Re: input and output questions about file
    ... using namespace std; ... junk.c:5: warning: type defaults to `int' in declaration of `std' ... junk.c:10: `string' undeclared ... junk.c:12: parse error before '/' token ...
    (comp.lang.c)
  • Re: Comparing files (Fast)
    ... I didn't knew what is was, but using fseek solved the problem. ... I'm using a timer utility Scott Meyers wrote for use ... > using namespace std; ... > int ch1,ch2; ...
    (comp.lang.cpp)
  • Re: return memory to the OS
    ... > 4 using namespace std; ... > 5 int main ... > possible to make STL return this memory to the OS (say using a system ... :: "out of confusion comes chaos -- out of chaos comes confusion and fear ...
    (comp.lang.cpp)
  • Re: Huge Floating Point Error
    ... using namespace std; ... int main ... floating point math is different from integer math. ...
    (microsoft.public.dotnet.languages.vc)