1.
public class HelloWorld {
public static void main(String []args) {
System.out.println("a a^2 a^3");
int i;
for(i=0;i<4;i++){
int j=1;
System.out.println(j j*j j*j*j);
j++;
}
}
}
2.
package myjava;
public class cy {
public static void main(String[]args)
{
int sum=0;
int i;
for(i=0;i<=9;i++)
{
sum+=i;
}
System.out.println("结果为"+sum);
}
}
3.
package myjava;
import java.math.*;