zoukankan      html  css  js  c++  java
  • hdu4178 乱搞

    #include<stdio.h>
    #include<string.h>
    #define maxn 100
    char name[maxn];
    char s[30];
    int main()
    {
        int i,j,t,n,ff=0,flag;
        int y1,y2,y3,y4;//无错 有错 全错 缺席  
         scanf("%d",&t);
        while(t--)
        {
            scanf("%d",&n);
            y1=y2=y3=y4=0;
            for(i=0;i<n;i++)
            {
                flag=0;
                scanf("%s",name);
                int temp=0;
                if(getchar()=='
    ')
                    flag=1;
                int tt=0;
                while(1)
                {
                    if(flag)break;
                    scanf("%s",s);
                    temp++;
                    if(strcmp(s,"")==0)break;
                    if(s[0]=='y')
                    {
                        tt=1;
                        if(temp==1)
                        {
                            y1++;
                        }
                        else 
                        {
                            y2++;
                        }
                        break;
                    }
                    if(temp==5)break;
                }
                if(temp==0)
                    y4++;
                if(!tt&&temp!=0)
                    y3++;
            }
            printf("Roll-call: %d
    ",++ff);
            printf("Present: %d out of %d
    ",y1,n);
            printf("Needs to study at home: %d out of %d
    ",y2,n);
            printf("Needs remedial work after school: %d out of %d
    ",y3,n);
            printf("Absent: %d out of %d
    ",y4,n);
        }
    }
  • 相关阅读:
    求最低价格
    A*算法入门
    hdu 4715
    手动扩大栈内存,让AC无忧
    hdu 4710
    hdu 1698
    poj3468区间延迟更新模板题
    hdu 1059二进制优化背包问题
    2059龟兔赛跑
    水1276
  • 原文地址:https://www.cnblogs.com/sweat123/p/4764554.html
Copyright © 2011-2022 走看看