標題:
賽馬程式 (二)
[打印本頁]
作者:
tonyh
時間:
2013-10-12 14:41
標題:
賽馬程式 (二)
本帖最後由 tonyh 於 2013-10-12 15:25 編輯
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a=0,b=0,c=0,d=0,r;
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)&&(d!=70))
{
r=rand()%4; //產生0~3之隨機亂數
if(r==0)
a++;
if(r==1)
b++;
if(r==2)
c++;
if(r==3)
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");
return 0;
}
複製代碼
作者:
林以諾
時間:
2013-10-12 14:56
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a=0,b=0,c=0,d=0,r;
cout<<"『以諾帥哥』賽馬場!!"<<endl;
cout<<"----------------------------------------------------終點"<<endl;
cout<<"◥1◣"<<endl;
cout<<"◥2◣"<<endl;
cout<<"◥3◣"<<endl;
cout<<"◥4◣"<<endl;
srand(time(NULL));
while((a!=60)&&(b!=60)&&(c!=60)&&(d!=60))
{
r=rand()%4;
if(r==0)
a++;
else if(r==1)
b++;
else if(r==2)
c++;
else
d++;
cout<<"比賽進行中....";
cout<<endl<<"-----------------------------------------------------------|終點"<<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<<"-----------------------------------------------------------|終點"<<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");
return 0;
}
複製代碼
作者:
張瀚仁
時間:
2013-10-12 14:59
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a=0 ,b=0, c=0, d=0,r;
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) && (d!=70))
{
r=rand()%4;
if(r==0)
a++;
else if(r==1)
b++;
else if(r==2)
c++;
else if(r==3)
d++;
cout<<"比賽進行中";
cout<<endl<<"---------------------------------------------------------------------|終點|"<<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<<"比賽結束";
cout<<endl<<"---------------------------------------------------------------------|終點|"<<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");
return 0;
}
複製代碼
作者:
黃柏維
時間:
2013-10-12 15:14
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a=0,b=0,c=0,d=0,r;
cout<<"李奧斯本 賽馬場"<<endl;
cout<<"$-----------------------------------------------------------------||終點||"<<endl;
cout<<"◥1◣"<<endl;
cout<<"◥2◣"<<endl;
cout<<"◥3◣"<<endl;
cout<<"◥4◣"<<endl<<endl;
system("pause");
srand(time(NULL));
while((a!=68)&&(b!=68)&&(c!=68)&&(d!=68))
{
r=rand()%4;
if(r==0)
a++;
if(r==1)
b++;
if(r==2)
c++;
if(r==3)
d++;
cout<<"比賽進行中...";
cout<<endl<<"$-----------------------------------------------------------------||終點||"<<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<<"比賽結束";
cout<<endl<<"$-----------------------------------------------------------------||終點||"<<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");
return 0;
}
複製代碼
作者:
黃崇維
時間:
2013-10-12 15:20
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a=0,b=0,c=0,d=0,r;
cout<<"『玩到爽』賽場"<<endl;
cout<<"-------------------------------------------"<<endl;
cout<<"◥1◣"<<endl;
cout<<"◥2◣"<<endl;
cout<<"◥3◣"<<endl;
cout<<"◥4◣"<<endl;
srand(time(NULL));
while((a!=70)&&(b!=70)&&(c!=70)&&(d!=70))
{
r=rand()%4;
if(r==0)
a++;
else if(r==1)
b++;
else if(r==2)
c++;
else
d++;
cout<<"比賽進行中...";
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<<"--------------------------------------------------|終點"<<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");
return 0;
}
複製代碼
作者:
許逸群
時間:
2013-10-12 15:24
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a=0 ,b=0, c=0, d=0,r;
cout<<"$ 老師同學賽馬場(賭老師的必輸光用看的就知道) $"<<endl;
cout<<"-----------------------------------------------------------------|終點"<<endl;
cout<<"~老師"<<endl;
cout<<"~~~~~逸群"<<endl;
cout<<"~~~~以諾"<<endl;
cout<<"~~~凱言"<<endl;
srand(time(NULL));
while((a!=60)&&(b!=60)&&(c!=60)&&(d!=60))
{
r=rand()%4;
if(r==0)
a++;
else if(r==1)
b++;
else if(r==2)
c++;
else
d++;
cout<<"比賽進行中....";
cout<<endl<<"-----------------------------------------------------------|終點"<<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<<"-----------------------------------------------------------|終點"<<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");
return 0;
}
複製代碼
作者:
郭凡瑛
時間:
2013-10-12 15:33
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a=0 ,b=0, c=0, d=0,r;
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) && (d!=70))
{
r=rand()%4;
if(r==0)
a++;
else if(r==1)
b++;
else if(r==2)
c++;
else if(r==3)
d++;
cout<<"比賽進行中";
cout<<endl<<"---------------------------------------------------------------------|終點|"<<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<<"比賽結束";
cout<<endl<<"---------------------------------------------------------------------|終點|"<<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");
return 0;
}
複製代碼
作者:
劉得旗
時間:
2013-10-12 15:33
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a=0,b=0,c=0,d=0,r;
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)&&(d!=70))
{
r=rand()%4; //產生0~3之隨機亂數
if(r==0)
a++;
if(r==1)
b++;
if(r==2)
c++;
if(r==3)
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");
return 0;
}
複製代碼
作者:
劉泳鱔
時間:
2013-10-12 15:45
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a=0, b=0, c=0, d=0, r;
cout<<"$ 讓你輸光光賽馬場 $"<<endl;
cout<<"-----------------------------------------------------------------|終點"<<endl;
cout<<"◥A◣"<<endl;
cout<<"◥B◣"<<endl;
cout<<"◥C◣"<<endl;
cout<<"◥D◣"<<endl;
system("pause");
srand(time(NULL));
while((a!=70)&&(b!=70)&&(c!=70)&&(d!=70))
{
r=rand()%4;
if(r==0)
a++;
else if(r==1)
b++;
else if(r==2)
c++;
else
d++;
cout<<"比賽進行中";
cout<<endl<<"-----------------------------------------------------------------|終點"<<endl;
for(int i=1; i<=a; i++)
cout<<" ";
cout<<"◥A◣"<<endl;
for(int i=1; i<=b; i++)
cout<<" ";
cout<<"◥B◣"<<endl;
for(int i=1; i<=c; i++)
cout<<" ";
cout<<"◥C◣"<<endl;
for(int i=1; i<=d; i++)
cout<<" ";
cout<<"◥D◣"<<endl;
system("cls");
}
cout<<"比賽結束!";
cout<<endl<<"-----------------------------------------------------------------|終點"<<endl;
for(int i=1; i<=a; i++)
cout<<" ";
cout<<"◥A◣"<<endl;
for(int i=1; i<=b; i++)
cout<<" ";
cout<<"◥B◣"<<endl;
for(int i=1; i<=c; i++)
cout<<" ";
cout<<"◥C◣"<<endl;
for(int i=1; i<=d; i++)
cout<<" ";
cout<<"◥D◣"<<endl;
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2