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

  1. HDU 2054 A == B ?(找小数点)

    题目链接:pid=2054" target="_blank">http://acm.hdu.edu.cn/showproblem.php?pid=2054 Prob ...

  2. hdu 2054 A == B ? (java)

    问题: 考虑问题不周到.没有考虑到可能是小数并且存在 1.0=1.01=1的情况. 本题使用了BigDecimal类,此类适用于高精度的数此时攻克了小数和01=1的问题, 该类比較方式中n.equal ...

  3. HDU 2054 又见GCD

    又见GCD Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Subm ...

  4. HDU 2054 A==B? 大数

    Problem Description Give you two numbers A and B, if A is equal to B, you should print "YES&quo ...

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

  6. HDU——PKU题目分类

    HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...

  7. [转] HDU 题目分类

    转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008 ...

  8. HDU ACM 题目分类

    模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 104 ...

  9. HDU 5643 King's Game 打表

    King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember hi ...

随机推荐

  1. IDE显示无法打开源文件时解决方案

      解决方法:加上具体地址信息将 #include <qwidgetresizehandler_p.h> 改为 #include <C:\Users\INnoVation\Deskt ...

  2. python中字符与ascii码转换

    ASCII码转字符用chr()函数:  字符转ASCII码用ord()函数:  

  3. Java之线程———GUI线程(包含打字游戏和计时器俩个GUI实列)

    当java程序包含图形用户界面(GUI)时,Java虚拟机在运行应用程序时会自动启动更多的线程,其中有两个重要的线程:AWT-EventQuecue 和 AWT-Windows. AWT-EventQ ...

  4. Oracle 表死锁 解决

    问题:更新的Update语句一直在更新 卡在执行update语句的地方. 清除的方法: Oracle表死锁解除   我是在plsql中处理  1.先查询  select * from v$locked ...

  5. splunk 索引过程

    术语: Event :Events are records of activity in log files, stored in Splunk indexes. 简单说,处理的日志或话单中中一行记录 ...

  6. BZOJ3206 [Apio2013]道路费用

    首先我们强制要求几条待定价的边在MST中,建出MST 我们发现这个MST中原来的边是一定要被选上的,所以可以把点缩起来,搞成一棵只有$K$个点的树 然后$2^K$枚举每条边在不在最终的MST中,让在最 ...

  7. ExecuteNonQuery()返回值注意点

    在使用ExecuteNonQuery(),调用存储过程,语句执行无错误,但是返回结果一直是-1 原因: 当使用储存过程时, 要把SET NOCOUNT ON  这个语句去掉, 这样数据就有反回值了 当 ...

  8. centos 卸载软件·

    centos下完全卸载php 1显示相关软件的列表 rpm -qa  | grep i(可以不加) php 2 卸载即可 rpm -e 软件名 --nodeps centos下完全卸载mysql 1显 ...

  9. [Js]焦点图轮播效果

    一.所用到的知识点 1.DOM操作 2.定时器 3.事件运用 4.Js动画 5.函数递归 6.无限滚动大法 二.结构和样式 <div id="banner" class=&q ...

  10. 保护WIFI无线网络的安全

    本篇博客属于我们隐私与安全小贴士系列博客的一部分,其目的是确保您以及您的家人的上网安全.隐私与安全问题无论对我们还是对您都至关重要.我们在“不可 不知的小知识”网站上为您提供了如何安全,便捷地使用互联 ...