正在加载图片...
StandIo Example #include"stdafx. h #include <string> #include<iostream> using namespace std int main(int argc, TCHAR*argyI string in g strins 8 Plz enter you name: JOY cout<<" Plz enter you name hello, joY Press any key to continue cin>>in string if(in string. empty cerr<<" error: input string is empty! In else cout<< hello, <<in string <<!n return 0:StandIO Example #include "stdafx.h" #include <string> #include<iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { string in_string ; cout<<"Plz enter you name:"; cin>>in_string; if(in_string.empty()) cerr<<"error:input string is empty!\n "; else cout<<“hello, ”<<in_string<<“!\n"; return 0; } Plz enter you name:JOY hello, JOY! Press any key to continue . .
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有