这么简单写出来是错误的??

P1307 [NOIP2011 普及组] 数字反转

IcaRuS @ 2016-10-18 20:56:45

#include<stdio.h>
int main()
{
    int x,bai,shi,ge;
    scanf("%d",&x);
    bai=x/100;
    shi=x%100/10;
    ge=x%10;
    printf("%d",-(ge*100+10*shi+bai));
    return 0;
}

by Red_w1nE @ 2016-10-18 20:59:07

你负数判断我怎么没看懂啊 ??? @IcaRuS


by IcaRuS @ 2016-10-18 22:53:46

发现看错题目了,但是也应该是把负号去掉就行了啊???@ Red_w1nE


by 落叶流云 @ 2016-10-19 07:03:38

谁告诉你是三位数了啊孩子←_←


by 落叶流云 @ 2016-10-19 07:04:12

数据范围

-1,000,000,000≤ N≤ 1,000,000,000 。


by IcaRuS @ 2016-10-21 11:48:12

眼睛瞎了= =。。。。


|