28.07.2013, 18:04
Isto?
pawn Код:
#include a_samp
//Source
#define potencia(%0,%1) floatround(floatpower(%0,%1))
#define somar(%0,%1) (%0)+(%1)
#define subtrair(%0,%1) (%0)-(%1)
#define multiplicar(%0,%1) (%0)*(%1)
#define dividir(%0,%1) (%0)/(%1)
#define numeropar(%0) !(%0 % 2)
#define numeroimpar(%0) (%0 % 2)
stock parouimpar(n)
{
if(numeropar(n)) printf("%d й um nъmero par.", n);
else if(numeroimpar(n)) printf("%d й um nъmero impar.", n);
return true;
}
//Testes
main()
{
printf ( "%i ^ %i = %d" , 4, 2, potencia(4,2));
printf ( "%i + %i = %d", 4, 2, somar(4,2));
printf ( "%i - %i = %d", 4, 2, subtrair(4,2));
printf ( "%i * %i = %d", 4, 2, multiplicar(4,2));
printf ( "%i / %i = %d", 4, 2, dividir(2,4));
parouimpar(7519);
parouimpar(8788);
}