#include<bits/stdc++.h>
using namespace std;
int n,m,k,i,j;
bool xxx,yyy;
int main(){
freopen("1.in","w",stdout);
scanf("%lld%lld",&n,&m);
srand((unsigned)time(NULL));
for(i = 1; i <= n; i++){
for(j = 1; j <= m; j++){
char ch;
int abc;
if(!xxx && !yyy){
abc = rand() % 4 + 1;
}else if(!xxx){
abc = rand() % 3 + 1;
}else if(!yyy){
while(abc == 3){
abc = rand() % 4 + 1;
}
}else{
abc = rand() % 2 + 1;
}
if(abc == 3){
xxx = 1;
}else if(abc == 4){
yyy = 1;
}
ch = char(abc + 16);
cout<< ch ;
}
cout<< endl;
}
return 0;
}
为什么运行了这个程序后,我的“1.in”没有任何变化?(freopen那一句我也不太会用,有错误麻烦说一下!)