- #include<iostream>
- #include<cstdlib>
- #include<ctime>
- using namespace std;
- int main()
- {
- string poem[]={ "旅夜書懷",
- "宣州謝脁樓餞別校書叔雲",
- "將進酒",
- "相見歡",
- "虞美人",
- "蘇幕遮",
- "天仙子",
- "浣溪沙(晏殊)",
- "玉樓春",
- "雨霖鈴",
- "水調歌頭",
- "定風波",
- "清平樂",
- "浣溪沙(素觀)",
- "一剪梅",
- "釵頭鳳",
- "青玉案",
- "蒹葭"};
- srand(time(NULL));
- re:
- system("cls");
- cout<<"☆★☆ 抽籤程式 ☆★☆"<<endl;
- cout<<"後測考甚麼?"<<endl<<endl;
- system("pause");
- for(int i=1; i<=30; i++)
- {
- if(i%2==1)
- cout<<"★☆★ 抽籤中 ★☆★"<<endl;
- else
- cout<<"☆★☆ 抽籤中 ☆★☆"<<endl;
- cout<<poem[rand()%18]<<"!"<<endl;
- _sleep(50);
- system("cls");
- }
- cout<<"考: "<<poem[rand()%18]<<"!"<<endl<<endl;
- system("pause");
- goto re;
- return 0;
- }
複製代碼 |