欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來到入門教程網(wǎng)!

C語言

當前位置:主頁 > 軟件編程 > C語言 >

C++實現(xiàn)英文句子中的單詞逆序輸出的方法

來源:本站原創(chuàng)|時間:2020-01-10|欄目:C語言|點擊: 次

本文實例講述了C++實現(xiàn)英文句子中的單詞逆序輸出的方法。分享給大家供大家參考,具體如下:

#include "stdafx.h"
#include <iostream>
#include <string>
#include <stack>
using namespace std;
int main(int arc, char** argv)
{
 string str="I come from liaoning.";
 stack<string> works;
 int len=str.length();
 while(1)
 {
  int start=str.find_first_not_of(" ");
  int end=str.find_first_of(" ");
  int wlen=end-start;
  if(end!=-1)
  {
   string temp=str.substr(start,wlen);
   works.push(temp);
  }
  else
  {
   works.push(str);
   break;
  }
  str=str.substr(end+1,len-wlen);
 }
 while(!works.empty())
 {
  string temp=works.top();
  cout<<temp<<" ";
  works.pop();
 }
 cout<<endl;
 system("pause");
 return 0;
}

運行效果圖如下:

希望本文所述對大家C++程序設(shè)計有所幫助。

上一篇:Opencv光流運動物體追蹤詳解

欄    目:C語言

下一篇:聊一聊OpenCV相機標定

本文標題:C++實現(xiàn)英文句子中的單詞逆序輸出的方法

本文地址:http://mengdiqiu.com.cn/a1/Cyuyan/995.html

網(wǎng)頁制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語言數(shù)據(jù)庫服務(wù)器

如果侵犯了您的權(quán)利,請與我們聯(lián)系,我們將在24小時內(nèi)進行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有