Skip to content

Instantly share code, notes, and snippets.

@juanfal
juanfal / t9e08.findArr.cpp
Last active November 16, 2023 11:42
find pos
// t9e08.findArr.cpp
// juanfc 2023-11-14
//
#include <iostream>
#include <array>
using namespace std;
// consts
const int N=3;
@juanfal
juanfal / t9e07.minMaxVec.cpp
Last active November 16, 2023 11:41
min and Max of an array
// t9e07.minMaxVec.cpp
// juanfc 2023-11-14
// https://gist.github.com/juanfal/3a8038ee3859f900784dc2d9ea63a3a6
#include <iostream>
#include <array>
using namespace std;
// consts
const int N=3;
@juanfal
juanfal / t9e06.minVec.cpp
Last active November 16, 2023 11:39
min in an array
// t9e06.minVec.cpp
// juanfc 2023-11-14
//
#include <iostream>
#include <array>
using namespace std;
// consts
const int N=3;
@juanfal
juanfal / t9e05.numbOfNegs.cpp
Last active November 16, 2023 11:38
counting negatives
// t9e05.numbOfNegs.cpp
// juanfc 2023-11-14
// https://gist.github.com/juanfal/574516e1d51ebb9bccf80ea069826c46
#include <iostream>
#include <array>
using namespace std;
// consts
const int N=3;
@juanfal
juanfal / t9e04.scalarProd.cpp
Last active November 14, 2023 17:40
scalar product
// t9e05.numbOfNegs.cpp
// juanfc 2023-11-14
// https://gist.github.com/juanfal/2063ebfcfbbaa329f55eac8b5256bd2e
#include <iostream>
#include <array>
using namespace std;
// consts
const int N=3;
@juanfal
juanfal / t9e03.meanHeights.cpp
Last active November 14, 2023 12:26
mean array
// t9e03.meanHeights.cpp
// juanfc 2023-11-14
// https://gist.github.com/juanfal/b44e62899eda01e781dea850a04ab59a
#include <iostream>
#include <array>
using namespace std;
// consts
const int N=5;
@juanfal
juanfal / t9e02.printArrRev.cpp
Last active November 14, 2023 12:25
print array inverted
// t9e02.printArrRev.cpp
// juanfc 2023-11-14
// https://gist.github.com/juanfal/6c9ced6f813035a93f6500252ed7c86d
#include <iostream>
#include <array>
using namespace std;
// consts
const int N=5;
@juanfal
juanfal / t13e19.distancewords.cpp
Last active November 23, 2023 10:14
distance between repeated words
// t13e19.distancewords.cpp
// juanfc 2023-11-23
// https://gist.github.com/juanfal/fb58e2e244b498d11ddee5df47fef9d8
#include <iostream>
#include <array>
using namespace std;
const int MAX_DIFF_WORDS = 100;
@juanfal
juanfal / t13e17.highestMean.cpp
Last active November 23, 2023 10:10
average of M largest numbers
// t13e17.highestMean.cpp
// juanfc 2023-11-23
#include <iostream>
#include <array>
using namespace std;
// consts
const int MAX = 10;
@juanfal
juanfal / t08e03.balance.cpp
Created November 7, 2023 17:43
balanced string of chars
// t08e03.balance.cpp
// juanfc 2023-11-07
//
#include <iostream>
using namespace std;
int readChars();
int main()