/******************************************************* * Copyright (C) 2015 Haotian Wu * * This file is the solution to the question: * https://www.hackerrank.com/challenges/funny-string * * Redistribution and use in source and binary forms are permitted. *******************************************************/ #include #include #include #include #include #include using namespace std; int main() { // Simulation. int tt; scanf("%d",&tt); while (tt--) { char str[10001]; scanf("%s",str); int l = strlen(str),flag=1; for (int i=0;i