Educational Codeforces Round 5 A
来源:互联网 发布:php数组转化成json 编辑:程序博客网 时间:2024/05/19 09:16
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 = 1000005;int main(){char a[MAX_N],b[MAX_N];int lena,lenb,la,lb,pa=0,pb=0,i;scanf("%s%s",a,b);lena=strlen(a);lenb=strlen(b);while(pa<lena&&a[pa]=='0') pa++;while(pb<lenb&&b[pb]=='0') 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 0;}else if(a[i]<b[i-pa+pb]){printf("<\n");return 0;}}printf("=\n");}return 0;}
0 0
- Educational Codeforces Round 5 A
- Educational Codeforces Round 5(A) 模拟
- Educational Codeforces Round 20 A
- Educational Codeforces Round 21 A
- Educational Codeforces Round 23 A
- Codeforces Educational Round 5
- Codeforces Educational round 5
- Educational Codeforces Round 5
- Codeforces Educational Codeforces Round 5
- codeforces Educational Codeforces Round 21 A
- Educational Codeforces Round 5 A. Comparing Two Long Integers
- Educational Codeforces Round 5(A,B,C,D)
- Educational Codeforces Round 5 B
- Educational Codeforces Round 5 总结
- Codeforces Educational Round 5 ABCDE
- Educational Codeforces Round 5 C
- Educational Codeforces Round 5 D
- Educational Codeforces Round 1 A. Tricky Sum
- tableView 那点事 及 导航栏字体颜色
- RTP协议全解(H264码流和PS流)
- win 8.1 下用 VS2013 和 IIS 发布 ASP.NET 网站
- snappy ubuntu core 演示
- webview,html5缓存浅谈
- Educational Codeforces Round 5 A
- YUV图像数据分析
- ArrayAdapter做的listview适配器
- iOS日期计算整理
- nginx搭建
- 网格部件获取焦点行值与获取焦点句柄行值介绍
- sqlzoo练习答案--SELECT within SELECT Tutorial
- String, StringBuilder,Stringbuffer的区别及用法
- 升级Xcode7之后VVDocumenter-Xcode