JAVA
基础
for 循环
java
package src.main.java.art.lmcw;
public class Main {
public static void main(String[] args) {
System.out.print(forLoop(100));
}
public static int forLoop(int n) {
int res = 0;
for (int i = 1; i <= n; i++) {
res += i;
}
return res;
}
}