標題:
抽籤程式 (一)
[打印本頁]
作者:
tonyh
時間:
2020-1-31 20:35
標題:
抽籤程式 (一)
發揮創意想想看, 抽籤程式在日生活中甚麼時候可以派上用場呢?
(ex. 要吃什麼、誰掃廁所、玩遊戲輸了做什麼處罰...)
抽籤程式.exe
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string food[]={"漢堡","牛排","羊肉爐","意麵","大便","餿水"};
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<<food[rand()%6]<<"!"<<endl;
_sleep(50);
system("cls");
}
cout<<"吃: "<<food[rand()%6]<<"!"<<endl<<endl;
system("pause");
goto re;
return 0;
}
複製代碼
作者:
林政瑜
時間:
2020-1-31 20:49
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string food[]={"防腐劑","農藥","毒藥","肥料","大便","餿水"};
srand(time(NULL));
re:
system("cls");
cout<<"☆★☆ 抽籤程式 ☆★☆"<<endl;
cout<<"今天晚餐\吃什麼?"<<endl<<endl;
system("pause");
for(int i=1; i<=50; i++)
{
if(i%2==1)
cout<<"★☆★ 抽籤中 ★☆★"<<endl;
else
cout<<"☆★☆ 抽籤中 ☆★☆"<<endl;
cout<<food[rand()%6]<<"!"<<endl;
_sleep(50);
system("cls");
}
cout<<"吃: "<<food[rand()%6]<<"!"<<endl<<endl;
system("pause");
goto re;
return 0;
}
複製代碼
作者:
陳宥穎
時間:
2020-1-31 20:50
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string food[]={"漢堡","牛排","羊肉爐","意麵","大便","餿水"};
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<<food[rand()%6]<<"!"<<endl;
_sleep(50);
system("cls");
}
cout<<"吃: "<<food[rand()%6]<<"!"<<endl<<endl;
system("pause");
goto re;
return 0;
}
複製代碼
作者:
孫嘉駿
時間:
2020-1-31 20:51
本帖最後由 孫嘉駿 於 2020-2-7 09:32 編輯
#include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
int main()
{
string food[]={"焗烤飯","牛排","義大利麵","排骨酥麵","拉麵","雞腿飯"};
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<<food[rand()%6]<<"!"<<endl;
_sleep(50);
system("cls");
}
cout<<"吃: "<<food[rand()%6]<<"!"<<endl<<endl;
system("pause");
goto re;
return 0;
}
複製代碼
作者:
李宇澤
時間:
2020-1-31 20:52
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string food[]={"燴飯","牛排","一隻羊","義大利麵","屎",";亡水"};
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<<food[rand()%6]<<"!"<<endl;
_sleep(50);
system("cls");
}
cout<<"吃: "<<food[rand()%6]<<"!"<<endl<<endl;
system("pause");
goto re;
return 0;
}
複製代碼
作者:
蔡忻霓
時間:
2020-1-31 20:56
#include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
int main()
{
string food[]={"TWICE","GOT7","Red Velvet","BTS","BlackPink","EXO"};
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<<food[rand()%6]<<"!"<<endl;
_sleep(50);
system("cls");
}
cout<<"like: "<<food[rand()%6]<<"!"<<endl<<endl;
system("pause");
goto re;
return 0;
}
複製代碼
作者:
董宸佑
時間:
2020-1-31 20:58
#include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
int main()
{
srand(time(NULL));
string f[]={"空氣","大便","杯子","盤子","湯匙"};
cout<<"☆★☆ 抽籤程式 ☆★☆"<<endl<<endl;
cout<<"今天晚餐\吃什麼?"<<endl<<endl;
system("pause");
for(int i=0; i<=30; i++)
{
if(i%2==1)
cout<<"★☆★ 抽籤中 ★☆★"<<endl;
else
cout<<"☆★☆ 抽籤中 ☆★☆"<<endl;
cout<<f[rand%6]<<"!"<<endl;
_sleep(50);
system("cls");
}
cout<<"吃"<<f[rand%6]<<"!"<<endl<<endl;
system("pause");
return 0;
}
複製代碼
作者:
黃宥華
時間:
2020-2-7 12:20
#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;
}
複製代碼
作者:
黃辰昊
時間:
2020-2-7 18:46
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string food[]={"漢堡","牛排","羊肉爐","意麵","大便","餿水"};
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<<food[rand()%6]<<"!"<<endl;
_sleep(50);
system("cls");
}
cout<<"吃: "<<food[rand()%6]<<"!"<<endl<<endl;
system("pause");
goto re;
return 0;
}
複製代碼
作者:
余有晉
時間:
2020-2-12 12:00
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string food [6]={"漢堡排","羊肉爐","意麵","大便","餿水","蛋餅"};
srand(time(NULL));
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<<food[rand()%6]<<"!"<<endl<<endl;
_sleep(50);
system("cls");
}
cout<<food[rand()%6]<<"!"<<endl<<endl;
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2