#include"iostream"
#include "ctime"
using namespace std;
int main()
{
int i;
srand(time(0)); //从零开始?
cout << "信计1131班被抽到的5个同学的序号是" << endl;
for (i = 1; i <= 5; i++)
{
cout << "第" << i << "个人的编号是" << rand() % 33 + 1 << endl;
}
cout << "信计1131班被抽到的5个同学的序号是" << endl;
for (i = 1; i <= 10; i++)
{
cout << "第" << i << "个人的编号是" << rand() % 33 + 34 << endl;
}
cout << "信计1131班被抽到的5个同学的序号是" << endl;
for (i = 1; i <=15; i++)
{
cout << "第" << i << "个人的编号是" << rand() % 29 + 9 << endl;
}
system("pause");
return 0;
}
</pre><pre code_snippet_id="1704763" snippet_file_name="blog_20160601_6_7636477" name="code" class="html">