posted on 2022-10-18 13:30:17 | under 模板 | source
const char* name="bit";
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;
int cnt=0;
char s[10010];
int main(){
for(int i=1;;i++){
fprintf(stderr,"Test #%d is running...\n",i);
sprintf(s,"%s.mk >%s.in",name,name),system(s);
sprintf(s,"%s <%s.in >%s.out",name,name,name),system(s);
sprintf(s,"%s.bf <%s.in >%s.ans",name,name,name),system(s);
if(sprintf(s,"fc %s.out %s.ans",name,name),system(s)){
sprintf(s,"ren %s.in %s%d.in",name,name,++cnt),system(s);
sprintf(s,"move %s%d.in data",name,cnt),system(s);
sprintf(s,"ren %s.ans %s%d.out",name,name,cnt),system(s);
sprintf(s,"move %s%d.out data",name,cnt),system(s);
// system("pause");
}
}
return 0;
}
标签:cnt,name,system,sprintf,s%,模板,out
From: https://www.cnblogs.com/caijianhong/p/16863436.html