我是靠谱客的博主 鲜艳故事,这篇文章主要介绍python和c++不定行的输入,现在分享给大家,希望可以做个参考。

python:

Input=input()
InputList=[]
while Input!="":
    InputList.append(Input)
    Input=input()

C++:

#include <iostream>
#include <string>
#include <vector>
#include <sstream>
using namespace std;
int main()
{

    string str;
    vector<string> input;
    while (getline(cin, str)) {
        if (str.size() == 0) break;
        input.push_back(str);
        cout<<input.back()<<endl;
    }
}

最后

以上就是鲜艳故事最近收集整理的关于python和c++不定行的输入的全部内容,更多相关python和c++不定行内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(189)

评论列表共有 0 条评论

立即
投稿
返回
顶部