if (ch1 = 'l' || 'L')
cout << left;
else if (ch1 = 'r' || 'R')
cout << right;
else
cout << "error" << endl;
cout << setw(++aw) << setfill(char(a)) << s1 << endl;
if (ch2 = 'l' || 'L')
cout << left;
else if (ch2 = 'r' || 'R')
cout << right;
else
cout << "error" << endl;
cout << setw(++bw) << setfill(char(b)) << s2 << endl;
if (ch3 = 'l' || 'L')
cout << left;
else if (ch3 = 'r' || 'R')
cout << right;
else
cout << "error" << endl;
cout << setw(++cw) << setfill(char(c)) << s3 << endl;
return 0;
}
我不确定为什么,但所有 3 条输出线都是左对齐的。对我来说这似乎是合法的,如果某处存在逻辑错误或者我只是输入错误,我不肯定