#include #include #include using namespace std; int Gets(char *buff,int buffMaxSize) { buff[0]='\0'; if (fgets(buff,buffMaxSize,stdin)==NULL){ return -1; } size_t strLen = strlen(buff); if (strLen>0){ while (buff[strLen-1] == '\r' || buff[strLen-1]=='\n'){//改行コード strLen--; buff[strLen]='\0'; } } return (int)strLen; } int main(int argc, char* argv[]) { char S[101]; Gets(S,100); size_t Len=strlen(S); for (int i=0;i