首页 > 其他 > 详细

hdu 5059

时间:2014-11-12 12:03:34      阅读:185      评论:0      收藏:0      [点我收藏+]
/*
 * @brief hdu 5059
 * @file 5059.c
 * @author xiyan
 * @CreatedTime 2014/11/12
 * @LastChanged 2014/11/12
 * @note
 *      type: string convert
 *
 *
 */


#include <stdio.h>
#include <string.h>

#define MAXN 110



char s[MAXN], t[MAXN];
int a, b, c;

int solve()
{
     if(1 != sscanf(s, "%d", &c)) return -1;

     sprintf(t, "%d", c);

     if(0 != strcmp(s, t))   return -1;

     return ( (c >= a && c <=b )? 0 : -1);
}


int main()
{
#ifdef DEBUG
    freopen("./in", "r", stdin);
    freopen("./out","w", stdout);
#endif
    
    while(gets(s)){
        scanf("%d%d", &a, &b);
        getchar();
        printf("%s\n", solve() ? "NO" : "YES");
    }
    return 0;
}


hdu 5059

原文:http://my.oschina.net/u/572632/blog/343456

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!