P4810 A’s problem(a)
背景
清北NOIP春季系列课程
描述
这是一道有背景的题目,小A也是一个有故事的人。但可惜的是这里纸张太小,小A无法把故事详细地说给大家听。可能小A自己也讲不清楚自己的故事,因为如果讲清了,也就没有这道题目了……
小A得到了一个人送给它的n个数,而小A最近在收集一些奇数,因此它对偶数没有任何兴趣。因此,小A现在想要知道这n个数中存在多少数是奇数。
输入格式
第一行一个数n,表示有n个数。
接下来一行n个数ai,表示每个送给小A的数。
输出格式
输出一个数表示答案。
输入样例
5
3 3 4 5 5
输出样例
4
备注
数据范围
对于100%的数据n<=100,1<=ai<=1000。
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
#include<cmath>
using namespace std;
int main()
{
int m,n,tot=;
cin>>m;
for(int i=;i<=m;i++)
{
cin>>n;
if(n%!=)tot++;
}
cout<<tot;
return ;
}
P4810 A’s problem(a)的更多相关文章
- 1199 Problem B: 大小关系
求有限集传递闭包的 Floyd Warshall 算法(矩阵实现) 其实就三重循环.zzuoj 1199 题 链接 http://acm.zzu.edu.cn:8000/problem.php?id= ...
- No-args constructor for class X does not exist. Register an InstanceCreator with Gson for this type to fix this problem.
Gson解析JSON字符串时出现了下面的错误: No-args constructor for class X does not exist. Register an InstanceCreator ...
- C - NP-Hard Problem(二分图判定-染色法)
C - NP-Hard Problem Crawling in process... Crawling failed Time Limit:2000MS Memory Limit:262144 ...
- Time Consume Problem
I joined the NodeJS online Course three weeks ago, but now I'm late about 2 weeks. I pay the codesch ...
- Programming Contest Problem Types
Programming Contest Problem Types Hal Burch conducted an analysis over spring break of 1999 and ...
- hdu1032 Train Problem II (卡特兰数)
题意: 给你一个数n,表示有n辆火车,编号从1到n,入站,问你有多少种出站的可能. (题于文末) 知识点: ps:百度百科的卡特兰数讲的不错,注意看其参考的博客. 卡特兰数(Catalan):前 ...
- BZOJ2301: [HAOI2011]Problem b[莫比乌斯反演 容斥原理]【学习笔记】
2301: [HAOI2011]Problem b Time Limit: 50 Sec Memory Limit: 256 MBSubmit: 4032 Solved: 1817[Submit] ...
- [LeetCode] Water and Jug Problem 水罐问题
You are given two jugs with capacities x and y litres. There is an infinite amount of water supply a ...
- [LeetCode] The Skyline Problem 天际线问题
A city's skyline is the outer contour of the silhouette formed by all the buildings in that city whe ...
随机推荐
- vue-router 编程式导航
借助vue-router的实例方法,通过编写代码来实现导航的切换: back:回退一步 forward:前进一步 go:指定前进回退步数 push:导航到不同url,向history栈添加一个新的记录 ...
- vue element-ui表格里时间戳转换成时间显示
工作中遇到后台给的表格数据里时间是一个13位的时间戳,需要转换成时间显示在表格里, 可以用element-ui表格自带的:formatter函数,来格式化表格内容: // 时间戳转换成时间 // 使用 ...
- Struts2_day02
一.内容大纲 1 结果页面配置 (1)全局结果页面 (2)局部结果页面 - 配置全局也配置局部,最终局部为准 (3)result标签type属性 - 默认值 dispatcher做转发 - redir ...
- mybatis介绍——(一)
官方API:http://www.mybatis.org/mybatis-3/index.html 中文: http://www.mybatis.org/mybatis-3/zh/index.html ...
- 运动规划——PT and PVT 模式
最近项目成员在做机器人上层开发时,经常说到PT模式和PVT模式.一直没搞懂这两种模式的实际差别.上网检索进行学习...... ref link:https://blog.csdn.net/m0_376 ...
- Socket心跳包机制总结【转】
转自:https://blog.csdn.net/qq_23167527/article/details/54290726 跳包之所以叫心跳包是因为:它像心跳一样每隔固定时间发一次,以此来告诉服务器, ...
- [转]mitmproxy套件使用攻略及定制化开发
mitmproxy是一款支持HTTP(S)的中间人代理工具.不同于Fiddler2,burpsuite等类似功能工具,mitmproxy可在终端下运行.mitmproxy使用Python开发,是辅助w ...
- CasperJS断言
特征 CasperJS具有一系列特征. 它具有一些列功能与断言,都是你期望一个好的测试API所具有的,包括: * assertTextExists (文本存在断言)* assertTitle (标题断 ...
- linux终端自定义设置
2014年1月4日 19:21:16 1. ls命令显示文件列表时不再花花绿绿 vi ~/.bashrc alias ls='ls -a --color=never' alias ll='ls -lh ...
- 替换openjdk的版本时遇到报错Transaction check error
x想要使用jmap对jvm内存进行排查问题,但是默认安装的openjdk包中并不带有这个命令,需要新升级到新版本才有 而在安装新的版本时,遇到报错: : file /usr/lib64/libns ...