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/07/11 05:12:25
![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](/uploads/image/z/7777562-50-2.jpg?t=1.Implement+a+C%2B%2B+program+which+reads+any+integer+from+a+user+until+he+or+she+enters+%E2%80%98end%E2%80%99.This+program+must+show+all+of+the+numbers+which+are+read+from+a+keyboard+after+%E2%80%98end%E2%80%99+is+read.2.Make+a+C%2B%2B+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
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