Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class HelloWorld{
- public static void main(String []args){
- int[] myIntArray = {2,1,1,7,7,2,2,3};
- System.out.println(takeArray(myIntArray));
- }
- public static boolean takeArray(int [] input){
- for (int i = 0; i <= input.length-3; i++){
- if ((input[i]+input[i+1]+input[i+2])==7){
- return true;
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement