package ser;
public class 奇数之和 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int sum = 0;
for (int i = 1; i <= 100; i++) {
if (i % 2 == 1) {
sum += i;
}
}
System.out.println(sum);
}
}
1-100奇数之和(java)
最新推荐文章于 2023-06-04 06:55:37 发布