1、:/后面的汉字都是注释语句,不用写的1. import java.lang.*;public static void main(String args)int sum=0;for(int i=1;i c System.out.println(“能够构成三角形”);ElseSystem.out.println(“不能够构成三角形”);6 public class Bijiao public static void main(String args) int nums = new int10;for (int i = 0; i numsy+1)temp = numsy ;numsy = numsy
2、+1;numsy+1 = temp;.7 .import java.util.Scanner;public class Test public static void main(String args) Scanner scanner = new Scanner(System.in);int count = scanner.nextInt();if (count = 90) System.out.println(“A“); else if (count = 80 else System.out.println(“E“);.8. public class Pointpublic static v
3、oid main(String args) private int x;private int y;public Point()x=0;y=0;public Point(int x, int y)this.x = x;this.y = y;public void setX(int x)this.x = x;public void setY(int y)this.y = y;public int getX()return x;public int getY()return y; public double Distance(Point p)int diffx = p.getX() - this.x;int diffy = p.getY() - this.y;return Math.Sqrt(diffx * diffx + diffy * diffy);