1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/haolaiwugongsi-good_pollution

В этом репозитории не указан файл с открытой лицензией (LICENSE). При использовании обратитесь к конкретному описанию проекта и его зависимостям в коде.
Клонировать/Скачать
邓俊宁 打牌.cpp 1.2 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
sans Отправлено 25.03.2019 13:39 ae629c1
#include<iostream>
#include<ctime>
#include<cstdlib>
using namespace std;
int main()
{
int i,n,a,b,c,d,x,m,M,r,R;
R=666;
M=123456;
cout<<"输入用户"<<endl;
cin>>r;
cout<<"输入密码"<<endl;
cin>>m;
if(R!=r||M!=m)
cout<<"错误";
else
{
srand(time(0));
a=rand()%15+0;
srand(time(0));
b=rand()%10+0;
srand(time(0));
c=rand()%5+0;
srand(time(0));
d=rand()%2+0;
cout<<"您抽到的牌有:"<<"普通"<<a<<"张"<<"稀有"<<b<<"张"<<"史诗"<<c<<"张"<<"传奇"<<d<<"张"<<endl;
for(i=1; i<=10;i++)
{
srand(time(0));
n=rand()%4+1;
cout<<"请出牌";
cin>>x;
if(x==1)
{
a--;
}
else
if(x==2)
{
b--;
}
else
if(x==3)
{
c--;
}
else
if(x==4)
{
d--;
}
else
cout<<"无此牌"<<endl;
cout<<"现有:"<<"普通"<<a<<"张"<<"稀有"<<b<<"张"<<"史诗"<<c<<"张"<<"传奇"<<d<<"张"<<endl;
if(n==1)
cout<<"普通"<<endl;
else
if(n==2)
cout<<"稀有"<<endl;
else
if(n==3)
cout<<"史诗"<<endl;
else
cout<<"传奇"<<endl;
if(n>x)
cout<<"你输了"<<endl;
else
if(n==x)
cout<<"平"<<endl;
else
cout<<"你赢了"<<endl;
}
}
return 0;
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/haolaiwugongsi-good_pollution.git
git@api.gitlife.ru:oschina-mirror/haolaiwugongsi-good_pollution.git
oschina-mirror
haolaiwugongsi-good_pollution
haolaiwugongsi-good_pollution
master