编写一个Java代码实现从1到100的连乘
public class MultiplyNumbers {
public static void main(String[] args) {
int result = 1;
for (int i = 1; i <= 100; i++) {
result *= i;
}
System.out.println("The product of numbers from 1 to 100 is: " + result);
}
}
原文地址: https://www.cveoy.top/t/topic/Wi5 著作权归作者所有。请勿转载和采集!