1275 有鱼的声音

2012年CCC加拿大高中生信息学奥赛

 时间限制: 1 s
 空间限制: 128000 KB
 题目等级 : 青铜 Bronze
 查看运行结果
 
 
题目描述 Description

A fish-finder is a device used by anglers to find fish in a lake. If the fish-finder finds a fish, it will sound an alarm. It uses depth readings to determine whether to sound an alarm. For our purposes, the fish-finder will decide that a fish is swimming past if:

fish-finder是一个神奇的装置供垂钓者使用区在护理钓鱼。如果一个f-f找到了一条鱼,他会响起声音警报。它用鱼的深度来决定是否响警报。我们的目的就是要决定鱼是否通过,具体如下:

• there are four consecutive depth readings which form a strictly increasing sequence (such as 3 4 7 9) (which we will call “Fish Rising”), or

如果连续的四个深度读入是严格递增的序列,我们可以叫它 Fish Rising 。

• there are four consecutive depth readings which form a strictly decreasing sequence (such as 9 6 5 2) (which we will call “Fish Diving”), or

如果连续的四个深度读入是严格递减的序列,我们可以叫它 Fish Diving 。

• there are four consecutive depth readings which are identical (which we will call “Constant Depth”).
All other readings will be considered random noise or debris, which we will call “No Fish.”
Your task is to read a sequence of depth readings and determine if the alarm will sound.

如果连续的四个深度读入是一样的,那就是“Fish At Constant Depth”。如果都不是,就是“No Fish”。

输入描述 Input Description

The input will be four positive integers, representing the depth readings. Each integer will be on its own line of input.

输入会是四个正整数,代表深度读入。每个整数会占一行。

输出描述 Output Description

The output is one of four possibilities. If the depth readings are increasing, then the output should be Fish Rising. If the depth readings are decreasing, then the output should be Fish Diving. If the depth readings are identical, then the output should be Fish At Constant Depth. Otherwise, the output should be No Fish.

输出就是四种情况。

样例输入 Sample Input

样例1:

30 10 20 20

样例2:

1 10 12 13

样例输出 Sample Output

样例1:

No Fish

样例2:

Fish Rising

数据范围及提示 Data Size & Hint

数据很小

活跃一下身心

代码‘:

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
;
],b[];
int read()
{
    ,f=; char ch=getchar();
    ; ch=getchar();}
    +ch-';  ch=getchar();}
    return x*f;
}
int main()
{
    ;i<=n;i++)
     a[i]=read(),b[i]=a[i];
    sort(b+,b++n);
    ;i<=n;i++)
    {
        ]) a1++;
        ]) a2++;
        ]) a3++;
    }
    ) {printf(;}
    ;}
    ) {printf(;}
    printf(;
}

最新文章

  1. XML特殊字符处理
  2. macaca运行报错之chrome-driver问题处理,关闭 Chrome 的自动更新
  3. 日本超人气洛比(Robi)声控机器人
  4. location.replace与location.href,location.reload的区别
  5. MyBatis Mapper 接口如何通过JDK动态代理来包装SqlSession 源码分析
  6. Linux系统性能诊断工具纲要
  7. [BZOJ 1045] [HAOI2008] 糖果传递
  8. 【HDOJ】3584 Cube
  9. shell从函数文件里调用函数
  10. 关于IE兼容问题
  11. [大数据]-Elasticsearch5.3.1+Kibana5.3.1从单机到分布式的安装与使用&lt;2&gt;
  12. SAP Gateway简介
  13. 高性能nosql ledisdb设计与实现 (2):replication
  14. vue的项目结构记录
  15. jconsole连接本地进程报安全连接失败
  16. ajax01
  17. win10版office365激活序列码
  18. 扩展kmp 模板
  19. DRF框架QQ登录功能
  20. SSM框架搭建总结(2)

热门文章

  1. CF915C Permute Digits
  2. SSH---整合Struts2&amp;Spring&amp;Hibernate(实例)
  3. 最新版Kubernetes常用命令大全
  4. Burp Suite集成sqlmap
  5. iOS Programming Camera 1
  6. IIS ARR设置HTTP跳转到HTTPS
  7. python练习2 购物车程序
  8. WNDCLASS和WNDCLASSEX
  9. GET方法与POST方法的区别
  10. vs2019装了WDK后,编译其他vc工程,提示无法打开文件&quot;msvcprtd.lib&quot;