Skip to content

Instantly share code, notes, and snippets.

@juanfal
juanfal / t11e09.freqString.cpp
Created November 22, 2023 09:20
freq letter in a string
// t11e09.freqString.cpp
// juanfc 2023-11-22
//
#include <iostream>
#include <array>
using namespace std;
typedef array<int,256> TCharFreq;
@juanfal
juanfal / p6e02.getline.cpp
Created November 22, 2023 08:56
string stats
// p6e02.getline.cpp
// juanfc 2023-11-22
//
#include <iostream>
using namespace std;
void stringStat(string s, int& nVow, int& nCons, int& nSpc);
void printStats(string s, int nVow, int nCons, int nSpc);
@juanfal
juanfal / readwords.cpp
Created November 22, 2023 08:35
list of non repeated words
// readwords.cpp
// juanfc 2020-12-14
// A simple case of word reading and simply adding
// non-repeated ones to a list, a simple array
// of strings
//
#include <iostream>
#include <array>
using namespace std;
@juanfal
juanfal / filename.cpp
Created November 22, 2023 08:33
file name from path
// filename.cpp
// juanfc 2022-11-24
//
#include <iostream>
using namespace std;
string fileName(string path);
string fileName2(string path);
@juanfal
juanfal / t9e14.sum2biggest.cpp
Last active November 14, 2023 18:37
sum of 2 biggest in an array
// t9e14.sum2biggest.cpp
// juanfc 2023-11-14
// https://gist.github.com/juanfal/e2735a69938475585381b70ff6bf3a1e
#include <iostream>
#include <array>
using namespace std;
const int N = 5;
typedef array<int,N> TVec;
@juanfal
juanfal / t9e13.malagastats.cpp
Created November 14, 2023 18:31
malaga stats
// t9e13.malagastats.cpp
// juanfc 2023-11-14
// https://gist.github.com/juanfal/656e0030070e0a61c3c544bc059879c0
#include <iostream>
#include <cmath>
#include <array>
using namespace std;
// consts
@juanfal
juanfal / t9e12.stats.cpp
Last active November 16, 2023 11:44
stats mean min max stdev
// t9e12.stats.cpp
// juanfc 2023-11-14
//
#include <iostream>
#include <cmath>
#include <array>
using namespace std;
// consts
@juanfal
juanfal / t9e11.pointsDistance.cpp
Last active November 16, 2023 11:44
distance between 2 points
// t9e11.pointsDistance.cpp
// juanfc 2023-11-14
// https://gist.github.com/juanfal/4b55b90e61369616e051b7d41d727be6
#include <iostream>
#include <cmath>
#include <array>
using namespace std;
// consts
@juanfal
juanfal / t9e10.find12.cpp
Last active November 16, 2023 11:43
find 12
// t9e10.find12.cpp
// juanfc 2023-11-14
// https://gist.github.com/juanfal/0de9ce7af220a1d3fb59a3bb983b7d5d
#include <iostream>
#include <array>
using namespace std;
// consts
const int N=5;
@juanfal
juanfal / t9e09.invertArr.cpp
Last active November 16, 2023 11:42
invert array
// t9e09.invertArr.cpp
// juanfc 2023-11-14
// https://gist.github.com/juanfal/cc28c4728f7179e5e9c90214d09860b0
#include <iostream>
#include <array>
using namespace std;
// consts
const int N=5;