简体   繁体   English

如何显示语句的循环字符?

[英]how can i display loop character for a statement?

how can i display loop character for a statement?如何显示语句的循环字符? the user input the name and computer looping it, and then it stop by a sentinel.用户输入名称和计算机循环它,然后它被一个哨兵停止。 the statement show all of the name that inputted by user.该语句显示用户输入的所有名称。

example: NAME: gaby jessy alicia justin示例: 姓名:gaby jessy alicia justin

Here's some starting code:这是一些起始代码:

#include <iostream>
#include <string>
#include <vector>  

int main()
{
  std::vector<std::string> database;
  std::string name;
  while (std::cin >> name)
  {
    database.push_back(name);
  }
  return 0;
}

The OP needs to add code after the names are read in. OP 需要在读入名称后添加代码。

Note: I didn't add the code because I do not have clear understand of the OP's requirements.注意:我没有添加代码,因为我对 OP 的要求没有清楚的了解。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM