練手筒繁,順路記一下,說不定出車禍忘了呢毡咏?
創(chuàng)建程序如下:
#include <stdio.h>
int main(void)
{
int a,b;
scanf("%d",&a);
scanf("%d",&b);
printf("%d\n",a+b);
return 0;
}
創(chuàng)建輸入文件test.input
如下:
2
4
在shell內(nèi)執(zhí)行
./a.out < test.input
得到結(jié)果:6