Rezultati

Up. imeNalogaJezikRezultatČas oddaje
domaco-2018 Podnapisi Java 0/100Napaka med izvajanjem / ob izhodu (RTE) 10. maj '18 @ 17:32

Test Točke Porabljen spomin Porabljen čas Status
#1 0/7 36,473 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.util.InputMismatchException
	at java.util.Scanner.throwFor(Scanner.java:864)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextInt(Scanner.java:2117)
	at java.util.Scanner.nextInt(Scanner.java:2076)
	at svetiGral.main(svetiGral.java:7)
#2 0/7 36,582 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.util.InputMismatchException
	at java.util.Scanner.throwFor(Scanner.java:864)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextInt(Scanner.java:2117)
	at java.util.Scanner.nextInt(Scanner.java:2076)
	at svetiGral.main(svetiGral.java:7)
#3 0/7 36,672 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.util.InputMismatchException
	at java.util.Scanner.throwFor(Scanner.java:864)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextInt(Scanner.java:2117)
	at java.util.Scanner.nextInt(Scanner.java:2076)
	at svetiGral.main(svetiGral.java:7)
#4 0/7 37,453 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.util.InputMismatchException
	at java.util.Scanner.throwFor(Scanner.java:864)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextInt(Scanner.java:2117)
	at java.util.Scanner.nextInt(Scanner.java:2076)
	at svetiGral.main(svetiGral.java:7)
#5 0/7 35,559 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.util.InputMismatchException
	at java.util.Scanner.throwFor(Scanner.java:864)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextInt(Scanner.java:2117)
	at java.util.Scanner.nextInt(Scanner.java:2076)
	at svetiGral.main(svetiGral.java:7)
#6 0/7 38,125 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.util.InputMismatchException
	at java.util.Scanner.throwFor(Scanner.java:864)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextInt(Scanner.java:2117)
	at java.util.Scanner.nextInt(Scanner.java:2076)
	at svetiGral.main(svetiGral.java:7)
#7 0/7 39,699 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.util.InputMismatchException
	at java.util.Scanner.throwFor(Scanner.java:864)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextInt(Scanner.java:2117)
	at java.util.Scanner.nextInt(Scanner.java:2076)
	at svetiGral.main(svetiGral.java:7)
#8 0/7 38,859 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.util.InputMismatchException
	at java.util.Scanner.throwFor(Scanner.java:864)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextInt(Scanner.java:2117)
	at java.util.Scanner.nextInt(Scanner.java:2076)
	at svetiGral.main(svetiGral.java:7)
#9 0/7 39,828 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.util.InputMismatchException
	at java.util.Scanner.throwFor(Scanner.java:864)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextInt(Scanner.java:2117)
	at java.util.Scanner.nextInt(Scanner.java:2076)
	at svetiGral.main(svetiGral.java:7)
#10 0/7 37,289 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.util.InputMismatchException
	at java.util.Scanner.throwFor(Scanner.java:864)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextInt(Scanner.java:2117)
	at java.util.Scanner.nextInt(Scanner.java:2076)
	at svetiGral.main(svetiGral.java:7)
#11 0/7 37,496 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.util.InputMismatchException
	at java.util.Scanner.throwFor(Scanner.java:864)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextInt(Scanner.java:2117)
	at java.util.Scanner.nextInt(Scanner.java:2076)
	at svetiGral.main(svetiGral.java:7)
#12 0/7 37,367 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.util.InputMismatchException
	at java.util.Scanner.throwFor(Scanner.java:864)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextInt(Scanner.java:2117)
	at java.util.Scanner.nextInt(Scanner.java:2076)
	at svetiGral.main(svetiGral.java:7)
#13 0/8 37,758 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.util.InputMismatchException
	at java.util.Scanner.throwFor(Scanner.java:864)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextInt(Scanner.java:2117)
	at java.util.Scanner.nextInt(Scanner.java:2076)
	at svetiGral.main(svetiGral.java:7)
#14 0/8 38,961 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.util.InputMismatchException
	at java.util.Scanner.throwFor(Scanner.java:864)
	at java.util.Scanner.next(Scanner.java:1485)
	at java.util.Scanner.nextInt(Scanner.java:2117)
	at java.util.Scanner.nextInt(Scanner.java:2076)
	at svetiGral.main(svetiGral.java:7)

Ocenjevani program (svetiGral.java):
import java.util.*;
public class svetiGral {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int stResitev =  0;
		int t[] = new int[n];
		Arrays.fill(t, -1);
		int vsota = 0;
		for(int i = 0; i < n; i++) {
			vsota = i + izracunajStevke(i);
			if(vsota == n) {
				t[stResitev] = i;
				stResitev++;
			}
		}
		
		Arrays.sort(t);
		System.out.println(stResitev);
		for(int i = 0; i < n ; i++) {
			if(t[i] != -1) {
				System.out.println(t[i]);
			}
			
		}
	}
	private static int izracunajStevke(int i) {
		int vsota = 0;
		while(i != 0) {
			vsota += (i % 10);
			i /= 10;
		}
		
		return vsota;
	}
}