Educational Codeforces Round 5 A
Problem A:http://codeforces.com/contest/616/problem/A
A. Comparing Two Long Integers
果然还是我太天真了(长整数比较不就是long long么........于是一直wa on 9,直到今天起床看了看别人的代码才恍然大悟。。。
#include<stdio.h>
#include<string.h>
const int MAX_N = ; int main(){
char a[MAX_N],b[MAX_N];
int lena,lenb,la,lb,pa=,pb=,i;
scanf("%s%s",a,b);
lena=strlen(a);
lenb=strlen(b);
while(pa<lena&&a[pa]=='') pa++;
while(pb<lenb&&b[pb]=='') pb++;
la=lena-pa;
lb=lenb-pb;
if(la>lb)
printf(">\n");
else if(la<lb)
printf("<\n");
else{
for(i=pa;i<lena;i++){
if(a[i]>b[i-pa+pb]){
printf(">\n");
return ;
}
else if(a[i]<b[i-pa+pb]){
printf("<\n");
return ;
}
}
printf("=\n");
}
return ;
}
Educational Codeforces Round 5 A的更多相关文章
- [Educational Codeforces Round 16]E. Generate a String
[Educational Codeforces Round 16]E. Generate a String 试题描述 zscoder wants to generate an input file f ...
- [Educational Codeforces Round 16]D. Two Arithmetic Progressions
[Educational Codeforces Round 16]D. Two Arithmetic Progressions 试题描述 You are given two arithmetic pr ...
- [Educational Codeforces Round 16]C. Magic Odd Square
[Educational Codeforces Round 16]C. Magic Odd Square 试题描述 Find an n × n matrix with different number ...
- [Educational Codeforces Round 16]B. Optimal Point on a Line
[Educational Codeforces Round 16]B. Optimal Point on a Line 试题描述 You are given n points on a line wi ...
- [Educational Codeforces Round 16]A. King Moves
[Educational Codeforces Round 16]A. King Moves 试题描述 The only king stands on the standard chess board ...
- Educational Codeforces Round 6 C. Pearls in a Row
Educational Codeforces Round 6 C. Pearls in a Row 题意:一个3e5范围的序列:要你分成最多数量的子序列,其中子序列必须是只有两个数相同, 其余的数只能 ...
- Educational Codeforces Round 9
Educational Codeforces Round 9 Longest Subsequence 题目描述:给出一个序列,从中抽出若干个数,使它们的公倍数小于等于\(m\),问最多能抽出多少个数, ...
- Educational Codeforces Round 37
Educational Codeforces Round 37 这场有点炸,题目比较水,但只做了3题QAQ.还是实力不够啊! 写下题解算了--(写的比较粗糙,细节或者bug可以私聊2333) A. W ...
- Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship
Problem Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec P ...
- Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems(动态规划+矩阵快速幂)
Problem Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec P ...
随机推荐
- php学习-快速开发框架thinkphp-day1
以下操作针对windows系统. 1.下载thinkphp3.23-all并解压 官方网站: http://www.thinkphp.cn/down.html 2.开发工具使用phpstorm htt ...
- eclipse 必备
eclipse编辑器太小 http://jingyan.baidu.com/article/fc07f98974f40c12fee51959.html 新建jsp文件报错 http://ji ...
- Nginx+Tomcat实现反向代理与动静分离
1. 什么是动静分离 所谓动静分离就是通过nginx(或apache等)来处理用户端请求的静态页面,tomcat(或weblogic)处理动态页面,从而达到动静页面访问时通过不同的容器来处理. 2. ...
- java 调用bash shell脚本阻塞的小问题的解决
java 调用bash shell脚本阻塞的小问题的解决 背景 使用java实现的web端,web端相应用户的界面操作,使用java调用bash实现的shell脚本进行实际的操作,操作完成返回执行结 ...
- 在swift中使用oc 的代码
就是需要一个桥文件, 方法一:在swift项目中,新建一个oc的类,这时候,会弹出一个对话框,你点默认的那个选项就行了.然后在新生成的桥文件中导入你所需要的oc代码的头文件就行了. 方法二:但是有时候 ...
- Caching和Purgeable Memory (译)
Caching和Purgeable Memory对于开发者来说是一个至关重要的资源,尤其是当我们需要处理那些需要超大内存以及计算时间的对象或者是当计算机向磁盘写入数据时导致应用程序陷入停滞时特别有用处 ...
- log4j定义某个类的日志级别
项目引入了定时任务后,当我把已有的定时任务删除后,控制台一直会打出类似于 [org.springframework.scheduling.quartz.LocalDataSourceJobStore] ...
- 设置图层符号风格为用已有mxd里的同名图层风格
//要加载的IFeatureClass IFeatureClass pFeatClass = dataset as IFeatureClass; //新建要加载到mxd文档中的图层 IFeatureL ...
- 执行插入语句时直接返回插入信息的自增id,判断是否为空
insert into userinfo(UserName,UserPass,RegTime,email)values('a','b',GETDATE(),'123@qq.com');select @ ...
- Android Activity 注意笔记
图1:Activity生命周期的简化图,就像一个阶梯金字塔.这图像表明每个状态中是怎么样使用回调函数使得恢复状态回到顶端,或者降低状态到达底部.Activity可以从Paused状态和stopped状 ...