publicclassexample1_1{publicstaticvoidmain(String[] args){//定义最终求和数值
int sum =0;//100次循环累加for(int i =1;i<=100;++){
sum = i+sum;}//输出结果
System.out.println("和:"+sum);}
使用for循环进行1-100累加下面展示 样例代码。// by 远赴沧海public class example1_1{ public static void main (String[] args){ //定义最终求和数值 int sum = 0; //100次循环累加 for(int i = 1;i<=100;++){ sum = i+sum; } //输出结果 System.out.println("和:"+sum); }/来自一个编程菜鸟的代码/..