使用'\\'进行判断
code:
#include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;
int main(int argc, char *argv[])
{
string s;
cin >> s;
for (auto s1 = s.begin(); s1 != s.end(); ++s1)
{
if (*s1 == '\\')
cout << s1 - s.begin() << endl;
}
return 0;
}