模拟 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 ...
随机推荐
- OOP思想又一随笔
现有类再有对象, 类:对现实世界事物的抽象表示,包括事物的状态信息(成员变量)和行为信息(成员方法).我们要让我们的计算机程序设计更有意思,也更有逻辑性,则我们的程序中对事物的描叙就必须符合真实情况, ...
- jsp获取sina天气
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding= ...
- 如何删除ini文件中的内容
1.删除子项值:::WritePrivateProfileString(分区名称, 子项名称, "", ini文件路径); 2.删除子项(名称和值):::WritePrivateP ...
- C++文件IO操作的简单示例
CppIODemo1.cpp #include <iostream> #include <fstream> #include <chrono> #define IN ...
- JavaScript数组的某些操作(一)
在软件开发的过程中JavaScript的编程在所难免.当中对数组的操作尤为常见,这里介绍一下和JavaScript数组相关的某些操作: 1.删除并返回数组的第一个元素--shift方法: <!D ...
- (24) java web的struts2框架的使用-action参数自动封装与类型转换
structs可以对参数进行自动封装,做法也很简单. 一,action参数自动封装: 1,可以直接在action类中,声明public的属性,接受参数. 2,属性也是是private,如果是priva ...
- 使用cwRsync在Windows的目录之间增量同步文件
http://www.qiansw.com/using-cwrsync-in-the-windows-directory-between-the-incremental-synchronization ...
- Dom解析XMl文档
XMl文档 <?xml version = "1.0" encoding = "UTF-8"?> <books> <book bo ...
- G.易彰彪的一张表
易彰彪最近有点奇怪,一向爱打游戏他最近居然盯着一张全是大小写字母的表在看,好像在找什么东西.他说,这是他女神给他的一张表,他需要回答女神的问题——在忽略大小写(即大写字母和小写字母视为同一字母)的情况 ...
- model.js
var Model = { inherited: function () {}, created: function () {}, prototype: { init: function (attrs ...