TOPIC

5% wrong answer because abs()?

rmatos6 asked 4 years ago

I'm tryna submit this code (that apparently ain't wrong) but uri returns 5% wrong answer...

#include <stdio.h>
#include <stdlib.h>

int main()
{
    unsigned int h, o;

    while(scanf("%u", &h) != EOF){
        scanf("%u", &o);

        printf("%u\n", (abs(h-o)));
    }
    return 0;
}

Remember not post solutions. Your post may be reviewed by our moderators.

  • Leonardo_su replied 4 years ago

    You need use Long Long int :)