#include <stdio.h> #include <stdint.h> int safe_compare(int8_t a, uint8_t b) { // Your logic here int result; if(a < 0) { result = 1; } else if(b > 127) { result = 1; } else if(a<b) { result =1; } else result = 0; return result; } int main() { int8_t a; uint8_t b; scanf("%hhd %hhu", &a, &b); printf("%d", safe_compare(a, b)); return 0; }
Test Cases
Test Results
Input
-1 1
Expected Output
1