博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
POJ 2062 HDU 1528 ZOJ 2223 Card Game Cheater
阅读量:6878 次
发布时间:2019-06-26

本文共 1294 字,大约阅读时间需要 4 分钟。

水题,感觉和田忌赛马差不多

#include
#include
#include
#include
using namespace std;struct P1{ int Num; int Hua;} Play1[30];struct P2{ int Num; int Hua;} Play2[30];bool cmp1(const P1&a,const P1&b){ if(a.Num==b.Num) return a.Hua
='0'&&s[0]<='9') num=s[0]-'0'; if(s[0]=='T') num=10; if(s[0]=='J') num=11; if(s[0]=='Q') num=12; if(s[0]=='K') num=13; if(s[0]=='A') num=14; Play1[i].Num=num; if(s[1]=='C') hua=1; if(s[1]=='D') hua=2; if(s[1]=='S') hua=3; if(s[1]=='H') hua=4; Play1[i].Hua=hua; } sort(Play1,Play1+n,cmp1); for(i=0; i
='0'&&s[0]<='9') num=s[0]-'0'; if(s[0]=='T') num=10; if(s[0]=='J') num=11; if(s[0]=='Q') num=12; if(s[0]=='K') num=13; if(s[0]=='A') num=14; Play2[i].Num=num; if(s[1]=='C') hua=1; if(s[1]=='D') hua=2; if(s[1]=='S') hua=3; if(s[1]=='H') hua=4; Play2[i].Hua=hua; } sort(Play2,Play2+n,cmp2); int ans=0; int P=0; for(i=0; i
Play1[i].Num)||(Play2[j].Num==Play1[i].Num&&Play2[j].Hua>Play1[i].Hua)) { ans++; P=j+1;break; } } } printf("%d\n",ans); } return 0;}

 

转载于:https://www.cnblogs.com/zufezzt/p/4677112.html

你可能感兴趣的文章
Android启动页面实现版本检查更新
查看>>
如何在ASP.NET MVC 中获取当前URL、controller、action
查看>>
Freemarket语法
查看>>
Windows7系统中怎么Ping端口?利用telnet命令Ping 端口的方法
查看>>
摩客、墨刀、axure,原型设计工具哪个好用?
查看>>
Flask
查看>>
正确使用lock 关键字
查看>>
虚拟内存管理
查看>>
iOS 10 之后权限设置
查看>>
c++ 函数指针
查看>>
三种vsftp安装方式
查看>>
angular validation 使用总结
查看>>
uwsgi ini 设置
查看>>
node.js中通过stream模块实现自定义流
查看>>
WPF中Image控件的Source属性的设置
查看>>
体绘制(Volume Rendering)概述之4:光线投射算法(Ray Casting)实现流程和代码(基于CPU的实现)...
查看>>
Python实践之(七)逻辑回归(Logistic Regression)
查看>>
PAT (Advanced Level) 1107. Social Clusters (30)
查看>>
POJ 3494 Largest Submatrix of All 1’s
查看>>
Ubuntu系统分配存储空间的建议以及给Ubuntu系统根目录扩容方法(从20GB追加100GB)...
查看>>