能不能帮我看一下我用来弄大样例的随机数代码 不知道为什么输出的数总是一样的
#include<bits/stdc++.h>
using namespace std;
int n,a;
char ch;
int main()
{
n=rand();
cout<<n<<endl;
for(int i=1;i<=n;i++)
{
a=rand();
cout<<a<<endl;
for(int j=1;j<=a;j++)
{
ch='a'+rand()%26;
cout<<ch;
}
cout<<" ";
if(rand()%2!=0)
cout<<'Z'<<endl;
else
cout<<'J'<<endl;
}
return 0;
}
玄关