Normal
[code=Java]class quersumme { static int method(int x){ int sum=0; int z=1; while (z != 0) { z = x % 10; sum = sum + z; x = x / 10; } if (x < 10) System.out.println(sum); else return x;} public static void main( String[] args){ int x = Integer.parseInt(args[0]); int d; d = method(x);}}[/code]Ich bedanke mich zuerst für deine Antwort . Ich hab laut deiner Antwort das Programm so geändert aber kriege trotzdem wieder die gleiche Fehler (Zeile 13). ???:L
[code=Java]class quersumme {
static int
method(int x){
int sum=0;
int z=1;
while (z != 0) {
z = x % 10;
sum = sum + z;
x = x / 10; }
if (x < 10)
System.out.println(sum);
else
return x;}
public static void main( String[] args){
int x = Integer.parseInt(args[0]);
int d;
d = method(x);
}}[/code]
Ich bedanke mich zuerst für deine Antwort . Ich hab laut deiner Antwort das Programm so geändert aber kriege trotzdem wieder die gleiche Fehler (Zeile 13). ???:L