標題:
抽籤程式 (一)
[打印本頁]
作者:
may
時間:
2021-1-23 10:35
標題:
抽籤程式 (一)
發揮創意想想看, 抽籤程式在日生活中甚麼時候可以派上用場呢?
(ex. 要吃什麼、誰掃廁所、玩遊戲輸了做什麼處罰...)
抽籤程式.exe
作者:
may
時間:
2021-1-23 10:38
#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;
}
複製代碼
作者:
許洧熏
時間:
2021-1-23 20:03
[attach]11265[/attach]
作者:
林鼎傑
時間:
2021-1-23 20:58
#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()%8]<<"!"<<endl;
_sleep(50);
system("cls");
}
cout<<"吃: "<<food[rand()%8]<<"!"<<endl<<endl;
system("pause");
goto re;
return 0;
}
複製代碼
作者:
黃子倢
時間:
2021-1-23 20:58
#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;
}
複製代碼
作者:
朱奕祐
時間:
2021-1-23 20:58
本帖最後由 朱奕祐 於 2021-1-23 21:01 編輯
#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;
}
複製代碼
作者:
余柏緯
時間:
2021-1-23 20:59
本帖最後由 余柏緯 於 2021-1-26 14:22 編輯
#include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
int main()
{
string food[]={"焗烤","牛排","滷肉飯","粥","漢堡","炸雞"};
srand(time(NULL));
re:
system("cls");
cout<<"□■□抽籤程式 □■□"<<endl;
cout<<"今天晚餐\吃什麼?"<<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;
}
複製代碼
作者:
王秉鈞
時間:
2021-1-23 21:02
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
string play[]={"打球","打電動","玩積木"}
system("pause");
return 0;
}
複製代碼
作者:
呂尚霖
時間:
2021-1-25 09:54
#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;
}
複製代碼
作者:
許洧熏
時間:
2021-1-30 07:31
#include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
int main()
{
string f[]={"雞","豬","牛","羊","藥","鍋"};
srand(time(NULL));
re:
system("cls");
cout<<"*** 抽籤 ***"<<endl;
cout<<"今天晚餐\吃什麼?"<<endl<<endl;
system("pause");
for(int y=1; y<=30; y++)
{
if(y%2==1)
cout<<" ★☆★抽籤ing ★☆★"<<endl;
else
cout<<" ☆★☆抽籤ing ☆★☆"<<endl;
cout<<f[rand()%6]<<"!"<<endl;
_sleep(50);
system("cls");
}
cout<<"吃: "<<f[rand()%6]<<"!"<<endl<<endl;
system("pause");
goto re;
return 0;
}
複製代碼
作者:
許洧熏
時間:
2021-1-30 19:47
#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;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2