81 / 83
Aug 2015

Wygląda git, a działa to dwie całkowicie różne rzeczy.
Sprawdziłeś tylko dla 10 10 i już założyłeś, że jest git !!??
A dla 1000 1500 też wygląda u Ciebie na konsoli git?? Sprawdzałeś?
Czy teraz, po odpowiedzi zaro, czujesz się już usatysfakcjonowany? wink

1 year later

I have just joined SPOJ and this was the first problem I tried. My source code was:

import java.util.*;
public class SOJ1
{
public static void main()
{
Scanner sc = new Scanner(System.in);
boolean input = true;
String n = "";
while(input)
{
System.out.println("Enter a number");
int num = sc.nextInt();
if(num!=42)
n += num+" ";
else
input = false;
}
String numbers[] = n.split(" ");
for(String a: numbers)
System.out.println(a);
}
}

I submitted this with the option of JAVA (Hotspot) when asked for language. A compilation error occured thought this program works fine for me on BLUE J (JAVA IDE I use)
Can someone help me out ?

1 year later

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

	Scanner input = new Scanner(System.in);
	
	while(input.hasNext()) //this code will run untill we break it from the inside
	{
		int num;
		num=input.nextInt();
		

		if(num!=42)
		{
			System.out.println(num);
		}
		else
		{
		    break;
		}
		
	}
	

}

}