九度考研真题 浙大 2006-2浙大 统计同成绩人数 hash
2015-10-21 13:55
274 查看
//统计同成绩学生人数
#include<iostream>
#include<string.h>
using namespace std;
int main(){
int N;
int num[101];
int score;
int t;
while(cin>>N&&N!=0){
memset(num,0,sizeof(num));
while(N--){
cin>>score;
num[score]++;
}
cin>>t;
cout<<num[t]<<endl;
}
}
#include<iostream>
#include<string.h>
using namespace std;
int main(){
int N;
int num[101];
int score;
int t;
while(cin>>N&&N!=0){
memset(num,0,sizeof(num));
while(N--){
cin>>score;
num[score]++;
}
cin>>t;
cout<<num[t]<<endl;
}
}
相关文章推荐
- 安卓 自带主题 theme
- Item 43:访问模板基类中的名称 Effective C++笔记
- 旧文备份:CANopen中SYNC的功能和使用
- iOS 静态库中使用宏定义区分iPhone模拟器与真机---备用
- windows端口与木马相关总结
- Java编程思想重点笔记(Java开发必看)
- 数据结构_索引表
- vim 常用插件功能跟配置
- 在hadoop中运行自带例子wordcount的步骤
- Unity制作一个望远镜与查看器摄像机
- 每日总结关于c语言中不会问题的解答
- 简单的Modbus/TCP客户端,包含写寄存器函数#C++
- 从前台到后台再到数据库,中文字符乱码的问题
- ubuntu ssh 服务安装 及 防火墙配置
- 数据结构_双向循环链表
- javascript常见的数据校验方法
- request.getRequestdispacher("result.jsp“).forward(request,response)与response.sendRedirect()重定向
- 通过类名查找类名里面的标签
- __FUNCTION__, __func__, __PRETTY_FUNCTION__
- QImage的显示