- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int n;
- string name[5]={"香蕉","鳳梨","西瓜","蘋果","蓮霧"};
-
- cout<<"★☆★抽籤程式★☆★"<<endl;
- cout<<"吃什麼水果?"<<endl;
- system("pause");
- system("cls");
-
- srand(time(NULL));
-
- for(int i=1;i<=120;i++)
- {
- n = rand()%5;
- if(i%2==0)
- {
- cout<<"☆★☆為您決定中...☆★☆"<<endl;
- }else
- {
- cout<<"★☆★為您決定中...★☆★"<<endl;
- }
- cout<<name[n]<<endl;
- system("cls");
- }
-
- cout<<"吃:"<<name[n]<<endl<<endl;
-
-
- system("pause");
- return 0;
- }
複製代碼 |