Skip to content

Instantly share code, notes, and snippets.

import java.util.Scanner;
public class Array{
public static void main (String [] args){
Scanner input = new Scanner (System.in);
int numbers, numbers2;
numbers = input.nextInt();
int[] array = new int[numbers];
System.out.println("Now input each number you want.");
@pepet96
pepet96 / Arrayreverse
Created January 29, 2014 08:06
Reverse Order Array
import java.util.Scanner;
import java.util.Arrays;
public class Arrayreverse {
public static void main (String [] args) {
Scanner input = new Scanner(System.in);
int positions = input.nextInt();
@pepet96
pepet96 / Fibonacci
Created January 20, 2014 23:58
Fibonacci Sequence, cannot go further than 92
import java.util.Scanner;
import java.io.*;
public class Fibonacci {
public static void main (String [] args) {
long f = 0;
long n = 1;
Scanner input = new Scanner(System.in);
@pepet96
pepet96 / ArmyStrength
Created December 2, 2013 01:24
Godzilla vs Mecha-Godzilla (Long Version)
import java.util.Scanner;
public class ArmyStrength {
public static void main (String [] args) {
Scanner input = new Scanner(System.in);
int godzillaMayor = 0, mechaMayor = 0;
String[] winners = new String[input.nextInt()];
@pepet96
pepet96 / aplusb
Created December 2, 2013 01:14
A + B
import java.util.Scanner;
import java.util.Arrays;
import java.io.*;
public class aplusb {
public static void main (String [] args) throws IOException {
InputStreamReader inStream = new InputStreamReader(System.in);
BufferedReader systemIn = new BufferedReader(inStream);
@pepet96
pepet96 / godzillarmy
Created December 2, 2013 01:09
Godzilla and Mecha-Godzilla (Short Version)
import static java.lang.Integer.*;
import static java.lang.Math.*;
import java.util.*;
import java.io.*;
public class godzillarmy {
public static void main(String[] args) throws Throwable{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
for(int c = 0, C = parseInt(in.readLine().trim()); c++ < C;){
in.readLine();in.readLine();
@pepet96
pepet96 / powersof
Last active December 29, 2015 23:29
Powers of Two
import java.util.Scanner;
import java.lang.*;
public class powersof {
public static void main (String [] args) {
Scanner input = new Scanner(System.in);
int x = 2;
int n = input.nextInt();
@pepet96
pepet96 / GeneralElection
Created December 2, 2013 01:00
General Election
import java.util.Scanner;
public class GeneralElection {
public static void main (String [] args) {
Scanner input = new Scanner(System.in);
int cases = input.nextInt();
for (int i = 1; i <= cases; i++) {
int output = 0, winner = 0;
@pepet96
pepet96 / TransversingGrid
Created December 2, 2013 00:59
Transversing Grid
mport java.util.Scanner;
public class TraversingGrid {
public static void main (String [] args) {
Scanner input = new Scanner(System.in);
String[] output = new String[input.nextInt()];
for (int i = 0; i < output.length; i++) {
int n = input.nextInt();
@pepet96
pepet96 / Sum
Created December 2, 2013 00:56
Sum
import java.util.Scanner;
class Sum {
public static void main(String [] args) {
Scanner input = new Scanner(System.in);
int n, x, absn, sum;
x = 0;