#include "stdafx.h"
#include <string>
#include <vector>
#include <iostream>
#include <cctype>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
vector<string> strV;
string str;
while (cin.get()!=EOF)
{
cin>>str;
strV.push_back(str);
auto b=strV.begin();
cout<<*b<<endl;
}
}
代碼如上所示
結果如圖所示 ,CSDN為輸入字串,SDN為輸出字串,第一個字符為毛不見了 求大神指點迷津啊 萬分感激
uj5u.com熱心網友回復:
第一個字符cin.get()的時候讀取了,cin>>str就從第二個字符開始了轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/117229.html
標籤:基礎類
上一篇:幫忙看看執行緒Exucute()函式哪里有記憶體泄露?
下一篇:菜鳥求解
