我想我从来没有学过这个.我以前从未这样做过.我见过使用strcat(S1, S2),但这不适用于此,是吗?
我能做点什么吗
string all_possible_strings[10];
char jumbled_chars[] = "ABCDEFG";
all_possible_strings[1] = jumbled_chars[0] << jumbled_chars[1]
<< jumbled_chars[2] << jumbled_chars[3]
<< jumbled_chars[4];
Run Code Online (Sandbox Code Playgroud)
我正在尝试做的是制作一个程序,可以将一个单词解读为所有可能的排列.
#include <iostream>
#include <string>
using namespace std;
int main()
{
string theString = "";
char a = 'a';
char b = 'b';
const char* c = "cdefghijklmnopqrstuvwxyz";
theString += a;
theString += b;
theString += c;
cout << theString;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
这打印出整个字母表.
| 归档时间: |
|
| 查看次数: |
122 次 |
| 最近记录: |