hdu 2054
Ps:WA了无数次,,简直成了心病..今天终于AC了..先取整数部分,去零,判断位数相等否,再比较.如果相等,再取小数部分,去零,比较,输出....好烦...
代码;
#include "stdio.h"
#include "string.h"
void swi(char a[],char b[]);
void swi1(char a[],char b[]);
void qdele(char a[],char b[]);
void hdele(char a[]);
int main(){
int n,s1,s2,s3,s4;
char a[],b[],c[],d[];
while(~scanf("%s%s",&a,&b)){
swi(a,c);
swi(b,d);
qdele(c,c);
qdele(d,d);
s1=strlen(c);
s2=strlen(d);
if(s1==s2){
if(strcmp(c,d)==){
swi1(a,c);
swi1(b,d);
hdele(c);
hdele(d);
if(strcmp(c,d)==){
printf("YES\n");
}
else{
printf("NO\n");
}
}
else{
printf("NO\n");
}
}
else{
printf("NO\n");
}
}
return ;
}
void swi(char a[],char b[]){
int i,s;
s=strlen(a);
for(i=;i<s;i++){
if(a[i]=='.') break;
b[i]=a[i];
}
b[i]='\0';
}
void swi1(char a[],char b[]){
int i,s,t;
t=;
s=strlen(a);
for(i=s;i>=;i--){
if(a[i-]=='.') break; //12.200 s-i-1
}
//t=s-i-1;
for(;i<s;i++){
b[t++]=a[i];
}
b[t]='\0';
}
void qdele(char a[],char b[]){
int i,s,t;
t=;
s=strlen(a);
for(i=;i<s;i++){
if(a[i]!='') break; //0022 i=2;
}
for(;i<s;i++){
b[t++]=a[i];
}
b[t]='\0';
}
void hdele(char a[]){
int i,s,t;
t=;
s=strlen(a);
for(i=s;i>=;i--){
if(a[i-]!='') break; //
}
a[i]='\0';
}
hdu 2054的更多相关文章
- HDU 2054 A == B ?(找小数点)
题目链接:pid=2054" target="_blank">http://acm.hdu.edu.cn/showproblem.php?pid=2054 Prob ...
- hdu 2054 A == B ? (java)
问题: 考虑问题不周到.没有考虑到可能是小数并且存在 1.0=1.01=1的情况. 本题使用了BigDecimal类,此类适用于高精度的数此时攻克了小数和01=1的问题, 该类比較方式中n.equal ...
- HDU 2054 又见GCD
又见GCD Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Subm ...
- HDU 2054 A==B? 大数
Problem Description Give you two numbers A and B, if A is equal to B, you should print "YES&quo ...
- JAVA大数几算--HDU 2054 A == B ?
Problem Description Give you two numbers A and B, if A is equal to B, you should print "YES&quo ...
- HDU——PKU题目分类
HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...
- [转] HDU 题目分类
转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008 ...
- HDU ACM 题目分类
模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 104 ...
- HDU 5643 King's Game 打表
King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember hi ...
随机推荐
- jq slideUp slideDown
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- Disable SELinux CentOS 7
Disable SELinux CentOS 7 This blog covers the basic steps to disable SELinux on CentOS 7 first we ne ...
- EasyDropDown – 很棒的下拉菜单 含精美主题
EasyDropDown 是一个 jQuery 插件,你可以毫不费力地将简陋的 Select 元素设置为可定制风格的下拉菜单,用于表单或者一般的导航.和著名的下拉插件 Chosen 很像,但是具有自己 ...
- 6/6 Sprint2 看板和燃尽图
页面头部的修改
- Qt之窗口动画(下坠、抖动、透明度)
简述 前面几节中我们介绍了关于动画的基本使用,有属性动画.串行动画组.并行动画组.这节我们来实现一些特效,让交互更顺畅. 简述 示例 效果 源码 更多参考 示例 下面,我们以geometry.pos. ...
- C#容易忽略點--包含多線程 委託事件等等--此頁面bug,編輯能查看全部內容
委託事件 http://www.cnblogs.com/sdya/p/5217635.html 反射 1 创建用于反射使用的DLL 新建一个C#类库项目,拷贝源代码如下,编译生成DLL(假如DLL的文 ...
- JavaScript中给对象添加函数的方式
1. function 类名(){ this.属性: } var 对象名=new 类名(): function 函数名(){ //执行代码 } 对象名.属性名=函数名: 对象名.属性名(): func ...
- hdu----(5023)A Corrupt Mayor's Performance Art(线段树区间更新以及区间查询)
A Corrupt Mayor's Performance Art Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 100000/100 ...
- iOS 开发 – 均衡代码职责
前言 文章的标题有点绕口,不过想了半天,想不到更好的标题了.本文的诞生有一部分功劳要归于iOS应用现状分析,标题也是来源于原文中的"能把代码职责均衡的划分到不同的功能类里".如果你 ...
- 使用JQuery的Ajax调用SOAP-XML Web Services(Call SOAP-XML Web Services With jQuery Ajax)(译+摘录)
假设有一个基于.Net的Web Service,其名称为SaveProduct POST /ProductService.asmx HTTP/1.1 Host: localhost Content-T ...