#include <stdio.h> int main() { char s[100001]; scanf("%s", s); int count = 0; for (int i = 1; s[i] != '\0'; i++) { if (s[i] == s[i-1]) { count++; s[i] = s[i-1] + 1; if (s[i] > '9') { s[i] = s[i-1] - 1; } } } printf("%d\n", count); return 0; }

相关推荐

07-23 11:23
门头沟学院 Java
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务