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

By |2017-04-09T23:54:03+00:00April 9th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , |

#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"); [...]