April Fools Contest 2017, problem: (D) Touchy-Feely Palindromes Solution in C

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

int main(){
int i, num, flag=0;
char str[11];
scanf(“%s”, str);
num = strlen(str);
if(num == 1){
if(str[0] == ‘3’ || str[0] == ‘7’){
printf(“Yes\n”);
}
else
printf(“No\n”);
}
else{
for(i=0; i<num/2; i++){
if(str[i] == ‘1’ || str[i] == ‘2’){
printf(“No\n”);
flag = 1;
break;
}
if(str[i] == ‘0’){
if(str[num-i-1] != ‘8’){
printf(“No\n”);
flag = 1;
break;
}
}
if(str[i] == ‘3’){
if(str[num-i-1] != ‘3’){
printf(“No\n”);
flag = 1;
break;
}
}
if(str[i] == ‘4’){
if(str[num-i-1] != ‘6’){
printf(“No\n”);
flag = 1;
break;
}
}
if(str[i] == ‘5’){
if(str[num-i-1] != ‘9’){
printf(“No\n”);
flag = 1;
break;
}
}
if(str[i] == ‘6’){
if(str[num-i-1] != ‘4’){
printf(“No\n”);
flag = 1;
break;
}
}
if(str[i] == ‘7’){
if(str[num-i-1] != ‘7’){
printf(“No\n”);
flag = 1;
break;
}
}
if(str[i] == ‘8’){
if(str[num-i-1] != ‘0’){
printf(“No\n”);
flag = 1;
break;
}
}
if(str[i] == ‘9’){
if(str[num-i-1] != ‘5’){
printf(“No\n”);
flag = 1;
break;
}
}
}
if(num%2 == 1 && flag == 0){
if(str[num/2] == ‘0’ || str[num/2] == ‘1’ || str[num/2] == ‘2’ || str[num/2] == ‘4’ || str[num/2] == ‘5’ || str[num/2] == ‘6’ || str[num/2] == ‘8’ || str[num/2] == ‘9’){
printf(“No\n”);
flag = 1;
}
}
if(flag == 0){
printf(“Yes\n”);
}
}
return 0;
}

Everything You Need to...

📢 As an Amazon Associate, I earn from qualifying...

Russ Allbery: Review: Radiant...

Science fiction enthusiasts and literary critics alike are turning...

Why Pet Travel Gear...

📢 As an Amazon Associate, I earn from qualifying...

Mall Together-TENOKE

Simulation gaming enthusiasts have a fresh operational challenge to...

7 Reasons This Coffee...

📢 As an Amazon Associate, I earn from qualifying...

Why Kitchen Organization Tools...

📢 As an Amazon Associate, I earn from qualifying...

Everything You Need to Know About Rechargeable Home Tech Right Now

📢 As an Amazon Associate, I earn from qualifying purchases.I stumbled across this while desperately trying to fix a recurring problem in my routine....

Russ Allbery: Review: Radiant Star

Science fiction enthusiasts and literary critics alike are turning their eyes toward the upcoming release of Radiant Star, the latest novel by award-winning author...

Why Pet Travel Gear Is Currently Breaking the Internet

📢 As an Amazon Associate, I earn from qualifying purchases.After putting the Pet Travel Gear through a proper 30-day real-world test, I can tell...

Mall Together-TENOKE

Simulation gaming enthusiasts have a fresh operational challenge to tackle with the arrival of Mall Together-TENOKE. This brand-new release delivers an immersive shopping mall...

7 Reasons This Coffee Bar Accessories Is Worth Every Single Penny

📢 As an Amazon Associate, I earn from qualifying purchases.There comes a point when you realise that tolerating a frustrating situation is costing you...

Why Kitchen Organization Tools Is Currently Breaking the Internet

📢 As an Amazon Associate, I earn from qualifying purchases.There comes a point when you realise that tolerating a frustrating situation is costing you...

Is Dorm Room Hacks Worth Your Money Here Is Our Full Review

📢 As an Amazon Associate, I earn from qualifying purchases.If you had told me six months ago that a single purchase would change how...

Stop Buying Cheap Alternatives This Camping Essentials Is the Real Deal

📢 As an Amazon Associate, I earn from qualifying purchases.There comes a point when you realise that tolerating a frustrating situation is costing you...

Everything You Need to Know About Outdoor Patio Tech Right Now

📢 As an Amazon Associate, I earn from qualifying purchases.I'll be honest — I was skeptical at first. My daily routine had a gap...