標題:
賽馬程式 (二)
[打印本頁]
作者:
tonyh
時間:
2014-4-12 17:20
標題:
賽馬程式 (二)
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re1:
int a=0, b=0, c=0, d=0, r;
system("cls");
cout<<"「好事成雙」賽馬場"<<endl;
cout<<"------------------------------------------------------------------------| 終點"<<endl;
cout<<"◆"<<endl;
cout<<"★"<<endl;
cout<<"▲"<<endl;
cout<<"●"<<endl;
system("pause");
system("cls");
srand(time(NULL));
while(a!=75 && b!=75 && c!=75 && d!=75)
{
r=rand()%4; //產生0~3之隨機亂數
if(r==0)
a++;
else if(r==1)
b++;
else if(r==2)
c++;
else
d++;
cout<<"比賽進行中"<<endl;
cout<<"------------------------------------------------------------------------| 終點"<<endl;
for(int i=1; i<=a; i++)
cout<<" ";
cout<<"◆"<<endl;
for(int i=1; i<=b; i++)
cout<<" ";
cout<<"★"<<endl;
for(int i=1; i<=c; i++)
cout<<" ";
cout<<"▲"<<endl;
for(int i=1; i<=d; i++)
cout<<" ";
cout<<"●"<<endl;
system("cls");
}
cout<<"比賽結束"<<endl;
cout<<"------------------------------------------------------------------------| 終點"<<endl;
for(int i=1; i<=a; i++)
cout<<" ";
cout<<"◆"<<endl;
for(int i=1; i<=b; i++)
cout<<" ";
cout<<"★"<<endl;
for(int i=1; i<=c; i++)
cout<<" ";
cout<<"▲"<<endl;
for(int i=1; i<=d; i++)
cout<<" ";
cout<<"●"<<endl;
system("pause");
goto re1;
system("pause");
return 0;
}
複製代碼
作者:
張郁庭
時間:
2014-4-12 17:33
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re1:
int a=0, b=0, c=0, d=0, r;
system("cls");
cout<<"﹩財源滾滾賽馬場 ﹩"<<endl;
cout<<"=========================================================================| 終點"<<endl;
cout<<"◢1◤"<<endl;
cout<<"◢2◤"<<endl;
cout<<"◢3◤"<<endl;
cout<<"◢4◤"<<endl;
system("pause");
system("cls");
srand(time(NULL));
while(a!=75 && b!=75 && c!=75 && d!=75)
{
r=rand()%4;
if(r==0)
a++;
else if(r==1)
b++;
else if(r==2)
c++;
else
d++;
cout<<"比賽進行中"<<endl;
cout<<"=========================================================================| 終點"<<endl;
for(int i=1; i<=a; i++)
cout<<" ";
cout<<"◢1◤"<<endl;
for(int i=1; i<=b; i++)
cout<<" ";
cout<<"◢2◤"<<endl;
for(int i=1; i<=c; i++)
cout<<" ";
cout<<"◢3◤"<<endl;
for(int i=1; i<=d; i++)
cout<<" ";
cout<<"◢4◤"<<endl;
system("cls");
}
cout<<"比賽結束"<<endl;
cout<<"------------------------------------------------------------------------| 終點"<<endl;
for(int i=1; i<=a; i++)
cout<<" ";
cout<<"◢1◤"<<endl;
for(int i=1; i<=b; i++)
cout<<" ";
cout<<"◢2◤"<<endl;
for(int i=1; i<=c; i++)
cout<<" ";
cout<<"◢3◤"<<endl;
for(int i=1; i<=d; i++)
cout<<" ";
cout<<"◢4◤"<<endl;
system("pause");
goto re1;
system("pause");
return 0;
}
複製代碼
作者:
張峻瑋
時間:
2014-4-12 17:34
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re1:
int a=0,b=0,c=0,d=0,r;
system("cls");
cout<<"$$ 888賽馬場 $$"<<endl;
cout<<"--------------------------------------------------------------------------│"<<endl;
cout<<"◢1◤"<<endl;
cout<<"◢2◤"<<endl;
cout<<"◢3◤"<<endl;
cout<<"◢4◤"<<endl;
system("pause");
system("cls");
srand(time(NULL));
while(a!=75 && b!=75 && c!=75 && d!=75)
{
r=rand()%4;
if(r==0)
a++;
else if(r==1)
b++;
else if(r==2)
c++;
else
d++;
cout<<"比賽進行中"<<endl;
cout<<"--------------------------------------------------------------------------│終點"<<endl;
for(int i=1;i<=a;i++)
cout<<" ";
cout<<"◢1◤"<<endl;
for(int i=1;i<=b;i++)
cout<<" ";
cout<<"◢2◤"<<endl;
for(int i=1;i<=c;i++)
cout<<" ";
cout<<"◢3◤"<<endl;
for(int i=1;i<=d;i++)
cout<<" ";
cout<<"◢4◤"<<endl;
system("cls");
}
cout<<"比賽結束"<<endl;
cout<<"--------------------------------------------------------------------------│終點"<<endl;
for(int i=1;i<=a;i++)
cout<<" ";
cout<<"◢1◤"<<endl;
for(int i=1;i<=b;i++)
cout<<" ";
cout<<"◢2◤"<<endl;
for(int i=1;i<=c;i++)
cout<<" ";
cout<<"◢3◤"<<endl;
for(int i=1;i<=d;i++)
cout<<" ";
cout<<"◢4◤"<<endl;
system("pause");
goto re1;
system("pause");
return 0;
}
複製代碼
作者:
張彥承
時間:
2014-4-12 17:40
#include<iostream>
#include<cstdlib>
using namespace std;
int main ()
{
re1:
int a=0,b=0,c=0,d=0,r;
system("cls");
cout<<"天觀馬場"<<endl;
cout<<"--------------------------------------------------------------------|終點"<<endl;
cout<<"○"<<endl;
cout<<"※"<<endl;
cout<<"▽"<<endl;
cout<<"◆"<<endl;
system("pause");
system("cls");
srand(time(NULL));
while(a!=75 && b!=75 && c!=75 && d!=75)
{
r=rand()%4;
if(r==0)
a++;
else if(r==1)
b++;
else if(r==2)
c++;
else
d++;
cout<<"比賽進行中"<<endl;
cout<<"--------------------------------------------------------------------|終點"<<endl;
for(int i=1;i<=a;i++)
cout<<" ";
cout<<"○"<<endl;
for(int i=1;i<=b;i++)
cout<<" ";
cout<<"※"<<endl;
for(int i=1;i<=c;i++)
cout<<" ";
cout<<"▽"<<endl;
for(int i=1;i<=d;i++)
cout<<" ";
cout<<"◆"<<endl;
system("cls");
}
cout<<"比賽結束"<<endl;
cout<<"--------------------------------------------------------------------|終點"<<endl;
for(int i=1;i<=a;i++)
cout<<" ";
cout<<"○"<<endl;
for(int i=1;i<=b;i++)
cout<<" ";
cout<<"※"<<endl;
for(int i=1;i<=c;i++)
cout<<" ";
cout<<"▽"<<endl;
for(int i=1;i<=d;i++)
cout<<" ";
cout<<"◆"<<endl;
system("pause");
goto re1;
system("pause");
return 0;
}
複製代碼
作者:
周雍程
時間:
2014-4-12 17:42
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re1:
int a=0, b=0, c=0, d=0, r;
system("cls");
cout<<"$賺大錢賽馬場$"<<endl;
cout<<"------------------------------------------------------------------------│終點"<<endl;
cout<<"◢ 1▋"<<endl;
cout<<"◢ 2▋"<<endl;
cout<<"◢ 3▋"<<endl;
cout<<"◢ 4▋"<<endl;
system("pause");
system("cls");
srand(time(NULL));
while(a!=73 && b!=73 && c!=73 && d!=73)
{
r=rand()%4;
if(r==0)
a++;
else if(r==1)
b++;
else if(r==2)
c++;
else
d++;
cout<<"比賽進行中"<<endl;
cout<<"------------------------------------------------------------------------│終點"<<endl;
for(int i=1; i<=a; i++)
cout<<" ";
cout<<"◢ 1▋"<<endl;
for(int i=1; i<=b; i++)
cout<<" ";
cout<<"◢ 2▋"<<endl;
for(int i=1; i<=c; i++)
cout<<" ";
cout<<"◢ 3▋"<<endl;
for(int i=1; i<=d; i++)
cout<<" ";
cout<<"◢ 4▋"<<endl;
system("cls");
}
cout<<"比賽結束"<<endl;
cout<<"------------------------------------------------------------------------│終點"<<endl;
for(int i=1; i<=a; i++)
cout<<" ";
cout<<"◢ 1▋"<<endl;
for(int i=1; i<=b; i++)
cout<<" ";
cout<<"◢ 2▋"<<endl;
for(int i=1; i<=c; i++)
cout<<" ";
cout<<"◢ 3▋"<<endl;
for(int i=1; i<=d; i++)
cout<<" ";
cout<<"◢ 4▋"<<endl;
system("pause");
goto re1;
system("pause");
return 0;
}
複製代碼
作者:
劉得旗
時間:
2014-4-12 17:43
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re1:
int a=0, b=0, c=0, d=0, r;
cout<<"無聊賽馬場"<<endl;
cout<<"------------------------------------------------------終點"<<endl;
cout<<"@"<<endl;
cout<<"#"<<endl;
cout<<"!"<<endl;
cout<<"%"<<endl;
system("pause");
system("cls");
srand(time(NULL));
while(a!=75 && b!=75 && c!=75 && d!=75)
{
r=rand()%4;
if(r==0)
a++;
else if(r==1)
b++;
else if(r==2)
c++;
else
d++;
cout<<"比賽進行中"<<endl;
cout<<"------------------------------------------------------------------------| 終點"<<endl;
for(int i=1; i<=a; i++)
cout<<" ";
cout<<"@"<<endl;
for(int i=1; i<=b; i++)
cout<<" ";
cout<<"#"<<endl;
for(int i=1; i<=c; i++)
cout<<" ";
cout<<"!"<<endl;
for(int i=1; i<=d; i++)
cout<<" ";
cout<<"%"<<endl;
system("cls");
}
cout<<"比賽結束"<<endl;
{
cout<<"------------------------------------------------------------------------| 終點"<<endl;
for(int i=1; i<=a; i++)
cout<<" ";
cout<<"@"<<endl;
for(int i=1; i<=b; i++)
cout<<" ";
cout<<"#"<<endl;
for(int i=1; i<=c; i++)
cout<<" ";
cout<<"!"<<endl;
for(int i=1; i<=d; i++)
cout<<" ";
cout<<"%"<<endl;
system("pause");
goto re1;
system("pause");
return 0;
}
}
複製代碼
作者:
張郁偵
時間:
2014-4-12 17:45
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re1:
int a=0,b=0,c=0,d=0,r;
system("cls");
cout<<">酷炫賽馬場<"<<endl;
cout<<"=========================================================================|終點"<<endl;
cout<<"∞"<<endl;
cout<<"△"<<endl;
cout<<"◇"<<endl;
cout<<"☆"<<endl;
system("pause");
system("cls");
srand(time(NULL));
while(a!=75 && b!=75 && c!=75 && d!=75)
{
r=rand()%4;
if(r==0)
a++;
else if(r==1)
b++;
else if(r==2)
c++;
else
d++;
cout<<"比賽進行中"<<endl;
cout<<"=========================================================================|終點"<<endl;
for(int i=1; i<=a; i++)
cout<<" ";
cout<<"∞"<<endl;
for(int i=1; i<=b; i++)
cout<<" ";
cout<<"△"<<endl;
for(int i=1; i<=c; i++)
cout<<" ";
cout<<"◇"<<endl;
for(int i=1; i<=d; i++)
cout<<" ";
cout<<"☆"<<endl;
system("cls");
}
cout<<"比賽結束"<<endl;
cout<<"=========================================================================|終點"<<endl;
for(int i=1; i<=a; i++)
cout<<" ";
cout<<"∞"<<endl;
for(int i=1; i<=b; i++)
cout<<" ";
cout<<"△"<<endl;
for(int i=1; i<=c; i++)
cout<<" ";
cout<<"◇"<<endl;
for(int i=1; i<=d; i++)
cout<<" ";
cout<<"☆"<<endl;
system("pause");
goto re1;
system("pause");
return 0;
}
複製代碼
作者:
施伯叡
時間:
2014-4-18 20:18
本帖最後由 施伯叡 於 2014-4-18 20:27 編輯
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re:
int a=0, b=0, c=0, d=0, r ;
system("cls");
cout<<"「穩賺不賠」賽馬場"<<endl;
cout<<"-------------------------------------------------------------------------| 終點"<<endl;
cout<<"★1☆"<<endl;
cout<<"☆2★"<<endl;
cout<<"★3☆"<<endl;
cout<<"☆4★"<<endl;
system("pause");
system("cls");
srand(time(NULL));
while(a!=70 && b!=70 && c!=70 && b!=70)
{
r=rand()%4;
if(r==0)
a++;
else if(r==1)
b++;
else if(r==2)
c++;
else
d++;
cout<<"比賽進行中..."<<endl;
cout<<"-------------------------------------------------------------------------| 終點"<<endl;
for(int i=1; i<=a; i++)
cout<<" ";
cout<<"★1☆"<<endl;
for(int i=1; i<=b; i++)
cout<<" ";
cout<<"☆2★"<<endl;
for(int i=1; i<=c; i++)
cout<<" ";
cout<<"★3☆"<<endl;
for(int i=1; i<=d; i++)
cout<<" ";
cout<<"☆4★"<<endl;
system("cls");
}
cout<<"比賽結束"<<endl;
cout<<"-------------------------------------------------------------------------| 終點"<<endl;
for(int i=1; i<=a; i++)
cout<<" ";
cout<<"★1☆"<<endl;
for(int i=1; i<=b; i++)
cout<<" ";
cout<<"☆2★"<<endl;
for(int i=1; i<=c; i++)
cout<<" ";
cout<<"★3☆"<<endl;
for(int i=1; i<=d; i++)
cout<<" ";
cout<<"☆4★"<<endl;
system("pause");
goto re;
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2