like Input is:
3
1 2
2 3
4 5
我必须以给定样式采用这些输入。这里(1和2),(2和3)和(4和5)必须采取在一个线作为输入。如何使用php命令行在单行中执行多个标准输入
这是我的代码片段。
<?php
header('Content-Type: text/plain');
$testCase = (int) fgets(STDIN);
while($testCase--) {
$myPosition = (int) fgets(STDIN);
$liftPosition = (int) fgets(STDIN);
}
在C实现++
int main()
{
int testcase, myPos, liftPos;
cin >> testcase;
while(testcase--)
{
cin >> myPos >> liftPos;
}
}
那么,怎样才能在PHP中实现C++代码?
这是不是一个C++的问题... – YSC