- #include<iostream>
- #include<cstdlib>
- #include<ctime>
- using namespace std;
- int main()
- {
- string car[]={"直升機","噴射機","船","飛天魔毯","火車","高鐵"};
- 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<<car[rand()%6]<<"!"<<endl;
- _sleep(50);
- system("cls");
- }
- cout<<"搭: "<<car[rand()%6]<<"!"<<endl<<endl;
- system("pause");
- goto re;
- return 0;
- }
複製代碼 |