# include<string>
# include<iostream>
using namespace std;
int main()
{
string s;
while(cin>>s)
cout<<s[s.size()]<<endl;
return 0;
}
上面这段程序,在VC和C-free中运行正确,而在VS中运行则出错!
你知道其中的缘由吗?
# include<string>
# include<iostream>
using namespace std;
int main()
{
string s;
while(cin>>s)
cout<<s[s.size()]<<endl;
return 0;
}
上面这段程序,在VC和C-free中运行正确,而在VS中运行则出错!
你知道其中的缘由吗?