梭哈用C++怎么写

来源:百度知道 编辑:UC知道 时间:2024/06/02 08:31:31

自己网上找一个去

#include<iostream>
#include<time.h>

using namespace std;
class Method
{public:
int t;
void sort(int a[],int b[]);
//void order(int Y[],int X[]);
void type(int X[],int Y[]);
void compare(int X[],int Y[],int P[],int Q[],int c,int d);
void name(int Y[],int Z[]);
};
void Method::sort(int a[],int b[])
{ /*每个数组元素都和其后面的各个数组元素比较,将小的元素与大的交换(数字排列)*/
for(int i=0;i<5;i++)
{
for(int j=i+1;j<5;j++)
{
if(a[j]<a[i])
{
/*数字交换*/
int temp;
temp=a[i];
a[i]=a[j];
a[j]=temp;
/*牌色随着数字交换*/
int temp1;
temp1=b[i];
b[i]=b[j];
b[j]=temp1;
}
}
}
/*每个