1.Implement a C++ program which reads any integer from a user until he or she enters ‘end’.This program must show all of the numbers which are read from a keyboard after ‘end’ is read.2.Make a C++ program which concatenates two strings.Those
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/18 20:27:08
1.Implement a C++ program which reads any integer from a user until he or she enters ‘end’.This program must show all of the numbers which are read from a keyboard after ‘end’ is read.2.Make a C++ program which concatenates two strings.Those
1.Implement a C++ program which reads any integer from a user until he or she enters ‘end’.This program must show all of the numbers which are read from a keyboard after ‘end’ is read.
2.Make a C++ program which concatenates two strings.Those strings are read from a user.This program should read which string goes first,as well.The concatenation process should be done not in the main function,but in another function you declare.You must not use strcat( ).
1.Implement a C++ program which reads any integer from a user until he or she enters ‘end’.This program must show all of the numbers which are read from a keyboard after ‘end’ is read.2.Make a C++ program which concatenates two strings.Those
1.Implement a C++ program which reads any integer from a user until he or she enters ‘end’.This program must show all of the numbers which are read from a keyboard after ‘end’ is read.
#include
#include
#include
using namespace std;
bool is_number(string s)
{
for (size_t i = 0; i < s.size(); i++)
{
if (s[i] < '0' || s[i] > '9')
return false;
}
return true;
}
int main()
{
string s;
vector v;
while (cin >> s)
{
if (s == "end")
{
for (size_t i = 0; i < v.size(); i++)
{
cout a >> b;
c = concatenate(a,b);
cout