gpt4 book ai didi

java - 如何在netbeans中打印1到10并打印奇数和偶数?

转载 作者:行者123 更新时间:2023-12-01 15:55:21 25 4
gpt4 key购买 nike

imprimir del 1 al 10 en netbeans必要的数量非常感谢!!!!。

Spanish to English Translation

Question Title: how to print 1 to 10 in net beans and print odd and even numbers thanks for your answers

Question Text: print 1 to 10 in neat beans also need the even and odd numbers thanks !!!!.

最佳答案

西类牙语:

// recorrer todos los números del 1 al 10
for(int i=0; i <=10; i++){
if( i%2 == 0 ) // modulo prueba por pares o impares
System.out.println ( i + " es pares");
else
System.out.println ( i + " es impares");
}

这是什么?

英语:

// loop through all the numbers 1 to 10
for(int i=0; i <=10; i++){
if( i%2 == 0 ) // modulo test for even or odd
System.out.println ( i + " is even");
else
System.out.println ( i + " is odd");
}

这就是你所要求的吗?

关于java - 如何在netbeans中打印1到10并打印奇数和偶数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5186125/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com