PID12 / 陶陶摘苹果 ☆
来源:互联网 发布:淘宝买的鲜人参怎么样 编辑:程序博客网 时间:2024/06/08 17:15
题目描述
陶陶家的院子里有一棵苹果树,每到秋天树上就会结出10个苹果。苹果成熟的时候,陶陶就会跑去摘苹果。陶陶有个30厘米高的板凳,当她不能直接用手摘到苹果的时候,就会踩到板凳上再试试。
现在已知10个苹果到地面的高度,以及陶陶把手伸直的时候能够达到的最大高度,请帮陶陶算一下她能够摘到的苹果的数目。假设她碰到苹果,苹果就会掉下来。
输入格式
输入包括两行数据。第一行包含10个100到200之间(包括100和200)的整数(以厘米为单位)分别表示10个苹果到地面的高度,两个相邻的整数之间用一个空格隔开。第二行只包括一个100到120之间(包含100和120)的整数(以厘米为单位),表示陶陶把手伸直的时候能够达到的最大高度。
输出格式
输出包括一行,这一行只包含一个整数,表示陶陶能够摘到的苹果的数目。
https://www.rqnoj.cn/problem/12
水题
/* ***********************************************Author :Lu_ckyCreated Time :2016年05月31日 星期二 10时03分20秒File Name :main.cpp************************************************ */#include <stdio.h>#include <string.h>#include <iostream>#include <algorithm>#include <vector>#include <queue>#include <set>#include <map>#include <string>#include <math.h>#include <stdlib.h>#include <time.h>#define LL long longusing namespace std;const int SIZE=1e3+10;const int maxn=1<<30;int main(){ //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); int a[10],x;for(int i=0;i<10;i++)scanf("%d",&a[i]);scanf("%d",&x);int ans=0;for(int i=0;i<10;i++)if(x+30>=a[i])ans++;printf("%d\n",ans); return 0;}
0 0
- PID12 / 陶陶摘苹果 ☆
- 1144. 陶陶摘苹果
- 【模拟】陶陶摘苹果
- 1144. 陶陶摘苹果
- 陶陶摘苹果
- 陶陶摘苹果
- 陶陶摘苹果
- 【noip2005】陶陶摘苹果
- 陶陶摘苹果
- 陶陶摘苹果
- P1102 陶陶摘苹果
- 陶陶摘苹果v
- 陶陶摘苹果
- P1046 陶陶摘苹果
- 陶陶摘苹果
- 陶陶摘苹果2
- 陶陶摘苹果
- 陶陶摘苹果
- Assets文件夹
- 你想跳槽,五个错不要犯!
- C#学习笔记集合类型之数组(3)
- MySQL的grant,revoke使用
- ACM3-1007
- PID12 / 陶陶摘苹果 ☆
- java static
- CSS特效代码整理
- web页面位置详解
- 深入浅出JMS(四)--Spring和ActiveMQ整合的完整实例
- Openfire问题记录
- 关于极光推送我做的工作
- Android中的动态加载机制
- Web服务器处理HTTP压缩之gzip、deflate压缩