• csu1395模拟


    #include<stdio.h>
    #include<string.h>
    #define N  10
    char s[N][N][N]={{"***","* *","* *","* *","***"},{"  *","  *","  *","  *","  *"},{"***","  *","***","*  ","***"},{"***","  *","***","  *","***"},{"* *","* *","***","  *","  *"},{"***","*  ","***","  *","***"},
    {"***","*  ","***","* *","***"},{"***","  *","  *","  *","  *"},{"***","* *","***","* *","***"},{"***","* *","***","  *","***"}};
    int main() {
        int i,j,k,len,sum,co,cl,flag,jj,kk,f;
        char ss[6][100];
        char st[6][100];
        while(gets(ss[1])) {
                sum=0;
            for(i=2;i<=5;i++)
             gets(ss[i]);
                len=strlen(ss[1]);
                  flag=0;
             for(i=0;i<len;i+=4) {
                    co=0;
            for(j=1;j<=5;j++) {
                    cl=0;
            for(k=i;k<i+3&&k<strlen(ss[j]);k++)
            st[co][cl++]=ss[j][k];
            for(f=cl;f<3;f++)//有可能提前换行,不足补零
                st[co][cl++]=' ';
            st[co++][cl]=0;
            }
                for(jj=0;jj<10;jj++) {
                    for(kk=0;kk<5;kk++) {
                    if(strcmp(st[kk],s[jj][kk])!=0)
                    break;
                    }
                if(kk==5)
                    break;
                }
                if(jj==10) {
                    flag=1;
                    break;
                }
                sum=sum*10+jj;
            }
             if(flag||sum%6!=0)printf("BOOM!! ");
             else
        printf("BEER!! ");
        }
    return 0;
    }
  • 相关阅读:
    顺序表应用4-2:元素位置互换之逆置算法(数据改进)(SDUT 3663)
    顺序表应用3:元素位置互换之移位算法(SDUT 3326)
    Java——容器(Collection)
    Java——容器(Interator)
    Java——JDK1.5新增强的for循环
    Java——容器(Set)
    Java——容器(List)
    Java——类
    Java——面向对象编程
    Java——递归调用
  • 原文地址:https://www.cnblogs.com/thefirstfeeling/p/4410776.html
Copyright © 2020-2023  润新知