import java.util.Scanner;

 public class Solution
 {
     public static void main(String[] args)
     {
         Scanner input = new Scanner(System.in);
         System.out.print("Enter the length of the list: ");
         int length = input.nextInt();
         int[] list = new int[length];
         for(int i = 0; i < length; i++)
             list[i] = input.nextInt();
         input.close();
         System.out.println(isConsecutiveFour(list));
     }

     public static boolean isConsecutiveFour(int[] values)
     {
         if(values.length < 4)
             return false;
         for(int i = 0; i < values.length - 4; i++)
         {
             if(values[i] == values[i + 1] && values[i] == values[i + 2] && values[i] == values[i + 3])
                 return true;
         }
         return false;
     }
 }

HW6.30的更多相关文章

  1. 总结30个CSS3选择器

    或许大家平时总是在用的选择器都是:#id  .class  以及标签选择器.可是这些还远远不够,为了在开发中更加得心应手,本文总结了30个CSS3选择器,希望对大家有所帮助. 1 *:通用选择器 ;; ...

  2. 值得收藏!国外最佳互联网安全博客TOP 30

    如果你是网络安全从业人员,其中重要的工作便是了解安全行业的最新资讯以及技术趋势,那么浏览各大安全博客网站或许是信息来源最好的方法之一.最近有国外网站对50多个互联网安全博客做了相关排名,小编整理其中排 ...

  3. CSharpGL(30)用条件渲染(Conditional Rendering)来提升OpenGL的渲染效率

    CSharpGL(30)用条件渲染(Conditional Rendering)来提升OpenGL的渲染效率 当场景中有比较复杂的模型时,条件渲染能够加速对复杂模型的渲染. 条件渲染(Conditio ...

  4. 30分钟学会XAML

    1.狂妄的WPF 相对传统的Windows图形编程,需要做很多复杂的工作,引用许多不同的API.例如:WinForm(带控件表单).GDI+(2D图形).DirectX API(3D图形)以及流媒体和 ...

  5. Shell脚本编程30分钟入门

    Shell脚本编程30分钟入门 转载地址: Shell脚本编程30分钟入门 什么是Shell脚本 示例 看个例子吧: #!/bin/sh cd ~ mkdir shell_tut cd shell_t ...

  6. ViEmu 3.6.0 过期 解除30天限制的方法

    下载:链接: http://pan.baidu.com/s/1c2HUuWw 密码: sak8 删除下面2个地方 HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{B9CDA4 ...

  7. AlloyTouch全屏滚动插件发布--30秒搞定顺滑H5页

    原文链接:https://github.com/AlloyTeam/AlloyTouch/wiki/AlloyTouch-FullPage-Plugin 先验货 插件代码可以在这里找到. 注意,虽然是 ...

  8. C#求斐波那契数列第30项的值(递归和非递归)

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  9. JS组件系列——又一款MVVM组件:Vue(一:30分钟搞定前端增删改查)

    前言:关于Vue框架,好几个月之前就听说过,了解一项新技术之后,总是处于观望状态,一直在犹豫要不要系统学习下.正好最近有点空,就去官网了解了下,看上去还不错的一个组件,就抽空研究了下.最近园子里vue ...

随机推荐

  1. Generating Huge reports in JasperReports

    There are certain things to care while implementing the Jasper Reports for huge dataset to handle th ...

  2. C语言的左位移能不能超过8位?

    C语言的左位移能不能超过8位?比如b=a<<20; 这样可以不?如果可以,一个字节只有8个位,左移20位是不是连右边其它字节的12个位(20-8)也一起左移? 字符变量左移八次后,所有的位 ...

  3. 1988-B. 有序集合

    描述 在C++里,有一个神奇的东西,叫做STL,这里提供了很多简单好用的容器,用来实现常用又很难书写的数据结构,如栈(stack)等.其中,有一个容器叫set,译作“有序集合”.首先,这是一个集合,所 ...

  4. http://blog.csdn.net/majian_1987/article/details/44939911

    http://blog.csdn.net/majian_1987/article/details/44939911

  5. 编译qt-mobility

    因为用到了qt-mobility,必须自己编译一下,参考列出了参考资料. 参考: 1. windows下编译qt-mobility  http://hi.baidu.com/xchinux/blog/ ...

  6. adb开启不了解决方案

    原文地址: adb开启不了解决方案 - vaecer - 博客频道 - CSDN.NET http://blog.csdn.net/vaecer/article/details/45894643   ...

  7. 93. Restore IP Addresses

    题目: Given a string containing only digits, restore it by returning all possible valid IP address com ...

  8. 【HDOJ】4355 Party All the Time

    好久没做过三分的题目了. /* 4355 */ #include <iostream> #include <sstream> #include <string> # ...

  9. 【HDOJ】4347 The Closest M Points

    居然是KD解. /* 4347 */ #include <iostream> #include <sstream> #include <string> #inclu ...

  10. 函数fsp_seg_inode_page_get_nth_inode

    #define FSEG_ARR_OFFSET (FSEG_PAGE_DATA + FLST_NODE_SIZE) #define FSEG_PAGE_DATA FIL_PAGE_DATA #defi ...