#include <iostream>
#include <stdlib.h>
using namespace std;
int i;
int e;
int p;
char name[10] = {};
cout<<endl<<"Please enter the letters of your name separated by enter, when you are done, type 'quit' "<<endl;
for (e=0; e <= 10; e++)
{
cin>>name[e];
if (name[e] == 'quit')
{
break;
}
}
for (p=0; p < ; p++)
{
cout<<name[p];
}
return 0;
}
我想讓用戶輸入他們的名字不超過10個字符,但是如果用戶輸入退出,我想結束循環。請幫我解決問題。提前致謝。如何在輸入整數時打破for循環?