Skip to content

Instantly share code, notes, and snippets.

@kaichao
Last active April 18, 2020 11:21
Show Gist options
  • Save kaichao/b8d0737a1600f288b130fb225e67366c to your computer and use it in GitHub Desktop.
Save kaichao/b8d0737a1600f288b130fb225e67366c to your computer and use it in GitHub Desktop.
oi template

信息学程序模板

#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
    if(freopen("bus.in","r",stdin)==NULL)
        printf("error while opening input file.\n");
    if(freopen("bus.out","w",stdout)==NULL)
        printf("error while opening output file.\n");
    // START of your code
    
    // END of your code
    if(fclose(stdin))
        printf("error while closing input file.\n");
    if(fclose(stdout))
        printf("error while closing output file.\n");
    return 0;
}

信息学程序简化模板

#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
    freopen("bus.in","r",stdin);
    freopen("bus.out","w",stdout);
    // START of your code
    
    // END of your code
    fclose(stdin);
    fclose(stdout);
    return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment