註冊
登錄
論壇
搜索
幫助
導航
私人消息 (0)
公共消息 (0)
系統消息 (0)
好友消息 (0)
帖子消息 (0)
種子論壇 | 高雄市資訊培育協會學員討論區
»
結訓課程 (青少年程式設計班)
»
C++(103-2六)
» 賽馬程式 (二)
返回列表
發帖
發短消息
加為好友
洪振庭
當前離線
UID
67646
帖子
394
精華
0
積分
0
閱讀權限
10
在線時間
103 小時
註冊時間
2014-6-30
最後登錄
2020-1-4
新手上路
1
#
跳轉到
»
洪振庭
發表於 2015-7-11 14:56
|
顯示全部帖子
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,z;
srand(time(NULL));
cout<<"1.Harry Poter "<<endl;
cout<<"2.Ron Weasley "<<endl;
cout<<"3.Cedric Diggory "<<endl;
cout<<"4.Draco Malfoy "<<endl;
cout<<"5.Cho Chang "<<endl;
cout<<"6.Fred Weasley "<<endl;
cout<<"7.George Weasley "<<endl;
cout<<"8.Ginny Weasley "<<endl;
system("pause");
cout<<"Broomstick fling a match of Hogwarts"<<endl;
cout<<"---------------------------------------------------------|win"<<endl;
cout<<"1"<<endl;
cout<<"2"<<endl;
cout<<"3"<<endl;
cout<<"4"<<endl;
cout<<"5"<<endl;
cout<<"6"<<endl;
cout<<"7"<<endl;
cout<<"8"<<endl;
system("pause");
system("cls");
while(a<=65 && b<=65 && c<=65 && d<=65 && e<=65 && f<=65 && g<=65 && h<=65)
{
z=rand()%8+1;
if(z==1)
a++;
else if(z==1)
b++;
else if(z==1)
c++;
else if(z==1)
d++;
else if(z==1)
e++;
else if(z==1)
f++;
else if(z==1)
g++;
else
h++;
cout<<"RUN"<<endl;
cout<<"---------------------------------------------------------|win"<<endl;
for(int i=0;i<=a;i++)
cout<<" "<<endl;
cout<<"1"<<endl;
for(int i=0;i<=b;i++)
cout<<" "<<endl;
cout<<"2"<<endl;
for(int i=0;i<=c;i++)
cout<<" "<<endl;
cout<<"3"<<endl;
for(int i=0;i<=d;i++)
cout<<" "<<endl;
cout<<"4"<<endl;
for(int i=0;i<=e;i++)
cout<<" "<<endl;
cout<<"5"<<endl;
for(int i=0;i<=f;i++)
cout<<" "<<endl;
cout<<"6"<<endl;
for(int i=0;i<=g;i++)
cout<<" "<<endl;
cout<<"7"<<endl;
for(int i=0;i<=h;i++)
cout<<" "<<endl;
cout<<"8"<<endl;
system("cls");
}
cout<<"over"<<endl;
cout<<"---------------------------------------------------------|win"<<endl;
for(int i=0;i<=a;i++)
cout<<" "<<endl;
cout<<"1"<<endl;
for(int i=0;i<=b;i++)
cout<<" "<<endl;
cout<<"2"<<endl;
for(int i=0;i<=c;i++)
cout<<" "<<endl;
cout<<"3"<<endl;
for(int i=0;i<=d;i++)
cout<<" "<<endl;
cout<<"4"<<endl;
for(int i=0;i<=e;i++)
cout<<" "<<endl;
cout<<"5"<<endl;
for(int i=0;i<=f;i++)
cout<<" "<<endl;
cout<<"6"<<endl;
for(int i=0;i<=g;i++)
cout<<" "<<endl;
cout<<"7"<<endl;
for(int i=0;i<=h;i++)
cout<<" "<<endl;
cout<<"8"<<endl;
system("pause");
return 0;
}
複製代碼
TOP
發短消息
加為好友
洪振庭
當前離線
UID
67646
帖子
394
精華
0
積分
0
閱讀權限
10
在線時間
103 小時
註冊時間
2014-6-30
最後登錄
2020-1-4
新手上路
2
#
洪振庭
發表於 2015-7-18 10:59
|
顯示全部帖子
本帖最後由 tonyh 於 2015-7-18 11:22 編輯
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,z;
srand(time(NULL));
cout<<"1.Harry Poter "<<endl;
cout<<"2.Ron Weasley "<<endl;
cout<<"3.Cedric Diggory "<<endl;
cout<<"4.Draco Malfoy "<<endl;
cout<<"5.Cho Chang "<<endl;
cout<<"6.Fred Weasley "<<endl;
cout<<"7.George Weasley "<<endl;
cout<<"8.Ginny Weasley "<<endl;
system("pause");
system("cls");
cout<<"Broomstick fling a match of Hogwarts"<<endl;
cout<<"-----------------------------------------------------------------------|win"<<endl;
cout<<"1"<<endl;
cout<<"2"<<endl;
cout<<"3"<<endl;
cout<<"4"<<endl;
cout<<"5"<<endl;
cout<<"6"<<endl;
cout<<"7"<<endl;
cout<<"8"<<endl;
system("pause");
system("cls");
while(a<=65 && b<=65 && c<=65 && d<=65 && e<=65 && f<=65 && g<=65 && h<=65)
{
z=rand()%8+1;
if(z==1)
a++;
else if(z==2)
b++;
else if(z==3)
c++;
else if(z==4)
d++;
else if(z==5)
e++;
else if(z==6)
f++;
else if(z==7)
g++;
else
h++;
cout<<"RUN"<<endl;
cout<<"-----------------------------------------------------------------------|win"<<endl;
for(int i=0;i<=a;i++)
cout<<" ";
cout<<"1"<<endl;
for(int i=0;i<=b;i++)
cout<<" ";
cout<<"2"<<endl;
for(int i=0;i<=c;i++)
cout<<" ";
cout<<"3"<<endl;
for(int i=0;i<=d;i++)
cout<<" ";
cout<<"4"<<endl;
for(int i=0;i<=e;i++)
cout<<" ";
cout<<"5"<<endl;
for(int i=0;i<=f;i++)
cout<<" ";
cout<<"6"<<endl;
for(int i=0;i<=g;i++)
cout<<" ";
cout<<"7"<<endl;
for(int i=0;i<=h;i++)
cout<<" ";
cout<<"8"<<endl;
system("cls");
}
cout<<"over"<<endl;
cout<<"--------------------------------------------------------------------|win"<<endl;
for(int i=0;i<=a;i++)
cout<<" ";
cout<<"1"<<endl;
for(int i=0;i<=b;i++)
cout<<" ";
cout<<"2"<<endl;
for(int i=0;i<=c;i++)
cout<<" ";
cout<<"3"<<endl;
for(int i=0;i<=d;i++)
cout<<" ";
cout<<"4"<<endl;
for(int i=0;i<=e;i++)
cout<<" ";
cout<<"5"<<endl;
for(int i=0;i<=f;i++)
cout<<" ";
cout<<"6"<<endl;
for(int i=0;i<=g;i++)
cout<<" ";
cout<<"7"<<endl;
for(int i=0;i<=h;i++)
cout<<" ";
cout<<"8"<<endl;
system("pause");
return 0;
}
複製代碼
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,z;
srand(time(NULL));
cout<<"Broomstick fling a match of Hogwarts"<<endl;
cout<<"---------------------------------------------------------|win"<<endl;
cout<<"1"<<endl;
cout<<"2"<<endl;
cout<<"3"<<endl;
cout<<"4"<<endl;
cout<<"5"<<endl;
cout<<"6"<<endl;
cout<<"7"<<endl;
cout<<"8"<<endl;
cout<<endl;
cout<<"1.Harry Poter "<<endl;
cout<<"2.Ron Weasley "<<endl;
cout<<"3.Cedric Diggory "<<endl;
cout<<"4.Draco Malfoy "<<endl;
cout<<"5.Cho Chang "<<endl;
cout<<"6.Fred Weasley "<<endl;
cout<<"7.George Weasley "<<endl;
cout<<"8.Ginny Weasley "<<endl;
cout<<endl;
system("pause");
system("cls");
while(a<=65 && b<=65 && c<=65 && d<=65 && e<=65 && f<=65 && g<=65 && h<=65)
{
z=rand()%8+1;
if(z==1)
a++;
else if(z==2)
b++;
else if(z==3)
c++;
else if(z==4)
d++;
else if(z==5)
e++;
else if(z==6)
f++;
else if(z==7)
g++;
else
h++;
cout<<"RUN"<<endl;
cout<<"---------------------------------------------------------|win"<<endl;
for(int i=0;i<=a;i++)
cout<<" ";
cout<<"1"<<endl;
for(int i=0;i<=b;i++)
cout<<" ";
cout<<"2"<<endl;
for(int i=0;i<=c;i++)
cout<<" ";
cout<<"3"<<endl;
for(int i=0;i<=d;i++)
cout<<" ";
cout<<"4"<<endl;
for(int i=0;i<=e;i++)
cout<<" ";
cout<<"5"<<endl;
for(int i=0;i<=f;i++)
cout<<" ";
cout<<"6"<<endl;
for(int i=0;i<=g;i++)
cout<<" ";
cout<<"7"<<endl;
for(int i=0;i<=h;i++)
cout<<" ";
cout<<"8"<<endl;
system("cls");
}
cout<<"over"<<endl;
cout<<"---------------------------------------------------------|win"<<endl;
for(int i=0;i<=a;i++)
cout<<" ";
cout<<"1"<<endl;
for(int i=0;i<=b;i++)
cout<<" ";
cout<<"2"<<endl;
for(int i=0;i<=c;i++)
cout<<" ";
cout<<"3"<<endl;
for(int i=0;i<=d;i++)
cout<<" ";
cout<<"4"<<endl;
for(int i=0;i<=e;i++)
cout<<" ";
cout<<"5"<<endl;
for(int i=0;i<=f;i++)
cout<<" ";
cout<<"6"<<endl;
for(int i=0;i<=g;i++)
cout<<" ";
cout<<"7"<<endl;
for(int i=0;i<=h;i++)
cout<<" ";
cout<<"8"<<endl;
system("pause");
return 0;
}
複製代碼
TOP
返回列表
C++(五19-21)3F
Python 指導 (家教)
App開發我最棒(週六1600)
Java(五1930)
108 Scratch夏令營(二)
111Python夏令營(一)
C++(五1900)2F
大華國小谷哥人程式研習營
C++(六1330)
Arduino程式創意競賽(智慧淹水)
Java(週二1830)(201810)
109年谷哥人夏令營 (二)
108 APCS夏令營(二)
C++_六1330_202110
C++(六1900)3F
109年Python夏令營 (二)
C++(一1900)(201808)
C++程式設計入門(201302)
我愛Scratch
Python 家教 (詩瑜)
谷哥人營隊
114年國三專班
Python研習營(113-114)
114年Python證照特訓
114年谷哥人程式體驗營
114年APCS冬令營
113Scratch夏令營
Scratch冬令營(113-114)
113年國三專班
Python證照特訓營(113)
113年程式夏令營(一)(二)
113年APCS夏令營(一)(二)
C語言 / C++ (特別輔導)
C++證照
C#
家教/特輔
C語言特輔/證照(家教)
C++證照
C#
HTML5+CSS+JavaScript+PHP+MySQL
Java 家教 (王捷恩)
TQC+資料結構
快樂學 Scratch
Python 家教 (王捷恩 康恒睿)
Python 特別輔導 (家教)
快樂 C++ (家教)
iKnow
我愛 Java (家教)
程式解題我最行 (家教)
程式常態班
C++ 新生挑戰區
考照心得分享
快樂 C++11307週五19:00
快樂C++11309週六13:30-15:30
快樂 C++11403週六1000
快樂 C++11303 (週六15:40-17:40) 3F
程式解題我最行 (週六15:30-17:30) 3F
快樂 C++ (週六13:30-15:30) 3F
快樂 C++ (週六19:00-21:00) 3F
程式解題我最行 (週六10:00-12:00) 3F
快樂學 Scratch
程式解題我最行(週五19:00-21:00)
快樂 C++ (週六13:30-15:30) 3F
程式解題我最行(週三19:15-21:15)
快樂 C++11207週六10
快樂 C++11208週六19:00
程式解題我最行 (週六19:00-21:00) 3F
程式解題我最行 (週四19:10-21:10)
產投職訓
結訓課程 (產投職訓)
Php & MySQL old
Illustrator old
Dreamweaver old
Android手機程式開發班
PHP & MySQL電子商務互動式網站實作班 (102下)
PHP & MySQL (102上)
PHP & MySQL電子商務互動式網站實作班
Photoshop數位影像設計初階
Flash創意廣告動畫初階
行銷短片視訊剪輯
數位商業攝影實務班
PHP & MySQL電子商務系統開發實務初階班
電子商務系統開發實務中階班
Server基礎架設&動態網頁設計初階班
Java視窗應用程式設計與遊戲開發班
Illustrator時尚插畫創作設計初階班
102上Php & MySQL 初階班
電子商務互動式網站實作中階
Dreamweaver多媒體網頁設計
Android手機程式開發班(2012年10月)
PHP & MySQL (2012年10月)
創意塗鴉
yahoo橫幅
google橫幅
市民學苑
第二屆樂活部落格
第一屆電腦設備簡易維護和故障排除班
專案訓練
電子商務創業班
TQC PHP認證
投資理財班
領隊導遊班
電腦基礎及網路應用身心障礙專班
應用軟體網頁化開發
[收藏此主題]
[關注此主題的新回復]
[通過 QQ、MSN 分享給朋友]