Par ou нmpar?
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;
}
Listando todos os nъmeros pares e нmpares de uma quantidade escolhida
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;
}
Listando apenas nъmeros pares
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;
}
Listando apenas nъmeros нmpares
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;
}