HDU_5198

来源:互联网 发布:手机淘宝网怎么登录 编辑:程序博客网 时间:2024/05/09 02:29
#include<stdio.h>#include<string.h>char s[15];bool b;int tot, l;char t;int main() {    while(scanf("%s", s)!= EOF) {        tot = 1;        t = s[0];        b = 1;        l = strlen(s);        for(int i = 0; i < l; i++) {            if(s[i] == t) b = 0;            else {                t = s[i]; b = 1;            }            if(b) tot++;        }        printf((tot == 3 && l%3 == 0)? "YES\n" : "NO\n");        memset(s, '\0', sizeof(s));    }    return 0;}

0 0
原创粉丝点击