8.21作业

c++单词逆置

​
#include 
#include 

using namespace std;

namespace myspace {
    void nizhi();
}
void myspace::nizhi()
{
    string str="hello world";
    int s=str.size();
    int i=0,k=0;
    while(1)
    {
    while(str.at(i)!=' ')
    {
        if(i==s-1)
        {
            i=i+1;
            break;
        }
        i++;
    }
    int j=i-1;
    while(k

8.21作业_第1张图片

 

你可能感兴趣的:(c++,算法,开发语言)