public class Test
{ public static void main (String args[])
{ double sum=0;
for (int i=1; i<100; i++) sum+=i*i;
System.out.println(sum);
}
}
Subscribe to:
Post Comments (Atom)
Was mir so einfällt - auffällt und rausfällt
public class Test
ReplyDelete{ public static void main (String args[])
{ int n=27;
while (n!=1)
{ System.out.println(n);
if (n%2==0) n=n/2;
else n=3*n+1;
}
}
}
public class Test
ReplyDelete{ public static void main (String args[])
{ int a=1,b=1;
for (int i=3; i<=20; i++)
{ int c=a+b;
System.out.println(c);
a=b; b=c;
}
}
}