#9459: 為何這樣不行,求解


t22639557 (Ted)


#include <iostream>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
string name;
while(cin>>name)
{cin>>name;
cout<<"hello, "<<name<<endl;}




return 0;
}
#9460: Re:為何這樣不行,求解


tammy91668293 (Tammy)


#include

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
string name;
while(cin>>name)
{cin>>name;
cout<<"hello, "<




return 0;
}
你cin了兩次"name"
應該要刪掉其中一個