- #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<=100;i++)
- {
- n=rand()%5;
- if(i%2==0)
- {
- cout<<"☆★☆抽籤中☆★☆"<<endl;
- }else
- {
- cout<<"★☆★抽籤中★☆★"<<endl;
- }
-
- cout<<name[n]<<endl;
- system("cls");
- }
- cout<<"今天要穿的顏色是:"<<name[n]<<endl;
- system("pause");
- return 0;
- }
複製代碼 |