#include<cstdio>
#include<iostream>
#include<fstream>
using namespace std;
int tot;
int main(){
    ifstream infile("1.txt",ios::in);//没有不报错 
    infile>>tot;
    cout<<++tot<<endl;//输出到屏幕 
    infile.close();
    ofstream outfile("1.txt",ios::out);
    outfile<<tot;
    outfile.close();
    //用处大大的 
    return 0;
}

 同理

#include<cstdio>
#include<iostream>
using namespace std;
int tot;
int main(){
    freopen("1.in","r",stdin);
    scanf("%d",&tot);
    fclose(stdin);
    freopen("1.in","w",stdout);
    tot++;
    printf("%d",tot);
    fclose(stdout);
    return 0;
}

 

相关文章:

  • 2022-12-23
  • 2021-04-05
  • 2022-12-23
  • 2021-06-18
  • 2022-12-23
  • 2021-10-27
  • 2022-12-23
猜你喜欢
  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2021-12-13
  • 2021-08-29
相关资源
相似解决方案