uva 620 Cellular Structure

来源:互联网 发布:windows清理助手3 编辑:程序博客网 时间:2024/04/29 08:35
#include <stdio.h>#include <string.h>char buf[2000];void func(int &res){int len;len=strlen(buf);if(0 == len%2)return;if(1 == len && buf[0]=='A'){res = 1;return;}if(len>=2 && buf[len-1]=='B' && buf[len-2]=='A'){res = 2;return;}if(len>=2 && buf[0]=='B' && buf[len-1]=='A'){res = 3;return;}}int main(void){int n, result;//freopen("input.dat", "r", stdin);scanf("%d", &n);while(n--){scanf("%s", buf);result = 4;func(result);switch(result){case 1:printf("SIMPLE\n");break;case 2:printf("FULLY-GROWN\n");break;case 3:printf("MUTAGENIC\n");break;case 4:printf("MUTANT\n");break;}}return 0;}

0 0
原创粉丝点击