回复 楼主 我要看太阳
#include<iostream>
#include<time.h>
using namespace std;
struct Point{int x;int y;};
int main()
{
int _x,_y;
cout<<"输入随机点横坐标最大值:";cin>>_x;
cout<<"输入随机点纵坐标最大值:";cin>>_y;
srand((unsigned int)time(0));
Point pt[100];
for(int i=0;i<100;i++)
{
pt[i].x=rand()%_x;pt[i].y=rand()%_y;
cout<<pt[i].x<<"/"<<pt[i].y<<endl;
}
return 0;
}