文件名称:cpp-singleline-array-input:这是一个C ++程序,可以将在运行时输入的以空格分隔的输入元素解析为C ++中的数组,而在编译过程中不需要数组的大小
文件大小:3KB
文件格式:ZIP
更新时间:2024-04-07 03:38:30
cpp python3 single-line-input python-like-list-input-cpp array-without-size-cpp
C ++单行数组解析器 这是一个C ++程序,可以将在运行时输入的以空格分隔的输入元素解析为C ++中的数组,而在编译过程中不需要数组的大小。 重要提示:始终在main()之前包含ListParser类的代码及其必需的header files 。为此,请//代码并创建所需的main() 。 概念 该概念取自python的带变量的动态类型化方法,该方法可以在运行时轻松确定输入是list (C ++中的array )还是其他类型。 这个C++程序将获得与python代码相同的结果: a = input () # takes input >> makes a 'list' size = len ( a ) # gets the size of 'list' print ( a ) # displays the 'list' 和C++代码将是: /* *0* with
【文件预览】:
cpp-singleline-array-input-master
----listparser.cpp(2KB)
----.gitignore(5B)
----README.md(5KB)