假设我们有一个代码:
int main()
{
char a[10];
for(int i = 0; i < 10; i++)
{
cin>>a[i];
if(a[i] == ' ')
cout<<"It is a space!!!"<<endl;
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
如何从标准输入中删除空格符号?如果你写空间,程序会忽略!:(是否有任何符号组合(例如'\ s'或类似的东西),这意味着我可以从我的代码的标准输入中使用"空间"?