int main()
{
using namespace std;
int x;
int y;
Random:
{
x = rand();
cout << x << endl;
}
y = y + 1;
if (y == 10) {
return 0;
}
goto Random;
}
1 个答案:
答案 0 :(得分:3)
类似的东西:
int main()
{
int randMax;
cin >> randMax;
for (int y = 0; y < 10; y++)
{
int x = rand() % randMax; // Range = [0, randMax)
cout << x+1 << endl; // Range = [1, randMax]
}
}