![]() |
#2
rjsp2012-10-17 22:04
|

#include <iostream>
#include <string.h>
using namespace std;
int main()
{
int j,time;
cin>>time;
for (j=0; j<time; j++)
{
string str;
getline(cin, str);
cout<<str<<endl;
}
return 0;
}
为什么当循环次数为3时,只能输入两次???#include <string.h>
using namespace std;
int main()
{
int j,time;
cin>>time;
for (j=0; j<time; j++)
{
string str;
getline(cin, str);
cout<<str<<endl;
}
return 0;
}
还有输入下面会留一大段空白。
如:
3
asa
asa
sas
sas
Press any key to continue.
这个空白是怎么回事??