下午写了二个随机产生的代码,好像只有第二个才与ARMA3的随机脚本的逻辑分析相符【第一个(#include<iostream>
#include <stdlib.h>
#include <string>
#include <time.h>
using namespace std;
int main()
{
string c;
srand(
time(0));
while (1)
for (int i = 0; i < 10; i++)
{
cout << rand() % 55 << endl;
system("pause");
}
}),第二个则是(#include<iostream>
#include <stdlib.h>
#include <string>
#include <time.h>
using namespace std;
int main()
{
string c;
srand(
time(0));
while (1)
for (int i = 0; i < 10; i++)
{
switch (rand() % 4)
{
case 0:
c = "ren";
break;
case 1:
c = "gui";
break;
case 2:
c = "shen";
break;
case 3:
c = "xian";
break;
}
cout << "第" << i << "次生成: c = " << c << endl;
system("pause");
}
})