This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Los literales almacenados en ‘patata’ y ‘frita’ son iguales? | |
auto patata = 237498123; | |
auto frita = 237499123; | |
// Que variable guarda el numero es mas grande? ‘a’ o ‘valor’? | |
auto a = 237499123; | |
auto valor = 20249472; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ‘patata’ y ‘frita’ no son iguales! | |
auto patata = 237’498’123; | |
auto frita = 237’499’123; | |
// ‘valor’ es menor que ‘a’! | |
auto a = 237’499’123; | |
auto valor = 20’249’472; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto binario = 0b1001’1001; | |
auto octal = 01’234’567; | |
auto decimal = 1’123’567; | |
auto hexadecimal = 0xab’cdef; | |
auto cientifica = 1.602’176’565e-19; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int Baraja[40] = { 0 }; | |
for (int indice = 0; indice < 40; ++indice) | |
{ | |
Baraja[indice] = indice; | |
} | |
std::random_shuffle(std::begin(Baraja), std::end(Baraja)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int CARTAS_EN_BARAJA_ESPANYOLA = 40; | |
int Baraja[CARTAS_EN_BARAJA_ESPANYOLA] = {0}; | |
for (int indice = 0; indice < CARTAS_EN_BARAJA_ESPANYOLA; ++indice) | |
{ | |
Deck[indice] = indice; | |
} | |
std::random_shuffle(std::begin(Baraja), std::end(Baraja)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define PI 3.14159265358979323846f; | |
float SphereVolume(float radius) | |
{ | |
return (4.0f * PI * std::pow(radius, 3.0f)) / 3.0f; | |
} | |
float CilinderVolume(float radius, float height) | |
{ | |
return (2.0f * PI * std::pow(radius, 2.0f) * height); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float SphereVolume(float radius) | |
{ | |
return (4.0f * 3.14159265358979323846f * std::pow(radius, 3.0f)) / 3.0f; | |
} | |
float CilinderVolume(float radius, float height) | |
{ | |
return (2.0f * 3.14159265358979323846f * std::pow(radius, 2.0f) * height); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define CARROT_CAKE “Carrot Cake” | |
const std::string PUMPKIN_CAKE(“PumpkinCake”); | |
void CookCake(const std::string &CakeToCook) | |
{ | |
std::cout << “The “ << CakeToCook << “ is almost Cooked!\n”; | |
} | |
void ServeCake(const std::string &CakeToServe) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(int argc, char **argv) | |
{ | |
// usando #define CARROT_CAKE | |
CookCake(“Carrot Cake”); | |
ServeCake(“Carrot Cake”); | |
EatCake(“Carrot Cake”); | |
// usando const std::string PUMPKIN_CAKE | |
CookCake(PUMPKIN_CAKE); | |
ServeCake(PUMPKIN_CAKE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std::string CONST(“allyourbasearebelongtous”); | |
#define DEFINE “schrodingercat” | |
int main(int argc, char **argv) | |
{ | |
bool Result = false; | |
if (argc == 2) | |
{ | |
std::cout << “\tAccess “; |