#include<iostream>
#include<algorithm>
const int maxn=10;
using namespace std;
int huifu_youxi[maxn];
int rand1[maxn];
int main(){
cout<<"游戏说明:"<<endl;
cout<<"你要输入将要交换的两个数在数组的位置:数组从1开始计数"<<endl;
cout<<"在交换四次完成后若6个数字式由小到大排列的那么成功了,否则失败;" <<endl;
/*
实例:
输出1 3 2 5 4 1
输入:??
??
??
??
输出Yes Yes Yes !!! or No No No !!!
*/
//srand((unsigned)time(NULL));
for(int i=1;i<=6;i++){
huifu_youxi[i]=1+(rand()%9);
cout<<huifu_youxi[i]<<" ";
}
cout<<endl;
cout<<"请输入你要交换的两个数的数组位置,注:只支持数组从1开始计数一共输入三组"<<endl;
for(int i=1;i<=4;i++){
int zuobiao;
int zuobiao2;
cout<<"第"<<i<<"组"<<" "<<endl;
cout<<"第"<<i<<"组的第一个数:";
cin>>zuobiao;
cout<<"第"<<i<<"组的第二个数:";
cin>>zuobiao2;
swap(huifu_youxi[zuobiao],huifu_youxi[zuobiao2]);
}
for(int i=2;i<=6;i++){
int j=i-1;
if(huifu_youxi[i]<huifu_youxi[j]){
system("color 4");
cout<<"No No No !!!";
return 0;
}
}
system("color 2");
cout<<"Yes Yes Yes!!!";
return 0;
}