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
// 07.nword.cpp | |
// juanfc 2024-11-15 | |
// | |
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
string wordn(string s, int n); |
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
// substrneg.cpp | |
// juanfc 2024-11-11 | |
// https://gist.github.com/juanfal/fe6f9f7369ff4358c80725781949a6ca | |
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
void tryThis(string s, int from, int end=-1); |
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
// 00.basicArraySubprograms.cpp | |
// juanfc 2024-11-04 | |
// | |
#include <iostream> | |
#include <array> | |
using namespace std; | |
// consts | |
const int N=5; |
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
#include <iostream> | |
#include <array> | |
using namespace std; | |
// | |
const int N = 3; | |
typedef array<int,N> TList; | |
int sum(TList v); |
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
// hanoi.cpp | |
// juanfc 2024-10-23 | |
// | |
#include <iostream> | |
using namespace std; | |
// prototypes | |
int main() | |
{ |
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
// t04e04.amicable.cpp | |
// juanfc 2024-10-23 | |
// amicable numbers | |
// 284 220 | |
// 1210 1184 | |
// 2924 2620 | |
// 5564 5020 | |
// 6368 6232 | |
// https://gist.github.com/juanfal/e235970d086c69b1d87db0a37c02c895 |
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
// t03e3.nprimes.cpp | |
// juanfc 2024-10-23 | |
// | |
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
bool isPrime(int n); |
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
// 01.exp.cpp | |
// juanfc 2024-10-23 | |
// expr series with functions. Two ways | |
// https://en.wikipedia.org/wiki/Taylor_series | |
// https://gist.github.com/juanfal/99504b4df2590c909b91a7ead0e96c5c | |
#include <iostream> | |
using namespace std; | |
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
// l04e01.trianglenum.cpp | |
// juanfc 2024-10-23 | |
// | |
// | |
// \Ej Build a procedure that receives from the main() program the height of the next numerical triangle and prints it: | |
// Height? 11 | |
// 1 | |
// 232 | |
// 34543 |
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
// 02.exp.cpp | |
// juanfc 2024-10-22 | |
// calculate the factorial directly by adding n terms | |
// of its series development | |
// Look at https://en.wikipedia.org/wiki/Taylor_series | |
// https://gist.github.com/juanfal/2b9d94a665b6f730a79a84c98e2d62a6 | |
#include <iostream> | |
using namespace std; |
NewerOlder