使用proc_open()将输入传递给php中的scanf

这是我的php内容

  array("pipe", "w"), 1 => array("pipe", "w"), 2 => array("file", "tmp/error-output.txt", "a") ); $current=$_POST['t1']; $file="hello.cpp"; file_put_contents($file,$current); putenv("PATH=C:\Program Files (x86)\Dev-Cpp\MinGW64\bin"); $process = proc_open('g++ -Wall -o hello hello.cpp', $descriptorspec, $pipes); if (is_resource($process)) { fwrite($pipes[0],"12"); fwrite($pipes[0],"/n"); fwrite($pipes[0],"12"); $answer=shell_exec("hello.exe"); fclose($pipes[0]); $return_value = proc_close($process); } } ?>  .txtarea{ width:300px; height:500px;}  

这里是c程序接受来自proc_open()的输入

 #include int main() { int a,b,c; scanf("%d%d",&a,&b); printf("Addition = %d",(a+b)); return 0; } 

我得到输出为“1”没有得到为什么请帮助我存储变量a和b的输入并显示总和……提前谢谢