public class GFD {
public static void main(String[] args) {
// TODO Auto-generated method stub
int x=1;
int sum=0;
while(x<=1000) {
sum=sum+x;
x++;
}
System.out.print("sum="+sum);
}
}
import java.util.Scanner;
public class HJGH {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc= new Scanner(System.in);
int a;
do {
System.out.print("请输入6未的密码:");
a = sc.nextInt();
}while(931567!=a);
System.out.print("登陆成功");
sc.close();
}
}
public class GFDG {
public static void main(String[] args) {
// TODO Auto-generated method stub
int sum=0;
for(int i=2;i<=100;i+=2) {
sum+=i;
}
System.out.print("2到100之间的所有偶数之和为:"+sum);
}
}
public class JYJGJ {
public static void main(String[] args) {
// TODO Auto-generated method stub
int arr[]= {5,13,96};
System.out.println("一堆数组中的元素分别为:");
for(int x:arr) {
System.out.print(x);
}
}
}