模拟 HDOJ 5099 Comparison of Android versions
/*
题意:比较型号的大小
模拟:坑点在长度可能为5,此时设为'A'
*/
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <ctime>
#include <cstdlib>
using namespace std; const int MAXN = 1e4 + ;
const int INF = 0x3f3f3f3f;
char s1[], s2[]; char check(void)
{
for (int i=; i<=; ++i)
{
if (s1[i] < s2[i]) return '<';
else if (s1[i] > s2[i]) return '>';
} if (s1[] == s2[])
{
if (s1[] == '\0') s1[] = 'A';
if (s2[] == '\0') s2[] = 'A';
if (s1[] < s2[]) return '<';
else if (s1[] > s2[]) return '>';
} return '=';
} int main(void) //HDOJ 5099 Comparison of Android versions
{
//freopen ("J.in", "r", stdin); int t, cas = ; scanf ("%d", &t);
while (t--)
{
scanf ("%s%s", s1, s2);
char ch1 = (s1[] == s2[]) ? '=' : (s1[] < s2[]) ? '<' : '>';
char ch2 = check ();
printf ("Case %d: %c %c\n", ++cas, ch1, ch2);
} return ;
} /*
Case 1: > >
Case 2: = <
*/
模拟 HDOJ 5099 Comparison of Android versions的更多相关文章
- HDOJ 5099 Comparison of Android versions 坑题
现场赛的时候错了十四次. . ... Comparison of Android versions Time Limit: 2000/1000 MS (Java/Others) Memory L ...
- HDU5099——Comparison of Android versions(简单题)(2014上海邀请赛重现)
Comparison of Android versionsProblem DescriptionAs an Android developer, itˇs really not easy to fi ...
- Comparison of Android versions(strcmp的应用)
Description As an Android developer, itˇs really not easy to figure out a newer version of two kerne ...
- hdoj-5099-Comparison of Android versions
Comparison of Android versions Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (J ...
- Chrome模拟手机浏览器(iOS/Android)的三种方法,亲测无误!
大网站都有推出自己的手机访问版本页面,不管是新闻类还是视频网站,我们在电脑是无法直接访问到手机网站的,比如我经常访问一个3g.qq.com这个手机站点,如果在电脑上直接打开它,则会跳转到其它页面,一般 ...
- 用Fiddler可以设置浏览器的UA 和 手动 --Chrome模拟手机浏览器(iOS/Android)的三种方法,亲测无误!
附加以一种软件的方法是:用Fiddler可以设置浏览器的UA 以下3种方法是手动的 通过伪装User-Agent,将浏览器模拟成Android设备. 第一种方法:新建Chrome快捷方式 右击桌面上的 ...
- 模拟 HDOJ 5095 Linearization of the kernel functions in SVM
题目传送门 /* 题意:表达式转换 模拟:题目不难,也好理解题意,就是有坑!具体的看测试样例... */ #include <cstdio> #include <algorithm& ...
- 模拟 HDOJ 5387 Clock
题目传送门 /* 模拟:这题没啥好说的,把指针转成角度处理就行了,有两个注意点:结果化简且在0~180内:小时13点以后和1以后是一样的(24小时) 模拟题伤不起!计算公式在代码内(格式:hh/120 ...
- 模拟 HDOJ 4552 Running Rabbits
题目传送门 /* 模拟:看懂题意,主要是碰壁后的转向,笔误2次 */ #include <cstdio> #include <algorithm> #include <c ...
随机推荐
- LeetCode(11)题解: Container With Most Water
https://leetcode.com/problems/container-with-most-water/ 题目: Given n non-negative integers a1, a2, . ...
- Android实现RecyclerView的下拉刷新和上拉载入很多其它
需求 先上效果图, Material Design风格的下拉刷新和上拉载入很多其它. 源代码地址(欢迎star) https://github.com/studychen/SeeNewsV2 假设对于 ...
- PCH in Xcode 6
本文转载至 http://blog.csdn.net/wbdwsqwwn/article/details/40476151 新建文件 ⌘+N 选择 iOS/Mac -> Other -> ...
- hadoop rsync
1 rsync用来同步配置文件 rsync用来同步两个文件夹,它拷贝的是二者的差异,因此速度很快.在hadoop脚本中,rsync用来同步配置文件. 2 HADOOP_SLAVE_SLEEP的用途 大 ...
- MySQL的简单优化
一.如何发现需要优化的SQL 主要使用MySQL的慢查日志对有效率问题的SQL进行监控 第一步:启动慢查日志的监控 打开开关,将未使用索引的查询记录到慢查日志中 设置查询时间,当查询时间大于这个值,就 ...
- [翻译]理解Unity的自动内存管理
当创建对象.字符串或数组时,存储它所需的内存将从称为堆的中央池中分配.当项目不再使用时,它曾经占用的内存可以被回收并用于别的东西.在过去,通常由程序员通过适当的函数调用明确地分配和释放这些堆内存块.如 ...
- map数据的分组,list数据排序 数据筛选
sfit0144 (李四) 2015-01-10 18:00:251Sfit0734 (Sfit0734) 2015-01-10 18:00:38go homesfit0144 (李四) 2015-0 ...
- java如何判断字符串是否为空(小知识)
方法一: 最多人使用的一个方法, 直观, 方便, 但效率很低: if(s == null ||"".equals(s));方法二: 比较字符串长度, 效率高, 是我知道的最好一个方 ...
- EOS智能合约为何选择Web Assembly(wasm)
比特币的程序非常简单,由解锁脚本和锁定脚本构成.以太坊有智能合约,有图灵完备的虚拟机EVM,但是指令也相对简单,且自成一套.这两种程序本质上都是脚本程序,即由程序翻译指令并执行,而不是由本地机器CPU ...
- (转)windows下的Expdp、Impdp使用
1 .Expdp windows下导出截图示范 2.impdp windows下导入截图示范 Impdp system/eas directory=EASBAK dumpfile=stjt_10060 ...