Description

The new principal of Woop Woop High is not satisfied with her pupils performance. She introduced a new roll-call process to get a daily measure of the pupils' learning, which proceeds as follows:

At the beginning of the daily roll-call period each pupil is handed a question, which they must attempt to answer, before proceeding to their classes. A pupil stops after the question is answered correctly. Each pupil is allowed up to five attempts to answer the question correctly.

Pupils who answer correctly on the first attempt are marked present. Pupils who answer correctly after more than one attempt are encouraged to work at home. Pupils who fail to develop a correct answer within five attempts are given remedial classes after school. Pupils who do not give any answer are marked as abscent.

Your task is to write a program that reads the pupils' assessments and generates performance reports for the principal to proceed with appropriate actions.

Input

The input starts with an integer K ( 1K100) indicating the number of classes. Each class starts with an integer N ( 1N50) indicating the number of pupils in the class. Each of the following N lines starts with a pupil's name followed by up-to five assessments of his/her answers. An assessment of 'yes' or 'y' indicates a correct answer and an assessment of 'n' or 'no' indicates a wrong answer. A pupil's name consists of a single string with no white spaces.

Output

The attendance report for each class consists of five lines.

  • The first line consists of the sentence: "Roll-call: X", where X indicates the class number starting with the value of one.
  • The second line consists of the sentence: ''Present: Y1 out of N'', where Y1 is the number of pupils who did not submit a wrong answer.
  • The third line consists of the sentence: ''Needs to study at home: Y2 out of N'', where Y2 is the number of pupils who submitted a number of wrong answers before submitting the correct answer.
  • The fourth line consists of the sentence: ''Needs remedial work after school: Y3 out of N'', where Y3 indicates the number of pupils whose submitted five wrong answers.
  • The fifth line consists of the sentence: ''Absent: Y4 out of N'', where Y4 indicates the number of absent pupils.

Sample Input

2
5
Doc n y
sneezy n n no yes
princecharming no n no no n
goofy yes
grumpy n y
5
evilemperor n y
princesslia
r2d2 no no y
obeyonecanopy n no y
darthvedar y

Sample Output

Roll-call: 1
Present: 1 out of 5
Needs to study at home: 3 out of 5
Needs remedial work after school: 1 out of 5
Absent: 0 out of 5
Roll-call: 2
Present: 1 out of 5
Needs to study at home: 3 out of 5
Needs remedial work after school: 0 out of 5
Absent: 1 out of 5
/*
题意:每个人做五道题 答对(yes/y) 答错(n,/n)
Roll-call: 1 回合
Present: 1 out of 5 第一道就答对了
Needs to study at home: 3 out of 5 五道题之内答对了一道 但不是第一道
Needs remedial work after school: 1 out of 5 五道题都没有答对
Absent: 0 out of 5 一道题也没有回答 各种写法都有 不过就还是最熟悉的写法来的好
读空格 gets() 也可以是读整行的getline--cin.getline(str,100);
getcahr() 一直不能掌握其要领 不过输入字符串的时候就要注意一下
*/ #include <iostream>
#include <string.h>
#include <stdio.h> using namespace std;
int s1,s2,s3,s4;
bool OK;
int cnt; int main()
{
int t,n;
int num;
char str[]; scanf("%d",&t);
for(num=;num<=t;num++)
{
s1=;s2=;s3=;s4=; scanf("%d",&n);
int s=n;
getchar();
while(n--)
{
OK=false;
cnt=;
gets(str);
int len=strlen(str);
for(int i=;i<len;i++)
{
if(str[i-]==' '&&str[i]=='y')
{
if(cnt==) ///yi ci jiu dui
s1++;
else ///hui da hao ji ci dui
s2++;
cnt++; ///lai guo
OK=true;
}
else if(str[i-]==' '&&str[i]=='n')
{
cnt++; ///lai guo
} }
if(cnt==)
s4++; ///mei lai
else if(!OK)
s3++; ///mei dui guo
}
// cout<<s1<<' '<<s2<<' '<<s3<<' '<<s4<<endl;
printf("Roll-call: %d\n",num);
printf("Present: %d out of %d\n",s1,s);
printf("Needs to study at home: %d out of %d\n",s2,s);
printf("Needs remedial work after school: %d out of %d\n",s3,s);
printf("Absent: %d out of %d\n",s4,s);
}
}

C - Roll-call in Woop Woop High的更多相关文章

  1. A - Class Statistics

    A - Class Statistics Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Subm ...

  2. 树莓派 Raspberry Pi 与 micro:bit起手式

    本文将学习如何在Raspberry Pi上安装MicroPython编辑器mu,并将MicroPython中编写的程序从您的Raspberry Pi推送到micro:bit. 您需要: 硬件, 带有S ...

  3. HDU 4178 模拟

    Roll-call in Woop Woop High Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (J ...

  4. hdu 4176

    Class Statistics Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  5. pitch yaw roll是什么

    虚拟现实 三维空间的右手笛卡尔坐标如图1所示. 图1 在航空中,pitch, yaw, roll如图2所示. pitch是围绕X轴旋转,也叫做俯仰角,如图3所示. yaw是围绕Y轴旋转,也叫偏航角,如 ...

  6. osg四元数设置roll pitch heading角度

    roll绕Y轴旋转 pitch绕X轴旋转 heading绕Z轴旋转 单位是弧度,可以使用osg::inDegrees(45)将45角度转换为弧度 定义一个四元数 osg::Quat q( roll,o ...

  7. bzoj roll题器(Py大法好)

    此roll题器能实现非权限号跳过权限题及所有号跳过已切题 点击下载rar文件(py2) 点击下载rar文件(py3)

  8. Calendar类中add/set/roll方法的区别

    欢迎和大家交流技术相关问题: 邮箱: jiangxinnju@163.com 博客园地址: http://www.cnblogs.com/jiangxinnju GitHub地址: https://g ...

  9. HDU 5955 Guessing the Dice Roll

    HDU 5955 Guessing the Dice Roll 2016 ACM/ICPC 亚洲区沈阳站 题意 有\(N\le 10\)个人,每个猜一个长度为\(L \le 10\)的由\(1-6\) ...

随机推荐

  1. Codeforces 787D. Legacy 线段树建模+最短路

    D. Legacy time limit per test:2 seconds memory limit per test:256 megabytes input:standard input out ...

  2. 不解压查看tar.gz包内文件

    通过tar命令备份.解压缩文件,也可在不解压缩文件时查看包内的文件信息. 使用如下参数: tar -ztvf file.tar.gz 将列出所有包内的文件列表,包括目录 -z, --gzip, --g ...

  3. Jquery中$.each()与$().each()的使用与区别。

    在jquery中,遍历对象和数组,经常会用到$().each和$.each(),两个方法.两个方法是有区别的,从而这两个方法在针对不同的操作上,显示了各自的特点. $().each,对于这个方法,在d ...

  4. 2019,UI设计师必备神器

      2019年将会是你全新起航的一年,相信你已经制定了很多规划,正在开启第一步的推动. 作为对UI设计师更大程度的支持,今天特意为你分享一款释放你双手的设计神器.让你可以把时间和精力投入到设计本身,这 ...

  5. 找不到类SimpleJdbcTemplate ParameterizedRowMapper cannot be resolved

    找不到类SimpleJdbcTemplate 背景 想编译个web应用,原来spring-jdbc.jar用的是Spring 3.1,今天改成用Spring 4.3,报了这个错误. 现象 编译不通过, ...

  6. eclipse构建maven的web项目(转载)

    eclipse构建maven的web项目 分类: java opensource2013-12-25 16:22 43人阅读 评论(0) 收藏 举报 maven框架webappwebeclipse 使 ...

  7. Java设计模式(8)——策略模式

    一.策略模式定义 Strategy模式也叫策略模式是行为模式之一,它对一系列的算法加以封装,为所有算法定义一个抽象的算法接口,并通过继承该抽象算法接口对所有的算法加以封装和实现,具体的算法选择交由客户 ...

  8. 70.app上架被拒(info.plist定位参数配置)

    问题一: Your app declares support for location in the UIBackgroundModes key in your Info.plist file but ...

  9. 2018.11.02 NOIP模拟 优美的序列(数论+单调栈/链表)

    传送门 考虑如果一个区间满足最小值等于最大公约数那么这个区间是合法的. 因此我们对于每一个点维护可以延展到的最左/右端点保证这一段区间的gcdgcdgcd等于这个点的值. 这个可以用之前同类的链表或者 ...

  10. 2018.10.29 bzoj1023: [SHOI2008]cactus仙人掌图(仙人掌+单调队列优化dp)

    传送门 求仙人掌的直径. 感觉不是很难. 分点在环上面和不在环上分类讨论. 不在环上直接树形dpdpdp. 然后如果在环上讨论一波. 首先对环的祖先有贡献的只有环上dfsdfsdfs序最小的点. 对答 ...