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;
}

The Real Truth About...

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

Is Desk Productivity Tools...

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

The Outer Worlds 2...

Gamers and RPG enthusiasts have reason to celebrate as...

Why Travel Organization Gear...

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

Why Everyone Is Talking...

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

Why Everyone Is Talking...

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

The Real Truth About Bedroom Aesthetic Decor Before You Buy

📢 As an Amazon Associate, I earn from qualifying purchases.💰 Official Price: Check on Amazon🌟 Why Buy the Bedroom Aesthetic Decor?The Bedroom Aesthetic Decor...

Is Desk Productivity Tools Worth Your Money Here Is Our Full Review

📢 As an Amazon Associate, I earn from qualifying purchases.💰 Official Price: Check on Amazon🌟 Why Buy the Desk Productivity Tools?The Desk Productivity Tools...

The Outer Worlds 2 v1.2.0.1-TENOKE

Gamers and RPG enthusiasts have reason to celebrate as Obsidian Entertainment's acclaimed franchise returns with new developments. The highly anticipated sequel to the award-winning...

Why Travel Organization Gear Is Currently Breaking the Internet

📢 As an Amazon Associate, I earn from qualifying purchases.💰 Official Price: Check on Amazon🌟 Why Buy the Travel Organization Gear?The Travel Organization Gear...

Why Everyone Is Talking About the Car Detailing Essentials

📢 As an Amazon Associate, I earn from qualifying purchases.💰 Official Price: Check on Amazon🌟 Why Buy the Car Detailing Essentials?The Car Detailing Essentials...

Why Everyone Is Talking About the Smart Home Hacks

📢 As an Amazon Associate, I earn from qualifying purchases.💰 Official Price: Check on Amazon🌟 Why Buy the Smart Home Hacks?The Smart Home Hacks...

Why Everyone Is Talking About the Viral Kitchen Gadgets

📢 As an Amazon Associate, I earn from qualifying purchases.💰 Official Price: Check on Amazon🌟 Why Buy the Viral Kitchen Gadgets?The Viral Kitchen Gadgets...

Why Everyone Is Talking About the Travel Organization Gear

📢 As an Amazon Associate, I earn from qualifying purchases.💰 Official Price: Check on Amazon🌟 Why Buy the Travel Organization Gear?The Travel Organization Gear...

Why Everyone Is Talking About the Travel Organization Gear

📢 As an Amazon Associate, I earn from qualifying purchases.💰 Official Price: Check on Amazon🌟 Why Buy the Travel Organization Gear?The Travel Organization Gear...