OI竞赛中程序文件输入输出格式 C #include <stdio.h> int a,b; int main() { freopen("ex.in","r",stdin); freopen("ex.out","w",stdout); scanf("%d%d",&a,&b); printf("%d\n",a+b); fclose(stdin); fclose(stdout); return 0; } C++ #include <iostream> #include <cstdio> using namespace std; int main() { freopen("ex.in","r",stdin); freopen("ex.out","w",stdout); cin >> a >> b; cout << a+b << endl; fclose(stdin); fclose(stdout); return 0; } Pascal Program ex; var a,b:longint; begin assign(input,'ex.in'); reset(input); assign(output,'ex.out'); rewrite(output); read(a,b); writeln(a+b); close(input); close(output); end.