本帖最後由 tonyh 於 2013-8-31 15:40 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- cout<<"☆★☆ 抽籤程式 1.0 ☆★☆"<<endl<<endl;
- system("pause");
- system("cls");
- string name[]={"泳鱔","白米","得旗","以諾","逸群","瀚仁","鎧言","昱安","崇維","凡瑛","柏維"};
- srand(time(NULL));
- int ball;
- for(int i=1; i<=150; i++)
- {
- if(i%2==0)
- cout<<"☆★☆抽籤中☆★☆"<<endl;
- else
- cout<<"★☆★抽籤中★☆★"<<endl;
- ball=rand()%11;
- cout<<name[ball]<<endl;
- system("cls");
- }
- cout<<"抽到: "<<name[ball]<<"!"<<endl;
- cout<<"請上台表現!"<<endl<<endl;
- system("pause");
- return 0;
- }
複製代碼 |