博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
hdoj-5099-Comparison of Android versions
阅读量:6283 次
发布时间:2019-06-22

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

Comparison of Android versions

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1172 Accepted Submission(s): 470
Problem Description
As an Android developer, itˇs really not easy to figure out a newer version of two kernels, because Android is updated so frequently and has many branches. Fortunately, Google identifies individual builds with a short build code, e.g. FRF85B.
The first letter is the code name of the release family, e.g. F is Froyo. The code names are ordered alphabetically. The latest code name is K (KitKat).
The second letter is a branch code that allows Google to identify the exact code branch that the build was made from, and R is by convention the primary release branch.
The next letter and two digits are a date code. The letter counts quarters, with A being Q1 2009. Therefore, F is Q2 2010. The two digits count days within the quarter, so F85 is June 24 2010.
Finally, the last letter identifies individual versions related to the same date code, sequentially starting with A; A is actually implicit and usually omitted for brevity.
Please develop a program to compare two Android build numbers.
Input
The first line is an integer n (1 <= n <= 2000), which indicates how many test cases need to process.
Each test case consists of a single line containing two build numbers, separated by a space character.
Output
For each test case, output a single line starting with ¨Case #: 〃 (# means the number of the test case). Then, output the result of release comparison as follows:
● Print "<" if the release of the first build number is lower than the second one;
● Print "=" if the release of the first build number is same as he second one;
● Print ">" if the release of the first build number is higher than the second one.
Continue to output the result of date comparison as follows:
● Print "<" if the date of the first build number is lower than the second one;
● Print "=" if the date of the first build number is same as he second one;
● Print ">" if the date of the first build number is higher than the second one.
If two builds are not in the same code branch, just compare the date code; if they are in the same code branch, compare the date code together with the individual version.
Sample Input
 
2 FRF85B EPF21B KTU84L KTU84M
Sample Output
 
Case 1: > > Case 2: = <
Source
Recommend
hujie | We have carefully selected several similar problems for you:
#include
#include
int main(){ int tt,ncas=0; scanf("%d",&tt); while(tt--){ ncas++; char s[10],t[10]; scanf("%s%s",s,t); int len1=strlen(s),len2=strlen(t); printf("Case %d: ",ncas); if(s[0]==t[0]){ printf("= "); } else{ if(s[0]>t[0]) printf("> "); else printf("< "); } if(s[1]!=t[1]){ s[len1-1]='\0'; t[len2-1]='\0'; } int temp=strcmp(s+2,t+2); if(temp>0) printf(">"); else if(temp<0) printf("<"); else printf("="); printf("\n"); } return 0;}
#include
#include
int f(char a[]){ int i,res=0; for(i=3;;++i){ if(a[i]>='0'&&a[i]<='9') res=res*10+a[i]-'0'; else return res; }}int main(){ int tt,ncas=0; scanf("%d",&tt); while(tt--){ ncas++; char s[10],t[10]; scanf("%s%s",s,t); int len1=strlen(s),len2=strlen(t); printf("Case %d: ",ncas); if(s[0]==t[0]){ printf("= "); } else{ if(s[0]>t[0]) printf("> "); else printf("< "); } if(s[2]>t[2]) printf(">"); else if(s[2]
"); else printf("<"); } else printf("="); } else if(x>y) printf(">"); else printf("<"); } printf("\n"); } return 0;}

转载地址:http://jsxva.baihongyu.com/

你可能感兴趣的文章
操作系统真实的虚拟内存是什么样的(一)
查看>>
hadoop、hbase、zookeeper集群搭建
查看>>
python中一切皆对象------类的基础(五)
查看>>
modprobe
查看>>
android中用ExpandableListView实现三级扩展列表
查看>>
%Error opening tftp://255.255.255.255/cisconet.cfg
查看>>
java读取excel、txt 文件内容,传到、显示到另一个页面的文本框里面。
查看>>
《从零开始学Swift》学习笔记(Day 51)——扩展构造函数
查看>>
python多线程队列安全
查看>>
[汇编语言学习笔记][第四章第一个程序的编写]
查看>>
android 打开各种文件(setDataAndType)转:
查看>>
补交:最最原始的第一次作业(当时没有选上课,所以不知道)
查看>>
Vue实例初始化的选项配置对象详解
查看>>
PLM产品技术的发展趋势 来源:e-works 作者:清软英泰 党伟升 罗先海 耿坤瑛
查看>>
vue part3.3 小案例ajax (axios) 及页面异步显示
查看>>
浅谈MVC3自定义分页
查看>>
.net中ashx文件有什么用?功能有那些,一般用在什么情况下?
查看>>
select、poll、epoll之间的区别总结[整理]【转】
查看>>
CSS基础知识(上)
查看>>
PHP中常见的面试题2(附答案)
查看>>