freopen

来源:互联网 发布:龙渊网络官网app 编辑:程序博客网 时间:2024/06/09 16:54
#include<stdio.h>
int main()
{
    freopen("in.txt","r",stdin);/*如果in.txt不在连接后的exe的目录,需要指定路径如D:\\in.txt*/
    freopen("out.txt","w",stdout);/*同上*/
    inta,b;
    while(scanf("%d%d",&a,&b)!=EOF)
    printf("%d\n",a+b);
    fclose(stdin);
    fclose(stdout);
    return0;
}
 
freopen("E:\\Context_aware\\sotongTest\\sotongTest\\Debug\\sample_input.txt", "r", stdin);
 
0 0 0 0 0 0 0 0 0
1 0 2 0 1 0 1 0 0
0 2 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0
0 0 0 0 1 0 2 0 0
0 0 0 0 0 0 0 0 0
0 0 2 1 0 0 1 0 0
0 0 1 2 2 0 2 0 0
0 0 0 0 0 0 0 0 0
0 0
原创粉丝点击