28.07.2013, 17:44
tem alguma funcao pra calculad ora
#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);
}
tem alguma funcao pra calculad ora
#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)
new
sStringFrm[128]; //altere as cells
format(sStringFrm, sizeof(sStringFrm), "10*1000 = %d", multiplicar(10,1000));
SendClientMessage(playerid, -1, sStringFrm);
new
sStringFrm[128], //altere as cells
a = 10,
b = 1000;
format(sStringFrm, sizeof(sStringFrm), "%i * %i = %d", a, b, multiplicar(10,1000));
SendClientMessage(playerid, -1, sStringFrm);