题目1018:统计同成绩学生人数(数组或者map)
2024-09-09 19:16:05
题目链接:http://ac.jobdu.com/problem.php?pid=1018
详解链接:https://github.com/zpfbuaa/JobduInCPlusPlus
参考代码:
//
// 1018.cpp
// oj
//
// Created by PengFei_Zheng on 05/04/2017.
// Copyright © 2017 PengFei_Zheng. All rights reserved.
//
//ios::sync_with_stdio(false); #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string.h> using namespace std; int n,temp,grade;
int score[]={}; int main(){ while(scanf("%d",&n)&&n!=){
memset(score,,sizeof(score));
for(int i = ; i < n ; i++){
scanf("%d",&temp);
score[temp]++;
}
scanf("%d",&grade);
printf("%d\n",score[grade]) ;
}
} /**************************************************************
Problem: 1018
User: zpfbuaa
Language: C++
Result: Accepted
Time:10 ms
Memory:1520 kb
最新文章
- [LeetCode] Matchsticks to Square 火柴棍组成正方形
- mongo group by
- Pow 算法
- PHP 语言需要避免的 10 大误区
- linux系统使用密钥登录设置
- 微软提供了三个核心服务:Windows+Office 365+Azure
- Kinect的学习笔记发展(一)Kinect引进和应用
- wuzhi 五指 伪静态
- HDU 4006 The kth great number 优先队列、平衡树模板题(SBT)
- ionic,Angular 开发实践
- hadoop2.8和spark2.1完全分布式搭建
- 如何将外部的obj模型导入OpenGL
- 求小于n的素数个数
- java Arrays.asList方法注意事项
- 团队作业—预则立&;&;他山之石
- [luogu3648][bzoj3675][APIO2014]序列分割【动态规划+斜率优化】
- Http和RPC区别
- [No0000166]CPU的组成结构及其原理
- Tomcat性能优化之(一) 启动GZIP压缩
- React Native踩坑之启动android模拟器失败