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
413260b34349b5cd5bac5008c5af9203974fca2e
C++
mridul-mc/all_oop_cpp
/inline_function.cpp
UTF-8
187
2.796875
3
[]
no_license
#include<iostream> #include<conio.h> using namespace std; int add(int x,int y); inline int add(int x,int y) { return(x+y); } int main() { int a=10,b=20; cout<<add(a,b); }
true
b1a91357c297557c9858e24d29a7b14d4de06c12
C++
clashroyaleisgood/Courses
/進階程式設計/Project - Mini Monopoly/Map.h
UTF-8
3,705
2.65625
3
[]
no_license
#ifndef MAP_H #define MAP_H #include <iostream> #include <cstdio> #include <stdexcept> bool do_decision(); enum LandType {U,C,R,J,Ndef}; constexpr int MaxPeopleNum = 4; constexpr int MaxFineNum = 5; constexpr int MaxLandNum = 20; constexpr int MaxUpgradLV = 5; class WorldPlayer; class MapUnit { pu...
true
4a72f9dbda5f67db420656b94b4c6e92469adb25
C++
DcmTruman/my_acm_training
/POJ/3259/15516338_AC_344ms_1532kB.cpp
UTF-8
1,470
2.5625
3
[]
no_license
#include<iostream> #include<algorithm> #include<string.h> #include<string> #include<queue> #include<vector> #include<map> #define clr(x,b) memset(x,(b),sizeof(x)) #define fuck cout<<"fuck:"<<__LINE__<<endl; using namespace std; const int maxn = 100200; const int maxm = 100200; int n,m,w; int ct = 0; int dis[maxn]; bo...
true
9aa52278545f2bed23061ce19d48e120f8eb6362
C++
elfortitude/cpp_white_belt
/week_3/algorithms/sort_mod.cpp
UTF-8
465
2.9375
3
[]
no_license
/* * Отсортируйте массив А по модулю и выведите его в стандартный поток. */ #include <iostream> #include <vector> #include <algorithm> #include <cmath> using namespace std; int main(void) { int n; cin >> n; vector<int> A(n); for (auto& i : A) cin >> i; sort(begin(A), end(A), [](int x, int y){return(abs(x...
true
015bcdfd9c5e4bd9f605092483c05545db5593f5
C++
MuditSrivastava/SPOJ_SOL
/LITE/13058456.cpp
UTF-8
1,435
2.78125
3
[]
no_license
#include<iostream> #include<cstdio> using namespace std; int tree[400004]; int lazy[400004]; void update(int tl,int tr,int l,int r,int node) { int mid=(tl+tr)/2; if(lazy[node]) { tree[node]=(tr-tl+1)-tree[node]; if(tl!=tr) { lazy[node*2]^=1; lazy[node*2+1]^=1;...
true
b2cc7b8f7e17fd26c05b4f640603cb658ed51638
C++
n7kurosawa/quicksort_mm
/src/cc/quicksort_mm.hh
UTF-8
8,401
2.84375
3
[]
no_license
// Written in 2016 by n.kurosawa // // This program is under the CC0 Public Domain Dedication 1.0. // See <http://creativecommons.org/publicdomain/zero/1.0/> for details. // This program is distributed without any warranty. // ====================================================== // Quicksort/Quickselect wi...
true
dbf5bfd3472a7d8bb53fdc99dae900a2926381d4
C++
jahendrie/belted
/src/events.cpp
UTF-8
20,471
3.640625
4
[ "Zlib" ]
permissive
/******************************************************************************* * events.cpp * * This file controls all input received from the player, routing events to * their correct places or otherwise taking appropriate action. * ****************************************************************************...
true
c0fe99b5705a77b07c7bf45601006f521f7e4e5a
C++
mridulraturi7/Data-Structures
/Graph/Traversal/DFS/Iterative.cpp
UTF-8
2,200
4.1875
4
[]
no_license
/* Implementation 5. DFS Traversal of a Graph. Perform the DFS traversal of the following Graph: 0---------1 | \ | | \ | | \ | | \ | 3---------2 ...
true
f34badfd8c5f9d890738c6a3a3ca1b378539d5ee
C++
dd-user/grapes-dd
/src/buffer.hpp
UTF-8
4,750
2.890625
3
[ "MIT" ]
permissive
/* Copyright (c) 2020 GRAPES is provided under the terms of The MIT License (MIT): Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to ...
true
ef59bcaabcc17bd4b2b2c5fd448015523d7af0ae
C++
icyleaf/omim
/base/runner.hpp
UTF-8
840
3.0625
3
[ "Apache-2.0" ]
permissive
#pragma once #include "std/function.hpp" namespace threads { typedef function<void()> RunnerFuncT; // Base Runner interface: performes given tasks. class IRunner { public: virtual ~IRunner() {} virtual void Run(RunnerFuncT const & f) const = 0; // Helper function that calls f() and catches all exception. ...
true
50028acd1439e58308aab74ca40dbcad53369053
C++
Robotics-SLB/marnav
/src/marnav/nmea/audep.cpp
UTF-8
557
2.625
3
[ "BSD-3-Clause", "BSD-4-Clause" ]
permissive
#include "audep.hpp" #include <marnav/nmea/io.hpp> namespace marnav { namespace nmea { constexpr sentence_id audep::ID; constexpr const char * audep::TAG; audep::audep() : sentence(ID, TAG, talker_id::none) { } audep::audep(talker talk, fields::const_iterator first, fields::const_iterator last) : sentence(ID, TAG,...
true
d4bc08c13aded906d49bf4c68eb2c4b735b40e67
C++
lineCode/beam
/Beam/Include/Beam/Network/MulticastSocketConnection.hpp
UTF-8
1,249
2.640625
3
[]
no_license
#ifndef BEAM_MULTICASTSOCKETCONNECTION_HPP #define BEAM_MULTICASTSOCKETCONNECTION_HPP #include <boost/noncopyable.hpp> #include "Beam/IO/Connection.hpp" #include "Beam/Network/MulticastSocket.hpp" #include "Beam/Network/Network.hpp" namespace Beam { namespace Network { /*! \class MulticastSocketConnection \br...
true
6f52723d23fc4a4a892e53d4844f5ea3890564c0
C++
spiralgenetics/biograph
/modules/io/autostats.h
UTF-8
2,909
2.703125
3
[ "BSD-2-Clause" ]
permissive
#pragma once #include <boost/preprocessor/seq/for_each.hpp> #include <boost/preprocessor/tuple/elem.hpp> #include <cstdint> #include <iostream> #include <map> // Autostats provides a way to track multiple types of metrics, class autostats_base { public: virtual std::map<std::string, size_t> value_map() const = 0; ...
true
33c9d19e0d4104da1bc8be273a97fb58cabc5f02
C++
zephyr-bj/algorithm
/segmentTree/0307_rangeSumQuery.cpp
UTF-8
3,439
2.984375
3
[]
no_license
class NumArray { public: vector<int>sgt; int n; void constructSGT(vector<int>&nums, int l, int h, int x){ if(l>h)return; if(l==h){ sgt[x]=nums[l];return; } int m = (l+h)>>1; constructSGT(nums, l, m, 2*x+1); constructSGT(nums, m+1, h, 2*x+2); ...
true
792906d4c352d7c3f5ec309b325dc2ea529311cd
C++
MartinMC97/DS-AND-AA-Backup
/DSAA_Code_Cpp/List/DList.cpp
GB18030
1,097
3.46875
3
[]
no_license
/*˫ûд̫࣬ص㻹Dz*/ #pragma once #include <stdlib.h> #define ElemType int typedef struct DNode { ElemType data; DNode *Prev; DNode *Next; }*DList; int DIsEmpty(DList L) { return (L->Next == NULL); } DNode *DGotoKth(DList L, int i) //һָiڵָ { DNode* p = L; int j = 0; while (j<i) { p = p->Next; ++j; } return p; } ...
true
c95ac341c4f6b1d4ab8c4f3cc5c292d0a05e2251
C++
jaguar-paw33/CODE_AAI
/Problem Solving/8.Linked List/17.merge_two_sorted_LLs.cpp
UTF-8
1,298
3.6875
4
[]
no_license
/* Merge two sorted linked lists and return it as a sorted list. The list should be made by splicing together the nodes of the first two lists. Example 1: Input: l1 = [1,2,4], l2 = [1,3,4] Output: [1,1,2,3,4,4] Example 2: Input: l1 = [], l2 = [] Output: [] Example 3: Input: l1 = [], l2 = [0] Output: [0] Constrain...
true
48e3e3d32a699cab06978983e67064878a214ed5
C++
kelcamer/High-School-C-Plus-Plus
/Program2/Program2/Program2.cpp
UTF-8
3,106
3.828125
4
[]
no_license
/* Kelsey Cameron December 13, 2011 Period 1 Purpose: To calculate the area of various shapes */ #include <iostream> #include <cmath> #include <string> using namespace std; double perimetersquare(double, double); double areasquare(double, double); double circumference(double); double circlearea(double); ...
true
c7a55e1b40a44c14aeb649baa69bb7a36b784834
C++
salvipeter/sabin-multiloop
/sabin.cc
UTF-8
6,142
2.65625
3
[]
no_license
// Based on: // // M. A. Sabin: Further transfinite developments // In: The Mathematics of Surfaces VIII (Ed. R. Cripps), pp. 161-173, 1998. #include <cmath> #include <fstream> #include <iostream> #include <set> #include "solver.hh" // Global parameters const double multiplier = 30.0; const size_t resolution = 120; ...
true
05cd24be7cc0ca80d0bda14d24f7dcfd7813d1e3
C++
irina-suslova/Lab_3
/Lab_3/main.cpp
UTF-8
44,219
3.21875
3
[]
no_license
#include <iostream> #include <time.h> #include "set.h" #include "set.cpp" #include "extrafunctions.h" #include "complex.h" #include "person.h" using namespace std; const char *MSGS_TYPE[] = {"Which type of function do you need?", "0. Quit", "1. Make inte...
true
2f6b4ef6dc7e0f2ff7cd42f3be6f9d04b764ffc8
C++
deva02ashish/Competitive-Programming
/virtual_base_claass.cpp
UTF-8
1,228
3.328125
3
[]
no_license
#include<iostream> using namespace std; /* ---------------virtual_base_inheritance---------------- student-->>test student-->>sports test-->>result sports-->>result */ class student { protected: int roll_no; public: void set_number(int a) { roll_no=a; } void print_number(void) ...
true
b7e7e4dabeebec848a4ba5ee050634f6f12b2432
C++
sbmaruf/Algorithms-Code-Library
/Geometry/CircleSegmentTetrahedron.cpp
UTF-8
2,231
3.59375
4
[ "MIT" ]
permissive
/* This code assumes the circle center and radius to be integer. Change this when necessary. */ inline double commonArea(const Circle &a, const Circle &b) { int dsq = sqDist(a.c, b.c); double d = sqrt((double)dsq); if(sq(a.r + b.r) <= dsq) return 0; if(a.r >= b.r && sq(a.r-b.r) >= dsq) return ...
true
d2764533237b424c2faa8c5eea4db6a13e64a8c6
C++
alberto-pino/ugine
/src/Emitter.h
UTF-8
1,441
2.90625
3
[]
no_license
#pragma once #include "common.h" #include "entity.h" #include "Material.h" #include "Particle.h" class Emitter : public Entity { public: Emitter(const Material& mat, bool autofade = true); void setRateRange(float min, float max) { minRateRange = min; maxRateRange = max; }; void setVelocityRange(const glm::...
true
da26760ef5de3e74828cb7b3a25aa013bd7a51b0
C++
jsl1113/LeeJiSeon
/Coding_Test_study/C++/B5073.cpp
UTF-8
621
3.265625
3
[]
no_license
#include <iostream> #include <cmath> using namespace std; int a, b, c; bool E() { return (a == b && b == c) ? true : false; } bool I() { return (a == b || b == c || c == a) ? true : false; } int main() { ios::sync_with_stdio(); cin.tie(); while (true) { cin >> a >> b >> c; if (a == 0 && b == 0 && c == 0) b...
true
dfe9c166683f4ca4576a3d9ad57f685df7760dd8
C++
Reolsin/labs_3sem
/Lab3_dynamic/test.cpp
UTF-8
3,395
3.234375
3
[]
no_license
#include "pch.h" #include "../Library_dynamic/Stack.h" namespace Stack_dynamic { TEST(StructConstructor, Default) { Cell c; EXPECT_EQ(0, c.v); ASSERT_STREQ("", c.str); } TEST(StructConstructor, Init) { Cell c1(1); Cell c2(2, "string"); EXPECT_EQ(1, c1.v); ASSERT_STREQ("", c1.str); EXPECT_EQ(2, c2....
true
7066917a3c0572c5178d2dcd559f46e01d6eb13e
C++
solderspot/SS_Servorator
/examples/SimpleServo/SimpleServo.ino
UTF-8
1,621
2.96875
3
[ "BSD-3-Clause" ]
permissive
// // // SimpleServo.ino // // Copyright (c) 2013-2014, Solder Spot // All rights reserved. // This sketch requires the following library: // SS_Servorator: https://github.com/solderspot/SS_Servorator // include needed librarys #include <Servo.h> #include <SS_Servorator.h> #define NUM_SERVOS 6 Servo servo[NU...
true
39be0bd2cba3436a434dd1defa3c4e2abebf035d
C++
TheSica/any
/any/main.cpp
UTF-8
465
2.96875
3
[]
no_license
#include <gtest/gtest.h> #include <any> #include "any.h" #include <typeinfo> #include <type_traits> #include <typeindex> struct S { S(std::string v) { tt = v; } S(S&& v) { }; std::string tt; }; int main() { testing::InitGoogleTest(); RUN_ALL_TESTS(); { any a1 = std::list<int>{ 1,2,3 }; any a2 = std:...
true
f74b190cb539b677f0addc2e9add8a419b7c9a87
C++
Alex7Li/ProgrammingContests
/Kattis/EditingExplosion.cpp
UTF-8
2,998
2.5625
3
[]
no_license
// https://open.kattis.com/contests/nac20open/problems/editingexplosion #include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; int levD(strin...
true
4d1e1da03aaed2caf560a7315e5bdba379d37eba
C++
Bettedaniel/Competition
/Kattis/cargame/cargame2.cpp
UTF-8
1,133
3.0625
3
[]
no_license
#include <iostream> #include <vector> #include <queue> using namespace std; int max(int a, int b) { return a > b ? a : b; } string toLowerCase(string s) { int sz = s.size(); for (int i = 0; i < sz; ++i) { s[i] = tolower(s[i]); } return s; } char match(string a, string b) { int i = 0;...
true
03fcb29bada96963d3987addf48ed52161ebc46c
C++
xinweilau/Data-Structure-and-Algorithm
/AVL.cpp
UTF-8
12,994
3.484375
3
[]
no_license
/* Team Members: Lau Xin Wei (S10155401D) Justin Mar Mariano Justiniano (Student_ID) Group: ? Highlight Feature: - */ #include "stdafx.h" #include "AVL.h" #include <iostream> #include <sstream> #include <iomanip> using namespace std; AVL::AVL() { root = NULL; firstHitCountNode = NULL; } AVL::~AVL() { } void A...
true
631ab78ed7f777431f91465ef38e4619014c65f4
C++
peterekepeter/carbon
/Carbon/CarbonCompilerLib/Compiler.cpp
UTF-8
979
2.65625
3
[ "MIT" ]
permissive
#include "Compiler.h" #include "Lexer.h" #include "Parser.h" #include <iostream> #include <fstream> #include "Instruction.h" void Carbon::CompileStream(std::istream& stream, InstructionWriter& Output) { // easy peasy Lexer lexer(stream); Parser parser(lexer); PipeInstructions(parser, Output); } void Carbon::Compi...
true
124f9c9a58f97500ca2a4641c86fd832feee7562
C++
firesurfer/ros2_components
/src/ros2_components/CLI/CLIParser.cpp
UTF-8
3,447
2.625
3
[ "Apache-2.0" ]
permissive
/* * Copyright 2018 <Lennart Nachtigall> <firesurfer127@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless requi...
true
208ac49d9188a704fb22e57a6fc93f72c100d8b1
C++
LEE-JAE-HYUN179/Problem_Solving
/acmicpc.net/Problem_1991_트리 순회.cpp
UTF-8
1,514
3.140625
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> using namespace std; int conv(char a) { if (a >= 65 && a <= 90) return a - 65; else if (a == 46) return 26; else return -1; } char invert(int a) { if (a >= 0 && a <= 25) return a + 65; else if (a == 26) return '.'; else return 0; } int find_index(const ...
true
08b894f6c1732c60c28aba151c9f6f61a143586c
C++
ishine/google-research
/fair_submodular_matroid/movies_mixed_utility_function.cc
UTF-8
2,355
2.53125
3
[ "CC-BY-4.0", "Apache-2.0" ]
permissive
// Copyright 2023 The Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in...
true
1ff97acdd49947845400361789ea2c7f93f07458
C++
jzrake/Mara2
/src/CartesianMeshGeometry.cpp
UTF-8
3,632
2.671875
3
[]
no_license
#include <cassert> #include "CartesianMeshGeometry.hpp" // ============================================================================ CartesianMeshGeometry::CartesianMeshGeometry() { shape = {{128, 1, 1, 1, 1}}; lower = {{0.0, 0.0, 0.0}}; upper = {{1.0, 1.0, 1.0}}; cacheSpacing(); } CartesianMesh...
true
3b908c14022778dc1221174b5daeaf3986b4976c
C++
pboechat/PCSS
/application/src/Mesh.h
UTF-8
3,061
2.96875
3
[]
no_license
#pragma once #include <vector> #include <GL/glew.h> #include <glm/glm.hpp> #include "GLUtils.h" struct Mesh { GLuint vao; GLuint positionBuffer; GLuint texcoordsBuffer; GLuint normalBuffer; GLuint indexBuffer; bool hasIndexBuffer; size_t numVertices; size_t numIndices; Mesh(const std::vector<glm::vec3>& v...
true
21f18e875aa314bf229c1d3a901bee83bc61ad54
C++
iansmathew/OpenGL-Final-Assignment
/FirstExample/main.cpp
UTF-8
14,727
2.5625
3
[]
no_license
//*************************************************************************** // main.cpp by Ian Sebastian Mathew & Diego Camacho (C) 2018 All Rights Reserved. // // Final Assignment submission. // // Description: // - Move camera with WASD and mouse to look around //**************************************************...
true
bfb285e5476a0e8be843ba6a8fa190e814d218e1
C++
amecky/diesel2D
/utils/Trails.h
UTF-8
981
2.546875
3
[]
no_license
#pragma once #include "..\world\World.h" #include "..\particles\ParticleManager.h" #include <map> namespace ds { class Trails { enum TrailEmitType { TET_DISTANCE, TET_TIME, TET_FRAMES }; struct TrailPiece { Vector2f prevPosition; int particleSystem; union { float distance; int fram...
true
fb6d31018482ca2299253d917d01b1a9adeb3262
C++
mvdsanden/libecpp-devtools
/src/initmod/main.cc
UTF-8
1,375
2.9375
3
[]
no_license
#include "initmod.ih" #include <ecpp/string/string.hh> int InitMod::main(ArgList::iterator begin, ArgList::iterator end) { if (d_context.initialized()) throw runtime_error("we are already inside a project"); string ns = ""; string name = ""; for (ArgList::iterator i = begin; i != end; ++i) { // Pa...
true
66a7aea5229f526ea815ec6d75f76026cccae355
C++
SumitKumar1107/InterView
/Arrays/MissingNumber.cpp
UTF-8
684
3.5625
4
[]
no_license
Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array. Follow up: Could you implement a solution using only O(1) extra space complexity and O(n) runtime complexity? Input: nums = [3,0,1] Output: 2 Explanation: n = 3 since there are...
true
16be730f9509e5b09947859f70b1e49deb9e48d7
C++
Kev1venteur/B2_JeuxRPGCapture
/projet/include/zone.h
UTF-8
761
2.765625
3
[]
no_license
#ifndef ZONE_H #define ZONE_H #include <string> using namespace std; class Zone { public: Zone(); virtual ~Zone(); string getType(); void setType(string type); unsigned short int getXmin(); void setXmin(unsigned int value); unsigned short int ...
true
adfee8d145d6edede699f148308c9d3a0db93d79
C++
AndreeaRT/sem5_OOP
/crudrepo.h
UTF-8
641
2.546875
3
[]
no_license
#pragma once #include "Wagen.h" #include <vector> #include <iostream> using namespace std; template <class E> class CrudRepository { public: virtual E Finde(int id) = 0; virtual vector< E > findAll() = 0; virtual E save(E entity) = 0; virtual E del(int id) = 0; virtual E update(E entity) = 0; virt...
true
9258a924d3f51a20500f3a2cf879eac844653637
C++
kc991229/practice
/2020.7.23/2020.7.23/text.cpp
GB18030
2,592
3.65625
4
[]
no_license
/* һֳֵĴ鳤ȵһ룬ҳ֡ һΪ9{1,2,3,2,2,2,5,4,2} 2г5Σ鳤ȵһ룬20 */ #include <iostream> #include <vector> #include <algorithm> using namespace std; int MoreThanHalfNum_Solution(vector<int> numbers) { if (numbers.empty()) return 0; sort(numbers.begin(), numbers.end()); int middle = numbers[numbers.size() / 2]; int count = 0; // ִ ...
true
cf5b308031b3697a4ed909b6c2abf6ddb56f6ebe
C++
rhalf/SulitPisoLibraries
/ArduinoLibraries/20201231/BillCoinAcceptor/BillCoinAcceptor.cpp
UTF-8
1,481
2.875
3
[]
no_license
#include "BillCoinAcceptor.h" #include "Arduino.h" typedef void (* Callback)(); BillCoinAcceptor::BillCoinAcceptor(uint16_t pin) { _pin = pin; _multiplier = 1; if (_activeState) { pinMode(_pin, INPUT); } else { pinMode(_pin, INPUT_PULLUP); } } BillCoinAcceptor::BillCoinAcceptor(ui...
true
025ee82b26ec39d72343cf6e1c501a87786c41f0
C++
OrhanKupusoglu/find-first-id
/test/src/test_kbtree.cpp
UTF-8
7,748
2.6875
3
[ "MIT" ]
permissive
#include "gtest/gtest.h" #include <bitset> #include "../include/kcommon_tests.h" #include "../../src/include/kbtree.h" TEST(TestKBTree, BTreeDivMod) { using num_div_mod_t = std::tuple<uint32_t, uint32_t, uint32_t>; std::vector<num_div_mod_t> test_inputs = {{ 0, 0, 0}, ...
true
e4e3978dfe7719529bc64214017c93b671ef07ba
C++
tokheim/amqpprox
/libamqpprox/amqpprox_vhoststate.cpp
UTF-8
1,693
2.671875
3
[ "Apache-2.0" ]
permissive
/* ** Copyright 2020 Bloomberg Finance L.P. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or...
true
47df49a04389ccc70dfd5805a6448879bf7a8722
C++
whlqz9300/leetcode
/LeetCode039_FindMinInRotatedList.cpp
UTF-8
426
3.015625
3
[]
no_license
class Solution { public: int findMin(vector<int> &num) { typedef vector<int>::iterator IterType; IterType bottom_it = num.begin(), top_it = --num.end(), mid_it; while (bottom_it < top_it){ mid_it = bottom_it + (top_it - bottom_it) / 2; if (*bottom_it > *top_it){ b...
true
0e42e83f6911904ef8565ccd8f90c3dcd0b4426a
C++
shobhit-saini/IB
/Day5/Anti_diagonal.cpp
UTF-8
639
3.671875
4
[]
no_license
/* Give a N*N square matrix, return an array of its anti-diagonals. Look at the example for more details. Example: Input: 1 2 3 4 5 6 7 8 9 Return the following : [ [1], [2, 4], [3, 5, 7], [6, 8], [9] ] Input : 1 2 3 4 Return the following : [ [1], [2, 3], [4] ] */ vector<vector<int> ...
true
77fb6a27dff28a1f7a07a0bfee98cba01a663a57
C++
Zhanghq8/Leetcode_notes
/57_Insert_Interval/submission1.cpp
UTF-8
988
3.125
3
[]
no_license
#include <iostream> #include <string> #include <cmath> using namespace std; class Solution { public: vector<vector<int>> insert(vector<vector<int>>& intervals, vector<int>& newInterval) { if (intervals.empty()) { return {newInterval}; } vector<vector<int>> result; int i...
true
ae0f87b8ca3da6067b65ac069ed9819f46668d7c
C++
luice/climap
/example/fib_main.cpp
UTF-8
2,950
3.34375
3
[ "MIT" ]
permissive
#include <iostream> #include <stdexcept> #include <string> #include "CLIMap.hpp" #include "integer_tests.hpp" #include "whiteboard.hpp" #include "fib_main.hpp" using std::cout; using std::endl; using std::invalid_argument; using std::out_of_range; using std::stoi; int fib_main(int, char**); int fib_f0_main(int, cha...
true
cbdf1fe44f7fa71b29bbf72e531ae9dfc00929cc
C++
checkmate-bitch/Random-Programs
/ProjectEuler/p33.cpp
UTF-8
884
3.296875
3
[]
no_license
#include<iostream> #include<time.h> using namespace std; float get(int x, int y) { float n, m; if(x%10 == y%10) { n= x/10; m= y/10; } else if(x%10 == y/ 10) { n= x/10; m= y%10; } else if(x/10== y%10) { n= x%10; m= y/10; } else if(x/10 == y/10) { n= x%10; m= y%10; } else return -1; retur...
true
cc7a9db5f4507b631bf2ba136174e28065c5c836
C++
S3FA/shrimp-cannon
/shrimpcannon/shrimpcannon.ino
UTF-8
1,177
2.5625
3
[]
no_license
#include <Button.h> #include <Tlc5940.h> #define TLC_ON 4095 #define TLC_OFF 0 #define BUTTON_PIN 14 #define NUM_EFFECTS 5 Button button = Button(BUTTON_PIN, BUTTON_PULLUP_INTERNAL, true, 100); // when an effect should start int onTimeouts[NUM_EFFECTS] = {0, 60, 120, 180, 0}; // how long an effect is on for int onLe...
true
7637df970cf3eec71cdc20825bbce782ffb1e6cb
C++
shivam-72/C-basics
/C++ BASICS/mainelseif.cpp
UTF-8
276
2.828125
3
[]
no_license
#include<iostream> using namespace std; int main(){ int a; cout<<"Enter the no. : "; cin>>a; if(a<18){ cout<<" he can't vote : "; } else if(a==18){ cout<<" he can vote : "; } else cout<<"he can easily vote : " ; return 0; }
true
15737bf9e37679f85c8958c8e8d077e2a8c8afa1
C++
davafons/Chip8-Emu
/src/cpu/cpu.h
UTF-8
518
2.703125
3
[]
no_license
#pragma once #include <memory> #include "timer.h" class Memory; class Cpu { public: explicit Cpu(Memory &memory); ~Cpu(); Cpu(const Cpu &rhs); Cpu &operator=(Cpu rhs); friend void swap(Cpu &first, Cpu& second) noexcept; void cycle(); void reset(); bool mustDraw() const; bool mustSound() const; ...
true
8b0bfbd72edb703471ca8f7f0742101e685e37a6
C++
vrcordoba/Klondike
/src/controllers/CardTableController.cpp
UTF-8
1,389
2.546875
3
[]
no_license
#include "CardTableController.hpp" #include "Pile.hpp" #include "Deck.hpp" #include "CardTable.hpp" #include "Score.hpp" namespace Controllers { CardTableController::CardTableController(Models::Game& game) : Controller(game) { } CardTableController::~CardTableController() { } std::vector<FacadeCard> CardTableC...
true
3368abecb1393f0abb1f47eea4185cd6584e0265
C++
teamLESLEY/tobor-firmware
/include/tape.hpp
UTF-8
742
2.8125
3
[]
no_license
#ifndef TAPE_HPP #define TAPE_HPP #include <Arduino.h> class TapeSensor { const PinName LEFT_SENSOR; const PinName RIGHT_SENSOR; unsigned int onThreshold; // Common setup between constructors void setup(unsigned int threshold); public: TapeSensor(PinName leftPin, PinName rightPin, unsigned int threshol...
true
26a475044e29bff2ca613da1ed60b952cfc07568
C++
yiZhuaMi/cPlusPlus
/LeetCode/Queue_Stack/#503/src/main.cpp
UTF-8
2,256
3.8125
4
[]
no_license
// #503 下一个更大元素 II // 给定一个循环数组(最后一个元素的下一个元素是数组的第一个元素),输出每个元素的下一个更大元素。数字 x 的下一个更大的元素是按数组遍历顺序,这个数字之后的第一个比它更大的数,这意味着你应该循环地搜索它的下一个更大的数。如果不存在,则输出 -1。 // 示例 1: // 输入: [1,2,1] // 输出: [2,-1,2] // 解释: 第一个 1 的下一个更大的数是 2; // 数字 2 找不到下一个更大的数; // 第二个 1 的下一个最大的数需要循环搜索,结果也是 2。 // 注意: 输入数组的长度不会超过 10000。 #include <iostream> #includ...
true
42230fdf708ca45bb86b81c6284709bef49c0697
C++
mrityunjayshukla411/RM-CodingTaskPhase
/Tinkercad/ArduinoCodes/PushButtonApplication/PushButtonApplication.ino
UTF-8
950
2.9375
3
[]
no_license
int buttonPin1 = 12; int buttonPin2 = 11; int ledPin = 3; int buzzPin = 2; int buttonVal1; int buttonVal2; int dt = 500; int ledBright = 0; void setup(){ pinMode(buttonPin1,INPUT); pinMode(buttonPin2,INPUT); pinMode(ledPin,OUTPUT); pinMode(buzzPin,OUTPUT); Serial.begin(9600); } void loop(){ buttonVal1 =...
true
8e7963b4fda22f605eb2bb4c913ccd56747f18d5
C++
tc-imba/VE482-p2
/archive/src/query.h
UTF-8
854
2.546875
3
[]
no_license
#ifndef SRC_QUERY_H #define SRC_QUERY_H #include <string> #include <memory> #include "uexception.h" #include "db_table.h" #include "query_results.h" class Query { public: typedef std::unique_ptr<Query> Ptr; virtual QueryResult::Ptr execute() = 0; virtual std::string toString() = 0; virtual ~Query...
true
74285475ba395b22f6af1c57e22b4ac202b391fc
C++
JameMoriarty/Hello-World
/程序/沈阳/main.cpp
WINDOWS-1252
1,612
2.796875
3
[]
no_license
//#include <iostream> //#include <cstring> //#include <cstdio> //#include <algorithm> //using namespace std; // //int main() //{ // int T; // cin>>T; // while(T--) // { // int k,i=0; // cin>>k; // char str[100006]; // scanf("%c",&str[0]); // while(str[i]!='\n') // {...
true
9813e6d2f75b41b9006ad714c32c46428b68c0bf
C++
Xuzon/PortFolio
/C++/Graphics Programming/mv_ig0/point_light_per_pixel/src/terrain.cpp
UTF-8
7,291
3.25
3
[]
no_license
#include <fstream> #include <cmath> #include <iostream> #include "terrain.h" #include "example.h" Terrain::Terrain() { m_vertexBuffer = m_indexBuffer = m_colorBuffer = 0; } void Terrain::generateVertices(const vector<float> heights, int width) { //Generate the vertices int i = 0; for (float z = float...
true
75637d365a050db3c8b1773cc0057dd06f89a2a2
C++
ronitbiswas97/KongEngine
/Engine/CWindow.cpp
UTF-8
2,119
2.75
3
[]
no_license
#include <glad\glad.h> #include "CWindow.h" CWindow* CWindow::currentWindow{ nullptr }; CWindow::CWindow(int width, int height, const char * name) : frameBufferSize( static_cast<float>(width), static_cast<float>(height) ), m_name{ name } { glfwInit(); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4); glfw...
true
746f63c900eba5dc80a3e5440141dec52b6e8f47
C++
bhupkas/Backup
/Intern _Samsung/intern/codes/mergesort.cpp
UTF-8
768
2.78125
3
[]
no_license
/* bhupkas */ #include "iostream" #include "stdio.h" #include "vector" #include "algorithm" using namespace std; #define MAX 100000 #define FOR(i,a,b) for(i=a;i<b;i++) int B[MAX+5]; void merge(int A[],int l,int m,int r) { int k,i,j; i=l; j=m+1; k=l; while(i<=m && j<=r) { if(A[i]<A[j]) B[k++]=A[...
true
ef47b6d1393230a268856eb7053286f25cc4b6c7
C++
kcsoft/ArduZombieOS
/taskStatus.cpp
UTF-8
893
2.703125
3
[]
no_license
#include <Arduino.h> #include "taskStatus.h" QueueHandle_t statusQueue; void setStatusFromISR(boardStatus status) { boardStatus stat = status; xQueueSendFromISR(statusQueue, &status, 0); } void setStatus(boardStatus status) { boardStatus stat = status; xQueueSend(statusQueue, &status, 0); } void TaskStatus(...
true
406ca77f14544691ee316f37e63820682d032c10
C++
CharlesThompson4748/CS-423-Project-3
/CS_423_Thompson_Charles_Project_3_Server/CS_423_Thompson_Charles_Project_3_Server/Cipher.h
UTF-8
6,745
2.734375
3
[]
no_license
/**************************************************** * File Name: cipher_sp14.h * Author: Bob Cotter * Date: 2/20/2014 * * This file provides the data arrays that provide * character substitution information needed to support * the substitution cipher used in the CS423 enhanced * IM project. ...
true
4dd4a986f3b7bf395016a91cabac91b82bbc454a
C++
PhilippeCollin/s7app1
/serveur/CTlsServeur.h
UTF-8
920
2.890625
3
[]
no_license
#if !defined CTLSSERVEUR_H #define CTLSSERVEUR_H #include <iostream> #include "CServeur.h" #include "openssl/ssl.h" /** Coquille pour un serveur TLS. */ class CTlsServeur : protected CServeur { public: /** Constructeur par d�faut. */ CTlsServeur(); /** Destructeur. */ ...
true
586e03024304bf57e730d016bfcb5d71522515b1
C++
saJonMR/programmiersprachen-aufgabe-1-2019
/source/Aufgabe_1.9.cpp
UTF-8
368
2.609375
3
[ "MIT" ]
permissive
#define CATCH_CONFIG_RUNNER #include <catch.hpp> #include <cmath> int checksum(int a) { int sum = 0; while (a != 0) { sum = sum + a % 10; a = a / 10; } return sum; } TEST_CASE("describe_checksum", "[checksum]") { REQUIRE(checksum (119989) == 37); } int main(int argc, char* argv[])...
true
61bf3e37aa5b9a6a191ead38da4f5ce656d7cb7f
C++
Ratstail91/roguish
/src/io.cpp
UTF-8
1,102
2.578125
3
[]
no_license
#include "io.hpp" //platform check #define WINDOWS _WIN32 _WIN64 #ifdef WINDOWS #include <termios.h> #include <unistd.h> #include <stdio.h> //reads from keypress, doesn't echo int getch(void) { struct termios oldattr, newattr; int ch; tcgetattr( STDIN_FILENO, &oldattr ); newattr = oldattr; newatt...
true
bbd903d6a5c4b9a26857c8e75ea1583505230e23
C++
myumoon/customtower
/customtower/nklib/include/resource/renderableTexture.h
SHIFT_JIS
4,207
2.75
3
[ "MIT" ]
permissive
/*------------------------------------------------------------------------- @F_Oobt@eNX`NX 쐬F2011/01/23 XVF2011/01/23 --------------------------------------------------------------------------*/ #ifndef __RENDERBLETEXTURE_H__ #define __RENDERBLETEXTURE_H__ #include <vector> #if defined(NK_USE_SDLGL) #include <SDL/...
true
2acbaa96a910d63c2ad79d0101e0e5f9069101b0
C++
roomyroomy/algorithm
/algospot/TPATH.cpp
UTF-8
1,733
3.203125
3
[]
no_license
#include <iostream> #include <algorithm> #include <vector> using namespace std; class DisjointSet { private: vector<int> parent, rank; public: DisjointSet(int n): parent(n), rank(n, 1) { for (int idx = 0; idx < n; idx++) { parent[idx] = idx; } } int find(int n...
true
0e9fb83d4227d4667a8be763c4f3bf2d1038f346
C++
KL-Lru/Competitive-Programming
/AtCoder/abc029/c.cpp
UTF-8
651
2.578125
3
[]
no_license
#include<bits/stdc++.h> using namespace std; #define nmax 9 int main(){ int n; cin>>n; int count=pow(3,n); int s[nmax]; for(int i=0;i<nmax;i++) s[i]=0; for(int i=0;i<count;i++){ for(int j=n-1;j>=0;j--){ switch(s[j]){ case 0:cout<<"a"<<fl...
true
10cb8ef1e2fbfc19af91d628d6dd4d79109781cf
C++
Ra1nWarden/Online-Judges
/UVa/247.cpp
UTF-8
1,685
2.71875
3
[]
no_license
#include <cstdio> #include <map> #include <string> #include <cstring> #include <queue> #include <vector> #define MAXL 30 #define MAXN 30 using namespace std; int n, m, ni; map<string, int> names; map<int, string> rev; char a[MAXL], b[MAXL]; bool d[MAXN][MAXN]; bool visited[MAXN]; int main() { int kase = 1; while...
true
5542452ae3921b3e24e3475f90eca45593fefed6
C++
Marynarz/P_Lodz_Weeia_Informatyka
/Zaliczenie/Wino/Starewino.cpp
UTF-8
1,183
2.75
3
[]
no_license
#include "Starewino.hpp" Starewino::Starewino():Wino("brak","brak",0),nazwa("brak"),rok(0) {} Starewino::Starewino(const char* marka, const char* styl,const unsigned int butelki,const char* nazwa,unsigned int rok):Wino(marka,styl,butelki),nazwa(nazwa),rok(rok) {} Starewino::Starewino(const Starewino &W):Wino(...
true
0aeb902a613bdc613aa9faa01d91023fae19cb54
C++
Xydrel/UdemyDataAndAlg
/Project1/Project1/QueueLinkedList.h
UTF-8
658
2.890625
3
[]
no_license
#pragma once //Includes--------------------------------------------------------------------- #include "DoublyLinkedList.h" //Types------------------------------------------------------------------------ class QueueLinkedList { public: explicit QueueLinkedList(); void Queue(IntDoublyNode::NodePtr node); I...
true
fa26638dca6de8d56c7650428b6582f7e959d489
C++
lucianoscarpaci/Programming-in-Cpp
/5.17.cpp
UTF-8
1,373
4
4
[]
no_license
#include<iostream> using namespace std; /* init main init the variables i. type ii. sales iii. retail */ int main(){ float retail; int type, sales; cout<<"Enter the product type (from 1 to 5): "; cin>>type; cout<<"Enter the total number of quantity sold: "; cin>>sales; switch(t...
true
7563083df652cf39a80f29811d575073e69b5e05
C++
Lanceolata/code
/algorithms/algorithms-cplusplus/leetcode/Question_0386_Lexicographical_Numbers.cc
UTF-8
459
3.1875
3
[]
no_license
#include <vector> using namespace std; class Solution { public: vector<int> lexicalOrder(int n) { vector<int> res(n); int cur = 1; for (int i = 0; i < n; i++) { res[i] = cur; if (cur * 10 <= n) { cur *= 10; } else if (cur % 10 != 9 && cur + 1 <= n) { cur++; } els...
true
daacd9111537ff57e009abecf6ceddb32c8eec14
C++
FallenShard/Crisp
/Crisp/Crisp/PathTracer/Samplers/Fixed.hpp
UTF-8
637
2.640625
3
[ "MIT" ]
permissive
#pragma once #include <random> #include <array> #include "Sampler.hpp" namespace crisp { class FixedSampler : public Sampler { public: FixedSampler(const VariantMap& attribs = VariantMap()); ~FixedSampler(); virtual std::unique_ptr<Sampler> clone() const override; virtua...
true
534e842c80a566448670689e39564d13b80ec74d
C++
Vijay1997/bsdiff
/utils.cc
UTF-8
718
2.546875
3
[ "BSD-2-Clause", "BSD-3-Clause" ]
permissive
// Copyright 2018 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "bsdiff/utils.h" namespace bsdiff { int64_t ParseInt64(const uint8_t* buf) { // BSPatch uses a non-standard encoding of integers. // Hig...
true
0dd28f17779df5ff4805abf0853240fec146058d
C++
dementrock/acm
/berkeley_programming_contest_2012/7.cpp
UTF-8
2,547
3.28125
3
[]
no_license
#include <iostream> #include <string> #include <sstream> #include <vector> #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #define MAXS 10000 using namespace std; struct info { int sum, val, step; int type; // 0: left parenthesis; 1: right parenthesis; 2: other }; in...
true
662975095eda369ed86225b23de702425ebf637e
C++
StudioSimGroup2/2DEngine
/Engine/src/Backend/D3D11/D3D11Renderer2D.cpp
UTF-8
6,448
2.6875
3
[]
no_license
#include "D3D11Renderer2D.h" #include <CameraManager.h> namespace Engine { D3D11Renderer2D::D3D11Renderer2D(Shader* shader, D3D11Device* dev) { mShader = shader; mDeviceContext = dev->GetDeviceContext(); InitBuffers(dev->GetDevice()); } D3D11Renderer2D::D3D11Renderer2D(Shader* shader, D3D11Device* dev, i...
true
ca8dd5d148c5b0d7c25b182f36b21444c5f3498f
C++
rverma870/DSA-practice
/gfg/must do interview que/DP/GetMinimumSquares.cpp
UTF-8
429
2.859375
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int MinSquares(int n) { int dp[n+1]; memset(dp,0,sizeof(dp)); dp[0]=1; dp[1]=1,dp[2]=2,dp[3]=3; for(int i=4;i<=n;i++) { dp[i]=INT_MAX; for(int j=1;j<=sqrt(i);j++) { if(i%(j*j)!=0) dp[i]=min(dp[i],dp[i%(j*j)]+i/(j*j)); else dp...
true
05963d274f4f7dd4a1f25a50e0388b1f20dc96e0
C++
ZelaiWang/WangZelai_CIS17a_42824
/Hmwk/Assignment 1/Truth Table/Truth Table.cpp
UTF-8
1,316
3.484375
3
[]
no_license
#include <iostream> #include <iomanip> using namespace std; //Function prototypes void decide(bool,bool); int main() { cout << setw(10) <<"X : T , Y : T"<<endl; decide(true,true); cout << endl; cout << setw(10) <<"X : F , Y : F"<<endl; decide(false,false); cout << endl; cout << setw(10) <<...
true
e5d7e11ad88c25f26874b60d17eb80faade6125f
C++
Teveillan/templates
/KMP.cpp
UTF-8
524
2.78125
3
[]
no_license
int nxt[N]; void get_next(string s) { int i = 0, j = -1; // j记录已匹配的个数 nxt[0] = -1; while (i < s.size()) { if (j == -1 || s[i] == s[j]) { i++; j++; nxt[i] = j; } else j = nxt[j]; } } //get_next void kmp(string s1, string s2) { int i = 0, j = 0; ...
true
0ace4667f8086b02187b12b6a67d11be52e2259d
C++
lantimilan/topcoder
/CODEFORCE/prob117C.cpp
UTF-8
2,726
2.9375
3
[]
no_license
// ========================================================= // // Filename: prob117C.cpp // // Description: // // Version: 1.0 // Created: 09/23/2011 09:35:37 AM // Revision: none // Compiler: g++ // // Author: LI YAN (lyan), lyan@cs.ucr.edu // Company: U ...
true
e0f86604d70ff5c88f06ef531dde46e04e8a33f2
C++
sipian/Concurrent-MST
/Boruvka_submission/src/boruvka.cpp
UTF-8
10,028
3
3
[]
no_license
#include "boruvka.h" /* * This function computes a partition of the bound of loop a thread should be dedicated to * Assume loops are of form for(int i = starting_index; i < final_index; i++) */ tuple<int, int> Boruvka::getLoopBounds(int threadID, int starting_index, int final_index) { int start, end; int cnt =...
true
f988124cfa510d6bd396e45414adb6f1d83212bc
C++
rizkyaryapermana/tugas-struktur-data-1
/Unguide no 1.cpp
UTF-8
910
2.9375
3
[]
no_license
#include <iostream> using namespace std; int main() { cout << "========================" << endl; cout << " PENCARIAN ANGKA " << endl; cout << "========================\n" << endl; int n, bilangan_dicari, Data[10]; int i; bool ketemu = true; cout << "Masukkan banyak angka : "; ...
true
7318576dff22b3566831d98f201ee5b34fe95a58
C++
jnterry/xeno-engine
/tests/core/bits.cpp
UTF-8
7,014
2.953125
3
[]
no_license
//////////////////////////////////////////////////////////////////////////////// // Part of Xeno Engine // //////////////////////////////////////////////////////////////////////////////// /// \brief Contains unit tests for xeno engines helper types and functions fo...
true
e36a5f5e0775f9351f73998dd96c6c9f8a6c74a0
C++
xkyyxj/s
/algorithm/Calculator.cpp
UTF-8
63,182
3.171875
3
[]
no_license
// // Created by wangqchf on 2018/10/19. // #include "Calculator.h" //资源文件内容,暂时由main函数加载 extern std::map<std::string,std::string> res_map; price_fun Calculator::get_price_fun(PriceFlag flag) { price_fun ret_fun; switch(flag) { case PriceFlag::MAX_PRICE: ret_fun = &stock_info::get_af_max_p...
true
5d64b4a904ba30722116c88411a5173e383e9bcc
C++
troublefrom2001/pip
/it_apple.cpp
UTF-8
1,785
2.53125
3
[]
no_license
#include"h.h" void it_apple(SDL_Renderer *renderer, int x, int y) { it_square(renderer, x+14, y+0 ,100, 50, 0); it_square(renderer, x+14, y+2 ,100, 50, 0); it_square(renderer, x+12, y+2 ,100, 50, 0); it_square(renderer, x+12, y+4 ,100, 50, 0); it_zz(renderer, x+8, y+6 ,4, 'R'); it_zz(renderer, x...
true
ea08702a73d5b9f7b0dbca7fe9c67230393466dc
C++
ryan-duve/d2o_analysis
/d2o_equation_79_evaluator.cc
UTF-8
22,650
2.5625
3
[]
no_license
//This program attempts to solve equation 7.9 in Ward's Thesis (Wurtz 2010) //Works by altering one parameter at a time and finding best fit, then repeats over all of them to refine the answer //Chi squared test is based on Pearson's cumulative test (asymptotically approaches chi squared) //Number of free parameters is...
true
4637cce0f76477971bf8d6cb6481d63612fbac90
C++
fireword/fury3d
/engine/Fury/Singleton.h
UTF-8
1,231
3.421875
3
[ "MIT" ]
permissive
#ifndef _FURY_SINGLETON_H_ #define _FURY_SINGLETON_H_ #include <memory> #include <iostream> #include "Macros.h" namespace fury { template<class TargetType, class... Args> class Singleton { protected: static std::shared_ptr<TargetType> m_Instance; public: // this returns reference to cu...
true
c29d652a75a685dfe0aafa6ab38b01e1d81efb59
C++
saltandlight/SolveProblem
/20190905/circularqueue.cpp
UHC
1,435
3.96875
4
[]
no_license
//ť ϱ (Queue) // Q.create(y) // Q.push(y) // Q.pop() // Q.front() // Q.size() #include <stdio.h> const int MAX = 10; struct Queue{ // 0 1 2 3 4 5 6 7 // data 0 0 0 0 0 0 0 0 // f // r int data[MAX]; int f, r; int capacity; int numElement; ...
true
520dadfe98d248f0fdbbae6f9a2ae9663ebbda50
C++
dtbinh/gobot
/src/lifeFile.cpp
UTF-8
1,666
3.078125
3
[ "MIT" ]
permissive
#include "lifeFile.h" #include <cstdio> bool writeLifeFile(std::map<Block*, bool>& lifeMap, const char* filename) { FILE* f = fopen(filename, "wb"); if(!f) { return false; } int numberOfBlocks = lifeMap.size(); if(fwrite(&numberOfBlocks, sizeof(int), 1, f) != 1) { fclose...
true
971c114eef71dc1d18af25a346913263ac061107
C++
roshal/cpp
/source/trash-common/max.cpp
UTF-8
288
2.71875
3
[]
no_license
#include <iostream> #include "./max" int main() { setlocale(LC_ALL, ""); std::cout << "введите два числа" << std::endl; double a, b; std::cin >> a >> b; std::cout << "наибольшее число" << std::endl; std::cout << max(a, b) << std::endl; return 0; }
true
e96622a7cbbe67cc4e178035a93979b489a1b1fb
C++
AkiraHero/OpenRoadEd
/src/Qt/SettingsWidgets/SettingsLaneSection.h
UTF-8
1,314
2.609375
3
[]
no_license
#ifndef SETTINGSLANESECTION_H #define SETTINGSLANESECTION_H #include "../QtHeader.h" #include "../../OpenDrive/Lane.h" /** * Class that holds all the properties for the LANE_SECTION record * */ class SettingsLaneSection : public QWidget { Q_OBJECT public: /** * Initializes the properties panel and the UI el...
true
10a554a8b5be409cc5abf3f0907030d398d9d566
C++
mikhaputri/Review-Chapter-4
/8.cpp
UTF-8
1,069
3.453125
3
[]
no_license
// // 8.cpp // REVIEW BAGUS // // Created by Mikha Yupikha on 16/10/2016. // Copyright © 2016 Mikha Yupikha. All rights reserved. // #include <iostream> using namespace std; int main() { string colour1, colour2; cout<<"Please enter two primary colours (red, blue or yellow): "; cin>>colour1>>colou...
true
aba29368b534ac8f1113c4b32e1b5bf1c58a5253
C++
UniStuttgart-VISUS/Magic-Mouse-Pad
/mmpdcli/include/MagicMousePad/tokenise.inl
ISO-8859-1
2,288
2.796875
3
[]
no_license
// <copyright file="tokenise.cpp" company="Visualisierungsinstitut der Universitt Stuttgart"> // Copyright 2018 - 2020 Visualisierungsinstitut der Universitt Stuttgart. Alle Rechte vorbehalten. // </copyright> // <author>Christoph Mller</author> /* * MagicMousePad::Tokenise */ template<class C, class P> std::vect...
true
46824096573dec87694ace834481f20a90f74f16
C++
wichza18/BudgetGUI
/BudgetGUI/User.cpp
UTF-8
1,696
3.3125
3
[]
no_license
#include "User.h" User::~User() { delete table; } //default constructor User::User() { table = new UserTable; table->setCurrentID(USER_CURRENT_ID, table->getTableName()); setID(USER_CURRENT_ID); Budget budget; username = "test"; password = "test"; } //full argument constructor User::User(std:...
true
f21a43a2f085f723813ab7d8f9f6405c9d44456e
C++
EzzatQ/Data-Structures-HW2
/Data Structures HW2/RH.hpp
UTF-8
7,264
3.46875
3
[]
no_license
// // Linked List.hpp // Data Structures HW2 // // Created by Ezzat Qupty on 05/05/2019. // Copyright © 2019 Ezzat Qupty. All rights reserved. // #ifndef Linked_List_hpp #define Linked_List_hpp #include "Exceptions.hpp" namespace DataStructures{ //////////////////////////////////////////////////////////////...
true
1125a1150be21a26ed4e75f235546b2800519cc8
C++
brittanymunyeshuli/Cpp1111_1202_Projects
/1202FinalProject/1202FinalProject/StateStats.cpp
UTF-8
1,817
3.515625
4
[]
no_license
#include "StateStats.h" #include <iostream> #include <iomanip> StateStats::StateStats() { string stateName = ""; int confirmed = 0; int recovered = 0; int dead = 0; double deathRate = 0.0; double recoveryRate = 0.0; } StateStats::StateStats(string stateNameIn, int confirmedIn, int recoveredIn, int deadIn) { st...
true
9401dcad716215eaa6f6c89e35980ef23f92301b
C++
quantster/ComputationalFinance
/hw3/LEcuyer.cpp
UTF-8
1,250
2.703125
3
[]
no_license
#include "LEcuyer.h" #include <iostream> using namespace std; MultipleRecursiveGenerator::MultipleRecursiveGenerator( unsigned long _m, unsigned long _a1, unsigned long _a2, unsigned long _a3, long _seed1, long _seed2, long _seed3) : m(_m), a1(_a1), a2(_a2), a3(_a3), seed1...
true