i got it, i just put i=0 in the for loop, so he calculated 1-0 endless in the while loop.
Type: Posts; User: Necator
i got it, i just put i=0 in the for loop, so he calculated 1-0 endless in the while loop.
If i just put ggT(5) in, theres printed nothing,
if i put ggT(5,23) in (2 parameters) then both prints come once so in this case it works perfectly.
public static int ggT(int a, int b) {
System.out.println(3);
while(a!=b){
if(a>b) {
a=a-b;
} else {
b=b-a;
}...
nah, just the while loop itself works, so i guess the problem is within the call of the method.
i just put some in there aswell, it seemed to compile quite right. Also if i test ggT(2,23) (with 2 parameters), so it should take the method named the same (ggT) with 2 parameters, with the while...
ok, i tested it, the problem seems to be in this part
for(int i=0; i<=1000; i++) {
array[i][0] = i;
array[i][1] = ggT(a,i);
any suggestions?
the ggT parts seems...
if i just ggT(5,23), it works properly, so i dont think the while loop is the problem.
its the same result if u just take 10.
So u dont see any problems by checking it?
it compiles, but it doesnt print anything. I just let it calculate for around 2 minutes. Should be enough time for this little work.
Thx for the link to the announcement, just edited it.
Hey guys,
i'm sure u're able to help me. I just tried to fill an array with some numbers, calculated by a other function.
I just tried to print this array as array, but it doesnt work.
Maybe...