This file contains hidden or 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
| // t12e13.chemicalmolecules.cpp | |
| // juanfc 2025-11-18 | |
| // Chemical compounds are made of many identical molecules. A molecule consists | |
| // of a sequence (an array) of elements. These elements are atoms (e.g., Fe, H, | |
| // Ni) repeated in the molecule. An integer indicates how many times that atom | |
| // appears in the molecule. Each element (|TElement|) can therefore be a | |
| // structure storing a string representing the atom (the letter Fe, H, etc.) | |
| // together with its frequency (an integer in the range 1–9). A molecule | |
| // (TMolecule) is then an open array of TElement of these . | |
| // Write a function |TMolecule string2Molec(string s);| that parses the input |
This file contains hidden or 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
| // t14e12.rotate.cpp | |
| // juanfc 2025-11-04 | |
| // https://gist.github.com/juanfal/66dafa705d5fac43f1672315047d1d63 | |
| #include <iostream> | |
| #include <iomanip> | |
| #include <array> | |
| using namespace std; | |
| const int MAX = 5; |
This file contains hidden or 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
| // primeDecomposition.cpp | |
| // juanfc 2025-11-04 | |
| // https://gist.github.com/juanfal/958a9859df5b0452e2063a100f91bb1f | |
| #include <iostream> | |
| #include <array> | |
| using namespace std; | |
| const int N = 10; | |
| struct TPrime { |
This file contains hidden or 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
| // 30.sumtwogreatests.cpp | |
| // juanfc 2025-11-04 | |
| // https://gist.github.com/juanfal/303dd42d4919d12e1a181373c3053c31 | |
| #include <iostream> | |
| #include <array> | |
| using namespace std; | |
| const int N = 5; | |
| typedef array<int,N> TVec; |
This file contains hidden or 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
| // 99.ordenarSelectInsertBub.cpp | |
| // juanfc 2025-11-04 | |
| // | |
| #include <iostream> | |
| #include <cstdlib> | |
| #include <iomanip> | |
| #include <array> | |
| using namespace std; |
This file contains hidden or 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
| // t9e06.minVec.cpp | |
| // juanfc 2023-11-14 | |
| // | |
| #include <iostream> | |
| #include <array> | |
| using namespace std; | |
| // consts | |
| const int N=3; |
This file contains hidden or 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
| // binomial.cpp | |
| // juanfc 2025-11-01 | |
| // | |
| #include <iostream> | |
| using namespace std; | |
| typedef long long unsigned TLong; | |
| int main() |
This file contains hidden or 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
| // ackerman.cpp | |
| // juanfc 2025-11-01 | |
| // ackermann(4, 0) -> 13 | |
| // ackermann(4, 1) -> 65533 | |
| // ackermann(4, 2) -> … 19,729 digits … | |
| // | |
| // https://gist.github.com/juanfal/79ca4e73649a5a0b3fe3fd82923f3e4e | |
| #include <iostream> | |
| using namespace std; |
This file contains hidden or 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
| // gcdr.cpp | |
| // juanfc 2025-11-01 | |
| // Recursive solution of gcd | |
| // gcd(a,b) = gcd(b,a) = gcd(a, a-b) | |
| // gcd(a, 0) = a | |
| // https://en.wikipedia.org/wiki/Euclidean_algorithm | |
| // | |
| #include <iostream> | |
| using namespace std; |
This file contains hidden or 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
| // 01.recread_b.cpp | |
| // juanfc 2025-10-31 | |
| // https://gist.github.com/juanfal/dc57f7a23528927a454d61345e97e570 | |
| #include <iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| void recReadPrint(); |
NewerOlder