24.09.2019, 12:58
Par ou нmpar?
Listando todos os nъmeros pares e нmpares de uma quantidade escolhida
Listando apenas nъmeros pares
Listando apenas nъmeros нmpares
PHP Code:
//Par ou нmpar?
#include a_samp
main () {}
new numberChosen = 120;
stock evenOrOdd(number) {
number = number % 2;
if(number == 0)
print("Par");
else
print("Нmpar");
return 1;
}
public OnGameModeInit() {
evenOrOdd(numberChosen);
return 1;
}
PHP Code:
//Listando nъmeros pares e нmpares atй uma quantidade.
#include a_samp
main () {}
new numberChosen = 10;
public OnGameModeInit() {
new contNumber = 0, number;
while(contNumber < numberChosen) {
contNumber++;
number = contNumber % 2;
if(number == 0) printf("%d й par.", contNumber);
else printf("%d й нmpar.", contNumber);
}
return 1;
}
PHP Code:
//Listando nъmeros pares
#include a_samp
main () {}
new numberChosen = 10;
public OnGameModeInit() {
new contNumber = 0, number;
while(contNumber < numberChosen) {
contNumber++;
number = contNumber % 2;
if(number == 0) printf("%d й par.", contNumber);
}
return 1;
}
PHP Code:
//Listando nъmeros нmpares
#include a_samp
main () {}
new numberChosen = 10;
public OnGameModeInit() {
new contNumber = 0, number;
while(contNumber < numberChosen) {
contNumber++;
number = contNumber % 2;
if(number != 0) printf("%d й нmpar.", contNumber);
}
return 1;
}