求字符串长度
namespace myspace {
string a;
int i = 0;
int getlen(){
getline(cin,a);
while (a[i] !='\0') {
i++;
}
return i;
}
}
总结
求字符串长度
namespace myspace {
string a;
int i = 0;
int getlen(){
getline(cin,a);
while (a[i] !='\0') {
i++;
}
return i;
}
}
总结