提问:
又出了另一个错:
```c++ #include <iostream> #include <stdio.h> #include <algorithm> int co = 0; using namespace std; char b[10000000]; int main() { int a[9] = { 1,2,3,4,5,6,7,8,9 }; for (int i = 0; i < 6; i++) ::cout << a[i]; ::cout << endl; while (next_permutation(a, a + 9)) { for (int j=1; j <= 12;j++) { for (int i = 0; i < 6; i++) { ::cout << a[i]; co+1=co; a[i] = b[co]; } switch (j) { co++; case(1): ::cout << "鼠" << endl; "鼠" = b[co + 1];//错误(活动) E0513 不能将 "const char *" 类型的值分配到 "char" 类型的实体 break; case(2): ::cout << "牛" << endl; break; case(3): ::cout << "虎" << endl; break; case(4): ::cout << "兔" << endl; break; case(5): ::cout << "龙" << endl; break; case(6): ::cout << "蛇" << endl; break; case(7): ::cout << "马" << endl; break; case(8): ::cout << "羊" << endl; break; case(9): ::cout << "猴" << endl; break; case(10): ::cout << "鸡" << endl; break; case(11): ::cout << "狗" << endl; break; case(12): ::cout << "猪" << endl; break; } } } return 0; }
解答:
b[co+1]='鼠'
标签:std,co,int,c++,char,关于,解决,include From: https://www.cnblogs.com/dituirenwu/p/17068826.html