不显示你需要的东西,一般我不知道怎么写(
#include <iostream>
#include <string>
using namespace std;
int main()
{
setlocale(LC_ALL, "rus");
string str;
cin >> str;
cout << "Символы: ";
for (int i = 0; i < str.length(); i++) {
while (str[i]){
if (ispunct(str[i])){
cout << "str[" << i << "] = " << str[i] << endl;
}
i++;
}
}
}