مشکلتون حل شد؟؟؟؟نقل قول:
Printable View
مشکلتون حل شد؟؟؟؟نقل قول:
بله ، تونستیم ، از یک استاد دیگمون پرسیدیم ، جوابمونو داد ، مشکلمون حل شد.
مرسی :11:
[PHP]#include <iostream>
#include <string>
#include <conio.h>
//using namespace std;
void rec (string,string);
int main()
{
cout<<"Enter Your Word:";
string word="";
cin>>word;
rec(word,"");
getch();
}
void rec (string word,string test)
{
if(word.size()==1)
{
cout<<test<<word.at(0)<<endl;
return;
}
else
for(int i=0;i<word.size();i++)
{
if(i!=0 && word.at(i)==word.at(i-1))
continue;
static string test="";
test+=word.at(i);
string temp=word;
temp.erase(temp.begin()+i);
rec(temp,test);
test.resize(test.size()-1);
}
}
[/PHP]