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的更多相关文章

  1. [Educational Codeforces Round 16]E. Generate a String

    [Educational Codeforces Round 16]E. Generate a String 试题描述 zscoder wants to generate an input file f ...

  2. [Educational Codeforces Round 16]D. Two Arithmetic Progressions

    [Educational Codeforces Round 16]D. Two Arithmetic Progressions 试题描述 You are given two arithmetic pr ...

  3. [Educational Codeforces Round 16]C. Magic Odd Square

    [Educational Codeforces Round 16]C. Magic Odd Square 试题描述 Find an n × n matrix with different number ...

  4. [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 ...

  5. [Educational Codeforces Round 16]A. King Moves

    [Educational Codeforces Round 16]A. King Moves 试题描述 The only king stands on the standard chess board ...

  6. Educational Codeforces Round 6 C. Pearls in a Row

    Educational Codeforces Round 6 C. Pearls in a Row 题意:一个3e5范围的序列:要你分成最多数量的子序列,其中子序列必须是只有两个数相同, 其余的数只能 ...

  7. Educational Codeforces Round 9

    Educational Codeforces Round 9 Longest Subsequence 题目描述:给出一个序列,从中抽出若干个数,使它们的公倍数小于等于\(m\),问最多能抽出多少个数, ...

  8. Educational Codeforces Round 37

    Educational Codeforces Round 37 这场有点炸,题目比较水,但只做了3题QAQ.还是实力不够啊! 写下题解算了--(写的比较粗糙,细节或者bug可以私聊2333) A. W ...

  9. 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 ...

  10. 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 ...

随机推荐

  1. (干货)Linux学习资源推荐

    源地址 国内的专业Linux网站(GB) ChinaUnix Linux中国 实验楼: 免费提供了Linux在线实验环境,不用在自己机子上装系统也可以学习Linux,超方便实用!. 国内的专业Linu ...

  2. C盘空间不足,释放C盘空间

    最近电脑总是特别卡,后来发现C盘空间严重不足,只剩下几十兆,以前最严重的时候是剩下0kb可以,怎一个惨字了得... 我所知道的C盘空间不足会导致的几个主要问题有: 1)拷贝大文件会失败.因为拷贝和剪切 ...

  3. Linux环境下Websphere重启

    一.Websphere控制台重启 1.更新class文件发布,Websphere自动重启. 2.更新web.xml发布,需要手动更新web.xml或者更新项目. web.config 缓存位置: We ...

  4. Cocos2d-x中SQLite数据库管理工具

    数据库创建完成后,我们可能需要看看数据库中数据是否成功插入,很多人喜欢使用图形界面工具来管理SQLite数据库.SQLite图形界面管理工具有很多,我推荐使用SQLiteStudio工具,下载地址ht ...

  5. JDK中工具类的使用

    JDK中内置了很多常用的工具类,且多以“s”结尾,如:集合工具类Collections,数组工具类Arrays,对象工具类Objects,文件工具类Files,路径工具类Paths,数学工具类Math ...

  6. C++对象的JSON序列化与反序列化探索完结-列表的序列化与反序列化

    在前两篇文章中,我们已经完成对普通对象以及复杂对象嵌套的序列化与反序列化,见如下地址: C++对象的JSON序列化与反序列化探索 C++对象的JSON序列化与反序列化探索续-复杂对象的序列化与反序列化 ...

  7. win7中CIFS挂载和解挂

    1.win7挂载CIFS共享至Z盘指令(用户名:test,密码:123456): net use Z: \\192.168.8.63\ygcd\duanxiuwei 123456 /USER:test ...

  8. Linux C 程序 文件属性,文件删除(15)

    dup ,dup2,fcntl,ioctl系统调用 . dup ,dup2 函数 int dup(int oldfd) int dup(int oldfd , int newfd) dup用来复制参数 ...

  9. 连接Oracle数据库的OracleHelper.cs

    using System; using System.Configuration; using System.Data; using System.Data.OracleClient; using S ...

  10. Linux 服务器如何修改 DNS

    个人一直用的阿里云的ECS,在配置环境的时候就想着修改一下默认的 DNS,听说阿里云自己的 DNS 速度和稳定性都不错,所以就将默认的 DNS 修改成了阿里云的DNS,并一直稳定使用,下面给出修改方法 ...