blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
117
path
stringlengths
3
268
src_encoding
stringclasses
34 values
length_bytes
int64
6
4.23M
score
float64
2.52
5.19
int_score
int64
3
5
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
text
stringlengths
13
4.23M
download_success
bool
1 class
065a24f2618d29580a94630c4881f054d488ffb1
C++
adamthecreator369/SudokuSolver_
/SudokuSolver/main.cpp
UTF-8
1,166
3.8125
4
[]
no_license
#include <iostream> #include <fstream> #include <vector> #include "Puzzle.h" int main() { // Open file streams. std::ifstream fin("puzzle.txt"); std::ofstream fout("solutions.txt"); // Check input file. if (!fin) { std::cout << "Error - Nonexistent input file."; return -1; } ...
true
b553558349ff5057a0b9492bd4f7d26a71204b1e
C++
CoziestYew804/Projet_Modelisation
/Erreur.h
UTF-8
1,006
3.296875
3
[]
no_license
/** classe Erreur */ #ifndef ERREUR_H #define ERREUR_H using namespace std; #include <string> #include <iostream> #include <exception> class Erreur : public exception { public: string message; Erreur() : message("Erreur !"){} explicit Erreur (const string &messageErreur) : Erreur() { this->message += " " +...
true
62194a8e033707c5f31e5ececcfdd5e043358d7b
C++
Kirby-Vong/Lab7
/main.cpp
UTF-8
741
2.65625
3
[]
no_license
#include <iostream> #include "factory.h" #include "div.hpp" #include "base.hpp" #include "sub.hpp" #include "add.hpp" #include "rand.hpp" #include "op.hpp" using namespace std; int main(int argv, char** argc) { // char* test_array[6]; //test_array[0] = "./calculator"; test_array[1] = "1"; test_array[2] = "+"...
true
245bf3a5168b857ba0d6453bd9cfe53117da3bb6
C++
cedricxie/CarND-Path-Planning-Project
/src/sensor.h
UTF-8
3,328
2.71875
3
[]
no_license
#ifndef ADD_SENSOR_INCLUDED #define ADD_SENSOR_INCLUDED using namespace std; void sensor_processing(vector<vector<double>> sensor_fusion, vector<vector<double>> &sensor_car_list_left, vector<vector<double>> &sensor_car_list_mid, vector<vector<double>> &sensor_car_list_right, double car_s){ //*******************...
true
5419957ebd25b23942f1d8502632b913f5b7d36b
C++
C-Timm/CS_114
/Lab1/MyForm.cpp
UTF-8
1,135
2.640625
3
[]
no_license
#include "MyForm.h" using namespace Lab1; using namespace System; using namespace System::Windows::Forms; [STAThread] void Main(array<String^>^ args) { Application::EnableVisualStyles(); Application::SetCompatibleTextRenderingDefault(false); Lab1::MyForm form; Application::Run(%form); } System::Void MyForm::MyF...
true
22b30895fbb558357c636f0038bae60819b4921d
C++
quee0849/DesignCPPRepo
/mains/PayFactoryMain.cpp
UTF-8
2,774
2.84375
3
[]
no_license
// // // payfactorymain.cpp // // /* Uses PayOff3.cpp PayOffBridge.cpp PayOffFactory.cpp PayOffRegistration.cpp */ #include <PayOff3.h> #include <PayOffConstructible.h> #include <PayOffBridge.h> #include <PayOffFactory.h> #include <SimpleMC8.h> #include <string> #include <iostream> us...
true
6d1bed6dfcc1aee6f607a90bd17e6e80cd60d375
C++
Mehulcoder/Leetcode
/3455.cpp
UTF-8
757
2.75
3
[]
no_license
class Solution { public: Solution() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } string getHint(string secret, string guess) { unordered_multiset<char> s, s2; for (int i = 0; i < secret.size(); ++i) { s.insert(secret[i]); s2.insert(guess[i]); } int a = 0, b = 0; for (int i =...
true
d1edd8a64810241ac060f1b5d1ae244d027d2133
C++
cuber2460/acmlib07
/code/kamil/hull_kocium.cpp
UTF-8
2,121
2.59375
3
[]
no_license
// hull online inline TYP operator^(const P& a,const P& b){return real(a)*imag(b)-real(b)*imag(a);} inline TYP skret(const P& a,const P& b,const P& c){return ((c-a)^(b-a));} namespace Hull { P sr; int cw(const P& l) { TYP a = real(l), b = imag(l); if (b >= 0) return a >= 0 ? 1: 2; else return a <= 0 ? 3 : ...
true
628e92bae044cab095e388256024bf51f863615e
C++
codepongo/poll-windows
/examples/connect-fail.cpp
UTF-8
2,933
2.71875
3
[]
no_license
#include <stdio.h> #include <WinSock2.h> #include "poll.h" // // Taken from: https://curl.haxx.se/mail/lib-2012-07/0311.html // void TestSocketConnection(const char* aIPAddress, USHORT aPortNumber, INT aTimeout) { SOCKET lSOCKET = socket(AF_INET, // 2, // family ...
true
f68875491708b3164974f833349348c29ead2615
C++
MijaelTola/icpc
/pacificNorth18/solutions/LatinSquares/latinsquares_tgr.cpp
UTF-8
868
2.78125
3
[]
no_license
#include <iostream> #include <algorithm> #include <string> #include <vector> using namespace std ; int main() { int n ; cin >> n ; vector<string> b(n) ; for (int i=0; i<n; i++) cin >> b[i] ; string base = b[0] ; sort(base.begin(), base.end()) ; int islatin = 1 ; int isreduced = 1 ; if (...
true
51c673e18e8d9ef74f39205258f9e6a5a89daef7
C++
mggavrilov/OOP-FMI-2016
/OOP_project_1_SI_1_2_61937/include/Flat.h
UTF-8
487
2.78125
3
[]
no_license
#ifndef FLAT_H #define FLAT_H #include "Estate.h" class Flat : public Estate { public: Flat(); Flat(string city, string address, string owner, double price, double area, int rooms, int floor); virtual ~Flat(); int getRooms() const; int getFloor() const; void setRoo...
true
8ad44af72ffb970c91895c8b032602d9a2e1b399
C++
vector9x4/cstart
/001_C_프로그램_시작하기.cpp
UTF-8
357
2.734375
3
[]
no_license
#include <stdio.h> int main(void) { printf("Hello Wrold"); } /* C 프로그램은 main 함수에서 시작되어 main 함수로 끝남. 따라서 반드시 하나의 main 함수를 포함해야 한다!! 곧, 다시 말해 main 함수 하나만으로 프로그램을 만들 수 있다! 한 함수의 시작과 끝은 중괄호 {}로 표시한다. */
true
d359b285dc013e1ca8309369eecbc147375aab72
C++
icrelae/cpp_primer
/3-string_vector_array/3.42_vector&array.cpp
UTF-8
379
3.390625
3
[]
no_license
/* 2016.09.18 23:40 * P_112 * copy vector to array */ #include <iostream> #include <vector> int main(int argc, char **argv) { int array[10] = {-1}; std::vector<int> vec = {0, 1, 2, 3, 4, 5}; for (std::vector<int>::size_type i = 0; i < vec.size(); ++ i) { array[i] = vec[i]; } for (int *p = array; p != std::...
true
3cd065b576eb224bca5fe72e11fb5ec280816330
C++
usernamegenerator/leetcode
/LeetCodeCNExplore/leetcodeCNeasy/math/326isPowerOfThree.cpp
UTF-8
890
3.671875
4
[]
no_license
// https://leetcode-cn.com/explore/interview/card/top-interview-questions-easy/25/math/62/ /* 3的幂 给定一个整数,写一个函数来判断它是否是 3 的幂次方。 示例 1: 输入: 27 输出: true 示例 2: 输入: 0 输出: false 示例 3: 输入: 9 输出: true 示例 4: 输入: 45 输出: false 进阶: 你能不使用循环或者递归来完成本题吗? */ class Solution { public: /* bool isPowerOfThree(int n) { ...
true
5529f9ed48a60110389efefe052ef64d029f03d1
C++
BBekker/teensyclock
/rtctiming.ino
UTF-8
1,230
2.625
3
[ "MIT" ]
permissive
#include <Time.h> #include <TimeLib.h> /////////// // RTC FUNCTIONS ////////// byte bcd2byte(byte bcd) { return (bcd & 0x0F) + ((bcd >> 4) *10); } byte bin2bcd(byte val) { return (val % 10) + ((val / 10) << 4); } //Update the external RTC void updateRTC(unsigned int _year,unsigned int _month,unsigned int _day,u...
true
899e51348ad80998ed7351c258c396623df5e18b
C++
Eng-RSMY/PorousMediaAnalysis
/Core/Headers/StlUtilities.h
UTF-8
12,856
3.171875
3
[ "MIT" ]
permissive
// Copyright (c) 2013 Vasili Baranau // Distributed under the MIT software license // See the accompanying file License.txt or http://opensource.org/licenses/MIT #ifndef Core_Headers_StlUtilities_h #define Core_Headers_StlUtilities_h #include <algorithm> #include <vector> #include "VectorUtilities.h" #include "Types....
true
050582705766c3b146d3be95e4b8b23e4665f4c5
C++
vadyacj/laba1
/lab8.cpp
UTF-8
4,426
3.25
3
[]
no_license
//Выделить слова из строк и записать их в массив. //Необходимо рассортировать массив слов по их длинам. #include <stdio.h> #include <stdlib.h> #include <malloc.h> void tolower(char* text, int n); void tohigher(char* text, int i); int main() { system("chcp 1251"); system("cls"); int i = 0, j = 0, n, k = ...
true
8c8f339bc3c9878c7937966cb6ff1d6d16bc80a6
C++
MiguelTornero/School
/Programming Fundamentals (C++)/RationalOperation/main.cpp
UTF-8
1,704
3.625
4
[]
no_license
#include <iostream> using namespace std; int iNumerator1, iDenominator1, iNumerator2, iDenominator2; char cOperation; int GCD (int x, int y) { if (y == 0) { return x; } return GCD(y, x%y); } void rationalOperation() { bool bValidCharacter = true; int iResultNumerator, iResultDenominator...
true
b76a73d01b36b54cf856bd083256f9de882a19ff
C++
VorkovN/Mini-Country
/Factory/include/FreightTrain.h
UTF-8
251
2.625
3
[]
no_license
#pragma once #include "CarsTypes.h" #include "City.h" #include "Train.h" class FreightTrain : public Train { public: FreightTrain(CarsTypes::Types cars_type, size_t cars_count); void move(City* city1, City* city2, size_t cars_count) override; };
true
903b37fb56f8873ea8548f7410d4956719a95698
C++
wobuchiroubao/paraCL
/lexer.h
UTF-8
5,640
2.734375
3
[]
no_license
#pragma once #include <cctype> #include <cstdlib> #include <map> #include <memory> #include <string> #include <utility> #include <vector> #include "types_decl.h" namespace cplr { static const std::map<std::string, node_t> keyW_s = { {"print", node_t::PRINT}, {"if", node_t::IF}, {"else", node_t::ELSE}, {"do...
true
14025cc7308484ece421193a24310e035b25d35a
C++
nfinnity/RPNCalculator
/dc.cpp
UTF-8
8,868
3.890625
4
[]
no_license
#include <cstdlib> #include <cctype> #include <iostream> #include <cstring> #include "stack.h" using namespace std; Stack<int> dc(20); /*-------------------------------------------- methodP() Pre: Nothing is printed to the screen. Post: Checks to see if the stack is empty. If it is not, then the ...
true
5f1cba4e8ffc4d43850ffed6c504dc9aa3fce100
C++
larrydalaw/IntelligentHome
/src/starencryption.h
UTF-8
845
2.890625
3
[]
no_license
#ifndef STARENCRYPTION_H #define STARENCRYPTION_H #include <QString> class StarEncryption { public: StarEncryption(); ~StarEncryption(); QString stringEncrypt(const QString &content, QString key);//加密任意字符串,中文请使用utf-8编码 QString stringUncrypt(const QString &content_hex, QString key);//解密加密后...
true
87dc83f31ef4a70355867bbaf88738f7a50e4328
C++
Bluscream/TS3PatchExtensions
/versionSpoofer/QtConfig.cpp
UTF-8
2,723
2.65625
3
[]
no_license
#include "QtConfig.h" #include "config.h" int getIndex(vector<pair<string, string>> vec, string value) { for (int i = 0; i < vec.size(); i++) { pair<string, string> pair = vec[i]; if (pair.first == value || pair.second == value) return i; } return 0; } QtConfig::QtConfig(QWidget *parent) : QMainWindow(pa...
true
ab6134e8f400598e9a34a81e8c35237a9cdb7a5b
C++
Creativeguru97/YoneLab
/PandaIslandIcedTea/heartrateSensorToArduino/heartrateSensorToArduino.ino
UTF-8
1,686
2.578125
3
[]
no_license
int pin = A0; unsigned char counter; unsigned long beatTimes[21]; unsigned long sub; unsigned int heart_rate = 0; unsigned int prev_heart_rate = 0; bool data_isValid = true; const int max_heartpulse_duty = 2500; void setup() { pinMode(pin, INPUT); // pinMode(start,INPUT_PULLUP); Serial.begin(115200); attachInt...
true
2db40203caf9a88f260a51145aa217971fbdd39e
C++
nickjfree/renderer
/Engine/Rendering/RenderPassShadowMap.h
UTF-8
2,170
2.59375
3
[]
no_license
#ifndef __RENDER_PASS_SHADOWMAP__ #define __RENDER_PASS_SHADOWMAP__ /* * do shadow map rendering. */ auto AddShadowMapPass(FrameGraph& frameGraph, RenderContext* renderContext) { constexpr auto max_shadow_maps = 8; typedef struct PassData { // shadow maps RenderResource shadowMaps[8]; }PassData; auto ren...
true
6d8b6871ad97843f345dedce0d1d0dd296665470
C++
bstatcomp/math
/stan/math/prim/err/check_cholesky_factor_corr.hpp
UTF-8
1,704
2.859375
3
[ "BSD-3-Clause", "GPL-2.0-only", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
#ifndef STAN_MATH_PRIM_ERR_CHECK_CHOLESKY_FACTOR_CORR_HPP #define STAN_MATH_PRIM_ERR_CHECK_CHOLESKY_FACTOR_CORR_HPP #include <stan/math/prim/meta.hpp> #include <stan/math/prim/fun/Eigen.hpp> #include <stan/math/prim/err/check_positive.hpp> #include <stan/math/prim/err/check_lower_triangular.hpp> #include <stan/math/pr...
true
fdca4b8704e5c898139f6f3b0d6f9563fed29eed
C++
Stan994265/PCL-ICP-NDT
/pcl_ndt.cpp
UTF-8
5,648
2.546875
3
[]
no_license
#include <iostream> #include <string> #include <pcl/io/pcd_io.h> #include <pcl/io/ply_io.h> #include <pcl/point_types.h> #include <pcl/registration/ndt.h> #include <pcl/filters/approximate_voxel_grid.h> #include <pcl/visualization/pcl_visualizer.h> #include <boost/thread/thread.hpp> #include <pcl/console/time.h> typ...
true
336f28751a43b59c213b84e02cecb0a323cca294
C++
mir-mirsodikov/An-Introduction-to-Programming-with-CPP
/chap 7/Chapter 7 Test - Question 1/Chapter 7 Test - Question 1/Source.cpp
UTF-8
206
2.828125
3
[]
no_license
//Mukhammad Mirsodikov - P2 #include <iostream> using namespace std; int main() { int num = 5; while (num <= 100) { cout << num << " "; num += 5; } cout << endl; system("pause"); return 0; }
true
5ba8243c69aa86b7437aeaaa8e2c48800d74cc98
C++
agapow/mesa-revenant
/src/TabDataReader.cpp
UTF-8
14,245
2.828125
3
[]
no_license
/** @file @author Paul-Michael Agapow Dept. Biology, University College London, WC1E 6BT, UK. <mail://p.agapow@ic.ac.uk> <http://www.agapow.net/code/sibil/> Part of MeSA <mail://mesa@agapow.net> <http://www.agapow.net/software/mesa/>. */ // *** INCLUDES #include "TabDataRe...
true
98624ac289ad46d94e63921b9a3801d208b39f3e
C++
obapa/MIPS_processor
/main.cpp
UTF-8
1,611
2.6875
3
[]
no_license
#include "processor.h" //for processor class #include "IO.h" //header for ioFile struct #include "ect.h" #include <iostream> #include <fstream> //filestream #include <sstream> //stringstream #include <string> //strings //TODO branching issue int main() { std::string x; bool debug = true; processor MIP...
true
71f8d49191593f0c7a1bb61a22c3412311411103
C++
jonasvm/piratas-futuro-rpg
/aluno/solucoes/63_13.cpp
ISO-8859-1
537
3.078125
3
[]
no_license
/*Para seu azar sua bolsa rasgou e voc s percebeu ao ter atravessado a floresta toda. Muitos itens seus caram pelo caminho. Agora ter que fazer todo o caminho contrrio para encontr-los novamente. No total a floresta tem uma rea de 30x50km. Voc sabe que existe um item a cada 60,6Km2. Vasculhe toda a rea e descubra qua...
true
821954a44f69007a02ac74bb4c99182b33dd4cd0
C++
rdchan/CS2337work
/InClass2/include/Document.h
UTF-8
531
2.828125
3
[]
no_license
/* Rishi Chandna (rdc180001) Louis Fernandes (lef180000) */ #ifndef DOCUMENT_H #define DOCUMENT_H #include <string> #include <iostream> using namespace std; class Document { public: Document(); Document(string); virtual ~Document(); std::string Getcontent() const { return c...
true
570e5d5b93f52e1c7f1401ff10a1e55a3a0e91d3
C++
adityalahiri/CPP-Code
/partialMax_csAcad.cpp
UTF-8
1,430
3.796875
4
[]
no_license
#include <iostream> #include <bits/stdc++.h> using namespace std; class Graph{ int V; std::vector<int> *adj; int cycle_flag = 0; int reached = 0; //private by default void DFSUtil(int v, bool visited[], int parent, int dest); public: Graph(int V); void addEdge(int v, int w); void DFS(int v, int d...
true
e19d1eadd3ec435796843ce8e889524d47dfd12b
C++
zhengjinwei123/cplusplus
/recastnav/src/Aoi/point2i.cpp
UTF-8
383
2.734375
3
[]
no_license
#include "Aoi/point2i.h" namespace aoi { Point2i::Point2i() { } Point2i::Point2i(int X, int Y) : x(X), y(Y) { } bool Point2i::operator==(const Point2i &other) const { if (x == other.x && y == other.y) return true; return false; } bool Point2i::operator!=(const Point2i &other) const { if (x !=...
true
13aa13776c4bed5a40a816dd4a42eb9b3d0111b1
C++
hverlin/lutin
/src/symboles/BlocDeclaration.h
UTF-8
977
2.84375
3
[]
no_license
#ifndef LUTIN_BLOCDECLARATION_H #define LUTIN_BLOCDECLARATION_H #include <TableDesSymboles.h> #include "Symbole.h" class BlocDeclaration : public Symbole { public: BlocDeclaration() : Symbole(BLOC_DECLARATION), suivant(nullptr) { } void setSuivant(BlocDeclaration *blocDeclaration) { this->suivant...
true
90bf97869d13141bd1c2297864f22381fa5c8246
C++
ann234/PJH_BaekJoon
/Dynamic_Programming/main_2579.cpp
UHC
816
3.515625
4
[]
no_license
#include <iostream> #include <vector> using namespace std; int max(int a, int b) { return (a > b) ? a : b; } int main() { int N; cin >> N; vector<int> points(N + 1); for (int i = 1, val; i <= N; i++) { cin >> val; points[i] = val; } // step continuity, point // ¿ ִ ִ int** memory = new int*[N + 1...
true
f36983bcf1cf9eb521887547dc29142ee665a70a
C++
z1908144712/ExamCode
/剑指Offer/剑指 Offer 46. 把数字翻译成字符串/main.cpp
UTF-8
529
3.21875
3
[]
no_license
#include <iostream> using namespace std; class Solution { public: int cnt = 0; int translateNum(int num) { translateNumHelper(num); return cnt; } void translateNumHelper(int num) { if (num < 10) { cnt++; return; } translateNumHelper(num /...
true
f3e0339145962ed15c7ccd39559e3ce08ee62244
C++
ahmetberber/CSE241-FALL-2019
/HW04/functions.cpp
UTF-8
15,033
3.359375
3
[]
no_license
/* Ahmet Hilmi Berber */ /* 171044027 */ /* CSE241 HW04 */ #include <iostream> #include <vector> #include <string> #include "functions.h" using namespace std; namespace global { const unsigned int MAXCOURSELIMIT = 3; const unsigned int STARTHOUR = 9; ...
true
c02851f267e12516c009bc245f28e9ac2028c661
C++
WhiZTiM/coliru
/Archive2/fd/3c55446bba3283/main.cpp
UTF-8
187
2.640625
3
[]
no_license
#include <iostream> #include <string> #include <sstream> int main(){ std::string x = "123.456"; double y; std::istringstream ss(x); ss >> y; std::cout << y << '\n'; }
true
2bdff13deb03338a2d903f4bce469e0ce1b23018
C++
aureus5/CPPproject
/AirplaneSensorCPPproject/ConstantSignal.h
UTF-8
316
2.5625
3
[]
no_license
#ifndef PROJECT2_CONSTANTSIGNAL_H #define PROJECT2_CONSTANTSIGNAL_H #include "Signal.h" #include "Time.h" namespace Project2 { class ConstantSignal:public Signal { public: ConstantSignal(double voltageOffset, Time &timeOffset); virtual double getVoltageAtTime(Time &t) const; }; } #endif
true
fca9cc01bdb86634289e42936c4a327af74950d6
C++
thekid123/FractionFile
/fraction.hpp
UTF-8
1,574
3.578125
4
[]
no_license
/************************************************************************* Blessing Alagba v223e376 Program 3 Description: This program implements a Fraction class it consists of the numerator and denominator It asks the user to enter two fractions and it calculates 7 options which is Add...
true
11e114bb236552128d6425c6f5665047a6d987b8
C++
pulkkinho/islandgame
/UI/gamestate.cpp
UTF-8
1,478
2.703125
3
[]
no_license
#include "gamestate.hh" #include "iostream" #include "igamerunner.hh" GameState::GameState(): Common::IGameState() { } enum GamePhase { MOVEMENT = 1, SINKING = 2, SPINNING = 3 }; GameState::~GameState() { } Common::GamePhase GameState::currentGamePhase() const { return _gamePhaseId; } int GameState::cur...
true
78fdd1cf81729b2f750b107a754b1106ec1e4a23
C++
hyunmock/modern_cpp
/rvalue.cpp
UTF-8
424
3.375
3
[]
no_license
#include <iostream> #include <string> void printString(const std::string & str) { std::cout<<str<<std::endl; } void printString(std::string && str) { std::cout<<str<<std::endl; } int main() { const std::string & lvalRef = std::string("hello"); std::string && rvalRef = std::string("world"); std::cout<<lvalRe...
true
eb1537364a1e84ec356dcc44c2666622323bc3bb
C++
andrewkpeterson/3d-engine
/src/platformer/PlatformerApplication.cpp
UTF-8
617
2.515625
3
[]
no_license
#include "PlatformerApplication.h" #include "PlatformerGameplayScreen.h" #include "PlatformerStartScreen.h" PlatformerApplication::PlatformerApplication() : Application() { m_screenmap["gameplay"] = std::make_shared<PlatformerGameplayScreen>(this); m_screenmap["start"] = std::make_shared<PlatformerStartScr...
true
f0f310a542a76ee5f017403de6232b07fff15cf7
C++
dmalec/wumpus-for-picosystem
/game_types.hpp
UTF-8
341
2.546875
3
[ "MIT" ]
permissive
// Copyright(c) 2021 Dan Malec // // MIT License (see LICENSE file for details) #ifndef GAME_TYPES_HPP_INCLUDED_ #define GAME_TYPES_HPP_INCLUDED_ struct GamePoint { uint8_t x; uint8_t y; }; enum GameWall { NONE = 0x0000, WEST = 0x0001, NORTH = 0x0010, EAST = 0x0100, SOUTH = 0x1000 }; #endif // G...
true
55637bfd1ba89754eaf7b7ca57fd87b8dfb2cd6c
C++
sakharlina/PSTU_labs
/Лабораторная работа №18/Lab18.7/Class7_main.cpp
UTF-8
716
3.15625
3
[]
no_license
#include "Pair.h" #include "List.h" #include <iostream> using namespace std; void main() { cout << "SPISOK:\n"; List<int>A(5, 0); cin >> A; cout << A << endl; List<int>B(10, 1); cout << B << endl; B = A; cout << B << endl; cout << A[2] << endl; cout << "size = " << A() << endl; B = A + 10; cout << B << e...
true
1fb275540463cc84cc62437f210ebdc4d258428e
C++
Sameer-Arora/csl201
/Assignment3/main.cpp
UTF-8
1,469
3.25
3
[]
no_license
#include <iostream> #include <fstream> #include "mavl1.hpp" using namespace std; int main(){ MAVLTree tree; ifstream f; int k; string s; f.open("entries.txt"); f >> k >>s; //tree.insert(k,s); while(!f.eof()){ tree.insert(k,s); // tree.print(); f>>k>>s; // cout<<endl; } int choice=0; string val; i...
true
15a3993b0bac45b86899fc0c44c0900f69021579
C++
Gurman8r/arduino
/libraries/Timer/Timer.cpp
UTF-8
1,023
2.984375
3
[]
no_license
/* Timer.cpp * Author: Melody Gurman * Modified: 11/11/2018 * * * * * * * * * * * * * * * */ #include <Timer.h> #if defined(ARDUINO) #include <Arduino.h> #define DELTA_TIME millis #endif Timer::Timer() : m_paused(true) , m_elapsed(0) , m_max(0) , m_min(0) { } Timer::Timer(const Timer & copy) : m_paused(co...
true
25e780cbf6b5231e2fa250b1dc19ef52c4272571
C++
Nikhil-Vinay/DS_And_Algo
/Daily_Coding_Problem/find_word_in_matrix.cpp
UTF-8
1,913
3.671875
4
[]
no_license
/********* There is a given matrix, find a word in the matrix, if present return true **************/ /** Note: Word can be present in 8 directions - Left->Right, Right->Left, Top->Bottom, Bottom->Top, Top-Right(diagonal), Top-Left(Diagonal), Bottom-Right(Diagonal), Bottom-Left(Diagonal). */ /* In the below solution ...
true
b3025d837596a896e7249e55ab4f106d3f31cb34
C++
northmatt/Math-Modules
/First Project/First Project/Vector.cpp
UTF-8
4,080
3.6875
4
[]
no_license
#include "Vector.h" vec2::vec2() { } vec2::vec2(float _x, float _y) { x = _x; y = _y; } void vec2::Subtract(vec2 v2) { this->x -= v2.x; this->y -= v2.y; } void vec2::MultScalar(float s) { this->x *= s; this->y *= s; } void vec2::DivScalar(float s) { this->x /= s; this->y /= s; } f...
true
7976f34d225cd91f19af31ca242ae4a4f91da737
C++
DevTown/LackEnclosureControler
/_3DDruckerLichtundTempSteuerung/_3DDruckerLichtundTempSteuerung.ino
UTF-8
2,952
2.875
3
[]
no_license
#include <Arduino.h> /********************************************************************/ // First we include the libraries #include <OneWire.h> #include <DallasTemperature.h> #include <Wire.h> #include <LiquidCrystal_I2C.h> /********************************************************************/ // Data wire is plugg...
true
d4f089a7721f02ff864cf93fb8bd36a1ec746f71
C++
seojimin/c-plus-plus-language
/workshop/WS08/in_lab/SavingsAccount.cpp
UTF-8
1,284
3.34375
3
[]
no_license
// Workshop8 in_lab : cpp file // Name : Jimin Seo // Seneca E-mail : jseo22@myseneca.ca // Student number: 145803169 #include <iostream> #include "SavingsAccount.h" using namespace std; namespace sict { // Default constructor SavingsAccount::SavingsAccount() { interRate = 0.0; } //constructor receives a ...
true
f68bad42d980d22e84808d3631729b285d1972a4
C++
ewiggestriger/SSSQsim
/Entity.cpp
UTF-8
976
3.03125
3
[]
no_license
/* * Implementation for the Entity class. * * Created by Steve Kostoff on 2019-03-25. */ #include "Entity.h" int Entity::_nextID = 1; Entity::Entity(Time arrivalTime) { //assign a unique id to the entity and increment the id counter _id = _nextID++; //log the entity arrival time _arrivalTime = ar...
true
f8f2efa75dab8802b593793636698460c04a92ca
C++
benbenliu/Data-Structure-Code
/evil hangman/src/Hangman.h
UTF-8
903
3.03125
3
[]
no_license
/*This is the class definition of a hangman game object*/ #ifndef _hangman_h #define _hangman_h #include <unordered_map> #include <vector> #include <string> #include <iostream> #include <fstream> #include <set> using namespace std; class Hangman{ public: Hangman(string & dictionary); void updateCurrentList(); voi...
true
32b7d3b00a6e69f05eba9d62340ddf31c06c0808
C++
alexandraback/datacollection
/solutions_5658282861527040_1/C++/AlexAntonov/solution.cpp
UTF-8
1,052
2.953125
3
[]
no_license
#include <vector> #include <string> #include <map> #include <unordered_map> #include <fstream> #include <algorithm> #include <cassert> #include <iostream> #include <cstdint> using namespace std; struct Case{ int a, b, k; int64_t Solve() { if (a <= k || b <= k) return int64_t(a)*b; int64_...
true
86a2ad16b960e6d40654f2d69054472b4c6b3d95
C++
rafam1899/ZooApplication
/ZooApplication/src/sources/model/Client.cpp
UTF-8
459
2.609375
3
[]
no_license
/* * Client.cpp * * Created on: 08/06/2021 * Author: Tiago Oliveira */ #include "Client.h" int Client::NUMBER = 0; Client::Client(int recint) { this->number = ++NUMBER; this->recintVisited = recint; } Date Client::getDate() { return date; } void Client::setDate(int day, int month, int year) { this...
true
a76d4741b650b6e4545b54336735ff6d7fe2c98b
C++
elite-sheep/icpcarchive
/math/scut2017H.cpp
UTF-8
939
2.5625
3
[]
no_license
/************************************************************************* > File Name: scut2017H.cpp > Author: Yuchen Wang > Mail: wyc8094@gmail.com > Created Time: Sun Apr 30 13:27:51 2017 ************************************************************************/ #include<iostream> #include<cstdio> ...
true
fbd18589dcd42db529251497a5c044e59a0ed134
C++
dmytrofrolov/Cpp
/Mega_project_list/01_Numbers/13_Distance_Between_Two_Cities/main.cpp
UTF-8
1,599
3.953125
4
[]
no_license
// Distance Between Two Cities - Calculates the distance between // two cities and allows the user to specify a unit of distance. // This program may require finding coordinates for the cities like latitude and longitude. // Dmytro Frolov #include <iostream> #include <cmath> const float EARTH_RADIUS = 6371; const doub...
true
6dd86e7715a02d3591fceef60b7417d979eecc11
C++
worldofjoni/friendlyConsole
/friendlyConsole/friendlyConsole.cpp
UTF-8
7,656
3.140625
3
[ "BSD-3-Clause" ]
permissive
// ################################################################# // # Library to easily change console colours and much more # // # by Jonatan Ziegler # // ################################################################# #pragma once #include "friendlyConsole.hpp"...
true
27c136217aca0e96c87095fb08b46417b627c3d2
C++
REDE453/Practice
/test5/test5/test.cpp
GB18030
753
3.640625
4
[]
no_license
//һöжϸöǷƽ //ֻҪƽԣҪDz class Solution { public: int Depth(TreeNode* pRoot) { if (pRoot == nullptr) return 0; int leftDepth = Depth(pRoot->left); int rightDepth = Depth(pRoot->right); return leftDepth > rightDepth ? leftDepth + 1 : rightDepth + 1; } bool IsBalanced_Solution(TreeNode* pRoot) { if (pRoot == ...
true
9fea67f07d4554a6014f15673996f4fa5ae4b51b
C++
suhasjvrundavan/Data-Structures-Algorithm-in-CPP
/Mathemetics/printPrimeFactors.cpp
UTF-8
1,777
3.5625
4
[]
no_license
Sample Input: 12 Sample Output: 2 2 3 Solution: Naive Solution: #include <bits/stdc++.h> using namespace std; bool isPrime(int n) { if(n==1) return false; if(n==2 || n==3) return true; if(n%2 == 0 || n%3 == 0) return false; for(int i=5;i*i<=n;i=i+6...
true
76259608a5c8ff369e412ce9e71e7db24f229fde
C++
FlandiaYingman/15-year-old-Konjac-wants-to-learn-OI
/15-year-old-Konjac/resolved/luogu/1032.cpp
UTF-8
2,053
3.15625
3
[]
no_license
//P1032 字串变换 #include <iostream> #include <string> #include <queue> #include <vector> #include <algorithm> #include <set> #include <fstream> using namespace std; struct transform_rule { string from, to; }; struct transform_string { string val; int transform_times; }; vector<transform_string> transform(...
true
4421c730dc8d7e88476f3c8212e7de4443ec4d90
C++
WYX11111/Data-Structures
/中缀表达式/中缀.cpp
GB18030
5,046
3.671875
4
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <string.h> #define TRUE 1 #define FALSE 0 #define STACK_INIT_SIZE 100 typedef struct { double *elem; int top; int stacksize; } NUMStack; typedef struct { char *elem; int top; int stacksize; } CHARStack; void InitStack_NUM(NUMStack &S, int maxsize ...
true
3a2ee024ea94ce34819a1bc547c94c448a850cbe
C++
alu0100769609/aedaP1
/hpp/Queue.hpp
UTF-8
826
3.5625
4
[]
no_license
#include "Node.hpp" class Queue { private: Node* first_; //Pointer to the first element Node* last_; //Pointer to the last element public: Queue(void); //Constructor ~Queue(void); //Destructor bool empty(void); ...
true
c165946567a4083cb7ab78f96f23d6445b334615
C++
BadHatHoffman/CSC195
/Containers/main.cpp
UTF-8
2,648
3.609375
4
[]
no_license
// Containers.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> #include <array> #include <vector> #include <string> #include <list> #include <algorithm> using namespace std; typedef float currency; //using currency = double; void print(int* n, size_t count...
true
30997d9febd0da4070732ab93380cbacda4a8698
C++
Philpo/Cork
/src/Cork/Cork/CollisionResolver.h
UTF-8
738
3
3
[]
no_license
#pragma once #include <functional> #include "GameObject.h" #include "Message.h" typedef std::function<void(const GameObject&, const GameObject&)> ResolvingFunction; /** * static class to be handle collision resolution * reolving function must be passed in before use */ class CollisionResolver { public: CollisionRes...
true
5a4252a2afc18ed3d8e1df862bfcd6d8e4472c83
C++
Liurunex/Leetcode
/437_Path Sum III.cpp
UTF-8
815
3.40625
3
[]
no_license
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: int pathSum(TreeNode* root, int sum) { if (!root) return 0; int left_root = pathSum(root->lef...
true
fd436fabd75143cf66f3f790939668206efb2ac2
C++
inbei/libutl
/ubc/HostOS.h
UTF-8
3,800
2.53125
3
[ "MIT" ]
permissive
#pragma once //////////////////////////////////////////////////////////////////////////////////////////////////// #include <libutl/Array.h> #include <libutl/Pathname.h> //////////////////////////////////////////////////////////////////////////////////////////////////// UTL_NS_BEGIN; ///////////////////////////////...
true
3372ac0b78dfe67d5855e0c3a84843c1ae20486a
C++
tanmay777/DSA-Implementations
/DynamicProgramming/fibonacci_dp.cpp
UTF-8
526
2.921875
3
[]
no_license
#include<iostream> #include<string> using namespace std; long memo[1000]; long fib(long n){ /* if(n==0) return 0; if(n==1) return 1; if(memo[n]!=-1) { return memo[n]; } long ans= (fib(n-1)+fib(n-2)); memo[n]=ans; return ans;*/ int dp[1000]={0}; dp[0]=0; dp[1]=1; ...
true
7e53304a4aee5524a43990a86c150b6cfe9c42e9
C++
alessioprestileo/ALEPCAD
/shaderhelper.cpp
UTF-8
774
3
3
[]
no_license
#include "shaderhelper.h" ShaderHelper::ShaderHelper() {} // Read a shader source from a file, // store the shader source in the input buffer // and return reference to the buffer const char* ShaderHelper::readShaderSrc(const char *pathToShader, std::vector<char> &buffer) { QFile ...
true
b3b21bc064908bcc421e3a01aca628cd53ef2c91
C++
jk983294/CommonScript
/cpp/lib/gbench/multi_argument_bench.cpp
UTF-8
1,556
3.125
3
[]
no_license
#include <benchmark/benchmark.h> #include <vector> using namespace std; void transpose(vector<int> &matrix, int row, int column) { for (int i = 0; i < row * column; i++) { int targetPos = (i + (row * column - 1) * (i % row)) / row; while (targetPos < i) { targetPos = (targetPos + (row ...
true
e50be2725e73232b59814569dd8b8f81752daed6
C++
alexandraback/datacollection
/solutions_1483488_0/C++/Moldot/C_Recycled_Numbers.cpp
UTF-8
851
3.078125
3
[]
no_license
/* Grader: Codejam - Qualification Round 2012 C Recycled Numbers Varot Premtoon 14 Apr 2555 */ #include <cstdio> int ab[10000000]; int sol(int cse) { int i,j; int a,b; int x,y,num[10],n; long long sum = 0; scanf("%d %d",&a,&b); for(;a<=b;a++) { x = a; ...
true
df1f470fa1a894b29384ab09cc2ddf1532e8c3ce
C++
LeeGyeongHwan/Algorithm_Student
/SW_Expert_Academy/D1/sw_2056.cpp
UTF-8
1,317
3.03125
3
[]
no_license
/* 난이도 : D1 문제 번호 : 2056 문제 제목 : 연월일 달력 풀이 날짜 : 2020-02-03 Solved By Reamer */ #include <iostream> using namespace std; int main() { int testCase, month, day; string ymd, year; cin >> testCase; for (int i = 0; i < testCase; i++) { bool isvalid = true; string ...
true
d8eb736fe540332b3811665fdd70689bafce8857
C++
andrewlegault/CPSC-585-Game-Project
/cpsc585/cpsc585/Waypoint.cpp
UTF-8
884
2.765625
3
[]
no_license
#include "Waypoint.h" Waypoint::Waypoint(IDirect3DDevice9* device) { radius = 20; drawable = new Drawable(WAYPOINT, "checker.dds", device); wpPosition = hkVector4(0,0,0); } Waypoint::~Waypoint(void) { } void Waypoint::setPosAndRot(float posX, float posY, float posZ, float rotX, float rotY, float rotZ) //...
true
2deb99b63f2e08b810a4a3d22d23feb3711dac1d
C++
stas/exorcyber
/ks/threadlib.h
UTF-8
600
2.796875
3
[]
no_license
#pragma once class thread { public: typedef void (*proc)(void* prm); private: void* lData; proc p; void start(void* prm); public: //create thread and start it thread(proc p, void* prm = NULL) : p((proc)p) { start(prm); } template<class T> thread(void (*p)(T* prm), T& prm) : p((proc)p) { start((void*)&prm); } t...
true
71232a551760d4bf137f1ce2440087acfd1b3741
C++
simhem1/Info2
/u1/a1/Simple_class.cpp
UTF-8
207
2.53125
3
[]
no_license
#include "Simple_class.hpp" Simple_class::Simple_class(int val) : data(val) { } Simple_class::~Simple_class(){ } int Simple_class::get(){ return data; } void Simple_class::set(int in){ data=in; }
true
40870bbacf484cbf346912d0634b5f945ffdea1b
C++
bbc/bbcat-audioobjects
/src/Playlist.h
UTF-8
8,796
2.796875
3
[ "MIT" ]
permissive
#ifndef __SIMPLE_PLAYLIST__ #define __SIMPLE_PLAYLIST__ #include <vector> #include <bbcat-base/ThreadLock.h> BBC_AUDIOTOOLBOX_START class SoundFileSamples; class Playlist { public: Playlist(); ~Playlist(); /*--------------------------------------------------------------------------------*/ /** Return wheth...
true
e7b428e1f0c8055a82b59300688d04af0f5395c1
C++
5l1v3r1/IEEE-Robotics
/ROBOT_2014/TestingGround/demo/lib/motors.h
UTF-8
1,541
3.28125
3
[]
no_license
#ifndef MOTORS_H #define MOTORS_H #include <Arduino.h> //Define the Pins---------- //Motor Pair 1 (ON THE LEFT SIDE) /* #define DIRECTION_LEFT 26 //Direction #define PWM_LEFT 3 //Speed //Motor Pair 2 (ON THE RIGHT SIDE) #define DIRECTION_RIGHT 28 //Direction #define PWM_RIGHT 4 //Speed */ //Enum for specifying dire...
true
2edebd9def4ca3b755942aa4e6f11cc867ceac8d
C++
andrewpeck/emu
/step/include/emu/step/TimingOptions.h
UTF-8
2,196
2.6875
3
[]
no_license
#ifndef __emu_step_TimingOptions_h__ #define __emu_step_TimingOptions_h__ #include "emu/step/Test.h" #include "emu/pc/TMB.h" #include <vector> #include <map> #include <string> namespace emu{ namespace step{ class Test; class TimingOptions{ public: TimingOptions( emu::step::Test *test ); ...
true
0203ad6f93a0d101006f74b04790d767187eaae5
C++
czzCreator/daemon_with_boost_1_69
/console_boost_service_example/qcmd_pairs_dealer.h
UTF-8
5,673
2.578125
3
[]
no_license
#ifndef QCMD_PAIRS_DEALER_H #define QCMD_PAIRS_DEALER_H #include <QDebug> #include <QString> #include <string> #include <iostream> //实例化对象并且初始化 //每次再次调用无需重新定义stringstream类一个对象,只要清空再使用即可 //strStream.clear(); #include <sstream> #include "qmyglobal.h" /* * program options是一系列pair<name,value>组成的选项列表,它允许程序通过命令行或配置文件...
true
fb78ee4d32e18e16c26a817d12986d6a4617fad6
C++
stereotype13/LeetCodePractice
/ImplementStrStr/ImplementStrStr/main.cpp
UTF-8
1,754
3.890625
4
[]
no_license
/* Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Input: haystack = "hello", needle = "ll" Output: 2 Example 2: Input: haystack = "aaaaa", needle = "bba" Output: -1 Clarification: What should we return when needle is an empty ...
true
aa1515569e82a8d0a2abd901b7a508006678e62d
C++
eunbiline98/project-arduino
/motor_limit_switch/motor_limit_switch.ino
UTF-8
1,414
2.5625
3
[]
no_license
int pbuttonPin = A1;// connect output to push button int pbuttonPin1 = A2;// connect output to push button int pbuttonPin2 = A3;// connect output to push button int relayPin = 13;// Connected to relay (LED) #define pin_cw 10 #define pin_cww 11 int sens_a = 0; int sens_b = 0; int hujan = 0; void setup() { // Roboja...
true
9e841ac5b0f6537e93e60337e7e99a1ca190cafe
C++
sworsman31415926/linux_send_message
/DataStruct/StackAndQueue/2017-4-17/MinStack.hpp
UTF-8
1,131
3.640625
4
[]
no_license
/************************************** *文件说明:Push、Pop、Min操作均为O(1)的栈 *作者:高小调 *创建时间:2017年04月17日 星期一 18时48分35秒 *开发环境:Kali Linux/g++ v6.3.0 ****************************************/ #include<stack> #include<cassert> template<typename T> class MinStack{ public: //构造、拷贝构造、赋值运算符重载、析构略 public: void Push(const T &e); //入栈 v...
true
f9cb757e3b7a50004f01289e8ce501b39eb45915
C++
mucahityuksel/c_vize_sorulari
/2017_algo_vize2.cpp
UTF-8
467
2.59375
3
[]
no_license
//dizideki degerler buyuk harf ise yerine * koy kucuk ise buyuk harfe cevir. #include "stdio.h" int main(int argc, char const *argv[]) { char metin[100]; int i; printf("bir metin giriniz:"); gets(metin); for(i=0;metin[i]!=NULL;i++) { if((metin[i]>='a')&& (metin[i]<='z')) { metin[i]-=32; ...
true
512e77e3b61dfe30de74cb45de89123e2bd81f7c
C++
dfortizgu/HerramientasComp
/Ejercicios/1.cpp
ISO-8859-1
1,601
3.34375
3
[]
no_license
#include <iostream> #include <cmath> double sin_pade(double x); double sin_aux(double u); double sinint(double x); //sinint calcula sin(x) para el intervalo [-pi/2;pi/2] con la aproximacin de Pade(que es donde funciona tal aproximacin) mientras que sin_aux cuenta el intervalo en que est x [-pi/2+n;pi/2+n] con n entero...
true
020e57ea13fa936968fe68f60abaa4e4b2b98620
C++
TyRoXx/dogbox
/common/overloaded.h
UTF-8
208
2.59375
3
[ "MIT" ]
permissive
#pragma once namespace dogbox { template <class... Ts> struct overloaded : Ts... { using Ts::operator()...; }; template <class... Ts> overloaded(Ts...)->overloaded<Ts...>; }
true
b948516f1d25ad23b8a2637234241d961a5d9942
C++
xxvms/Library_V_Unique
/main.cpp
UTF-8
4,130
3.375
3
[]
no_license
#include <iostream> #include <vector> #include "Book.h" #include "Library.h" char menu(); int main() { Library library; std::vector<Book>book; char choice; do { choice = menu(); switch (choice) { case '1': { std::cout << "Max amount books...
true
593e5b36d3248d3d3841f628887f0727840176cc
C++
salluru007/algos
/src/epi/designProb1.cpp
UTF-8
2,495
3.859375
4
[]
no_license
#include<iostream> #include<vector> #include<cmath> template<typename T> class Point{ public: T _x, _y; Point()=delete; //Point(T &x=T(),T &y = T()):_x(x), _y(y){} Point( T x, T y):_x(x),_y(y){ std::cout << "Constructed Point\n"; } //virtual float distance(Point &point){ float distance(Point &point){...
true
6eb0a298065ff24564558bd7ea0f1569687f9fb5
C++
XiaoxiongZheng/Algorithms
/leetcode/ValidParentheses.cpp
UTF-8
725
3.28125
3
[]
no_license
// // Created by zhengxx on 15/5/17. // /** * valid parentheses * https://leetcode.com/problems/valid-parentheses/ * time = O(n), space = O(n) */ #include <stack> #include <unordered_map> using namespace std; class Solution { public: bool isValid(string s) { stack<char> st; unordered_map<char...
true
b88fb2384b05691d2d08d98f3f8bb0baf021e91e
C++
vcvycy/ACMTemplate
/SuffixArray.cpp
GB18030
3,685
2.828125
3
[]
no_license
#include<cstdio> #include<cstring> #include<algorithm> #include<iostream> using namespace std; class SUFFIXARRAY { #define SLEN 201000 /* ֱú.solve(char s[],int charSetSize=128)s[]±0ʼ charSetSizeʾ0<=s[0]..s[n-1]<charSetSize0ΪַáСӰٶȡ */ /* sa[],rank[],height[i]±Ϊ1..n (1)sa[i] : ĺ׺Уiԭе± (2)ra...
true
897004fdf732c390f7a536fe7eeb59e388e637af
C++
molivo123/CPSC-350
/Assignment2350/Assignment2350.h
UTF-8
1,667
2.65625
3
[]
no_license
#include <iostream> #include <typeinfo> #include <fstream> #include <random> #include <string> #include <cmath> #include <unistd.h> //all of my includes using namespace std; //all of my namespaces //GoL class class GameOfLife{ public: GameOfLife();//default constructor ~GameOfLife();//deconstructor }; //class t...
true
4aa58816e520207d1fc3fd32bfe4ccc5ccd785a1
C++
k911/bmp-compressor-12bit
/src/InputHandler.cpp
UTF-8
2,823
2.890625
3
[]
no_license
#include "InputHandler.h" #include "CText.h" #include <string> InputHandler::InputHandler(int argc, char ** argv) : DEFAULT_OPTION("input"), FILE_EXT(R"(((?:[^/]*/))*(.*)\.(\w+)$)") // FILE_EXT(R"(.*\/?(.*)\.(\w+)$)") // TODO: not "Raw string" { #ifdef _DEBUG std::cout << " -> [InputHandler]: Parsing input for ex...
true
041ce612b7a5b713fa9de6386bab1ecf46ac0d3f
C++
HenrYxZ/Graphics
/project2/geom2.h
UTF-8
1,672
3.203125
3
[]
no_license
#include <math.h> #include <iostream> #ifndef __GEOM2_H__ #define __GEOM2_H__ // Alpha value used for determining initial magnitude #define ALPHA 1 // Arbitrary value for acceleration of balls in motion #define ACCELERATION -100 // Maximum speed per ball #define MAX_SPEED 200 using namespace std; // Handy geometr...
true
fb8c56d4ac67c33e138f8dc72026a42cd39d5433
C++
JavierUR/lineFollowerSimulator-cpp
/version-2/paths.h
UTF-8
923
2.703125
3
[ "MIT" ]
permissive
#ifndef __PATHS_H__ #define __PATHS_H__ #include "odometry.h" #ifndef __AVR__ #include "arduino.h" #include "utils.h" #else #include <Arduino.h> #endif class PathPoint { private: // flags stores a packed representation of other information // included in a PathPoint. The LSB represents whether the robot ...
true
26c31f4de648d75de4c66e85f8daf429010a686c
C++
simoliqta/Homework-SDA
/Homework 4 and some previous tasks/QueueUsingTwoStacks.cpp
UTF-8
2,906
3.484375
3
[]
no_license
#include<iostream> using namespace std; template<typename T> struct node { T data; node* next; }; template<typename T> class LStack { private: node<T>* topNode; void copy(node<T>* toCopy); void eraseStack(); void copyStack(LStack const&); public: LStack(); LStack(LStack const&); LStack& ...
true
0c98d7df48f2be48ee10c19ec9193a3d0ceeeae1
C++
GkWangBin/Method-of-Programming
/第二章-数组/寻找最小的k个数.cpp
UTF-8
5,751
3.921875
4
[]
no_license
/*题目:有n个整数,请找出其中最小的k个整数,要求时间复杂度尽可能低*/ /*首先可以使用先排序,再输出的策略。 *假设使用的是快速排序,时间复杂度为O(nlogn)+O(k)->O(nlogn)*/ #include<iostream> #include<Windows.h> using namespace std; void swap(int *a, int *b) { int tmp(*b); *b = *a; *a = tmp; } /* int partation(int *arr, int low, int high) { int pivot = arr[high]; int left(low), ...
true
bc430cfc0e765eec63224a8887c6c6be8b46b653
C++
gfiumara/libbiomeval
/src/include/be_time_timer.h
UTF-8
7,864
2.890625
3
[ "LicenseRef-scancode-public-domain", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
/* * This software was developed at the National Institute of Standards and * Technology (NIST) by employees of the Federal Government in the course * of their official duties. Pursuant to title 17 Section 105 of the * United States Code, this software is not subject to copyright protection * and is in the public ...
true
4b680a579ae00e998ea69cf37314ae3c0a2f7d6c
C++
PhilippParis/BusinessManager
/ui/models/billtablemodel.cpp
UTF-8
2,538
2.609375
3
[]
no_license
#include "billtablemodel.h" BillTableModel::BillTableModel() { } bool BillTableModel::setData(const QModelIndex &index, const QVariant &value, int role) { if (role == Qt::CheckStateRole) { Bill::Ptr bill = m_data.at(index.row()); bill->setPayed(value.toInt() == Qt::Checked); emit billPaye...
true
b41267a99862b336ef8ad682692fec7e03f87d4c
C++
AmrEsam0/Exercism
/cpp/phone-number/phone_number.cpp
UTF-8
511
2.859375
3
[]
no_license
#include "phone_number.h" namespace phone_number { phone_number::phone_number(string raw) { regex reg("[^\\d]"); phone = regex_replace(raw, reg, ""); if (phone.size() != 10) { if (phone.size() == 11 && phone[0] == '1') { phone = phone.substr(1); } else { phone = "000...
true
d8a23e55736a517479b449520a33c4026cd1b418
C++
Michal-Fularz/ProgrammingCourse
/ProgrammingCourse/lab_07_test_preparation/lab_07_library.cpp
UTF-8
1,755
3.84375
4
[ "MIT" ]
permissive
#include "lab_07_library.h" #include <cmath> #include <iostream> int modulo_1(int value, int dividend) { int quotient = value / dividend; int rest_of_division = value - quotient * dividend; return rest_of_division; } int modulo_2(int value, int dividend) { while (value >= dividend) { value -= dividend; } ...
true