#Help me
21 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
why do you expect it to be that?
when you input 101010101010 111010101011 34359738368 those 3 assign to N, M, and F respectively
N ^ (M + 1) is 61674906630
61674906630 is larger than 34359738368
so K <= F is false
and therefore if (can_save) goes to the else
I think you might be confused by N and M
they dont take in binary numbers just because you write them as 1s and 0s
!f
int main() {
unsigned long long N, M, F, K;
int can_save = 0;
scanf("%llu %llu %llu", &N, &M, &F);
if (N == 0) {
can_save = (M == 0);
} else {
K = N ^ (M + 1);
can_save = (K <= F);
}
if (can_save) {
printf("HAHAHA, I CAN SAVE THE WORLD\n");
} else {
printf("OH NOOO, I FAILED\n");
}
return 0;
}
Guys, why if i input 101010101010 111010101011 34359738368, the output is OH NOOO, I FAILED. Whereas, it should be HAHAHA, I CAN SAVE THE WORLD. Can you guys tell me where the problem is ? and modified my program.
aaahh i see, maybe my program should be wrong
the question is like this, would you please do me a favour ?