带有输入流的在线c++编译器
Online C++ compiler with input stream?
我有点喜欢codepad在线编辑器(支持c++),但我想使用一些codepad不可能的扫描。
是否有一些在线c++编译器支持输入流?这可能吗?
IDEOne支持传入输入;
[免责声明:我更喜欢ideone.com(也有c++0x支持)]
非常迂腐,你可以用这个肮脏的把戏把你的输入塞进源文件:
http://codepad.org/fjtHRgof/* just skip the first two (!!!) lines when reading from t.cpp
602.030024387
423.927317911
520.43881927
131.655014874
35.7455352247
548.735653436
714.556123804
876.948673754
379.105540406
885.096900058
192.734103705
116.365922766
363.998415895
216.268387112
958.684513705
*/ // end of fake input
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
std::ifstream ifs("t.cpp");
std::cout << ifs.rdbuf() << std::flush;
}
Rextester
也有一个输入框,并且有一个比ideone
更有用的界面,我一直觉得CC_3非常笨拙。
Coliru
允许你使用多个文件,所以你可以用你的数据创建一个文件,并做一些像这样输入到你的程序:
g++ -std=c++11 -W -Wall main.cpp && cat /Archive/{{id}}/main.cpp | a.out
注意,LWS
也有一个很好的界面和一个输入框,但已经在read-only
模式一段时间了,现在还不清楚它是否会很快回来,如果有的话。
您可以尝试http://optimizedbits.com。在这里,您还可以通过提供自己的多输入流来编译代码。
对于一个输入流,只需写输入。对于多个输入测试用例,请遵循:
input1
<TESTCASE>
input2
<TESTCASE>
....
关于输入流的可能性:没有人自己构建编译器。每个人在后端都使用一些标准,比如gcc。所有在线编译器网站都围绕一个架构工作,该架构涉及以下流程(例如:c++):
1) read_code_user
2) Save it as variablename.cpp
3) Use a queuing framework. Then execute g++ variablename.cpp. Further, various libraries are utilized which can pipe stdin, stdout and stderr.
试试http://compileonline.com/输入STDIN
相关文章:
- C/C++编译器通常会删除重复的库吗
- 模板-模板参数推导:三个不同的编译器三种不同的行为
- Win32编译器选项和内存分配
- MSVC多行宏编译器错误
- 静态数据成员的问题-修复链接错误会导致编译器错误
- C++,我收到一个无法理解的编译器错误
- 在线编译器中的分段C++没有打印消息
- 如何解决gcc编译器优化导致的centos双编译器设置中的分段错误
- C/C++预处理器是否可以检测一些编译器选项
- 是否有C++编译器选项允许激进地删除所有函数调用,并将参数传递给具有空体的函数
- C++错误C2600:无法定义编译器生成的特殊成员函数(必须首先在类中声明)
- 我需要知道编译器如何在cpp中使用析构函数
- 编译器如何区分std::vector的构造函数
- CLANG 编译器 说:变量"PTR"可能未初始化
- 告诉c++编译器该参数没有别名
- 使用仅使用一次的变量调用的复制构造函数.这可能是通过调用move构造函数进行编译器优化的情况吗
- 为什么所有C++编译器都会崩溃或挂起此代码
- 编译器如何在使用SFINAE的函数和标准函数之间确定两者是否可行
- 我收到同义重复编译器错误。我应该如何修复"类型"X"的参数与类型"X"的参数不兼容?
- 为什么C++编译器没有检测到正确声明的类?