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
c75019f21661bc624e73bbe764e03525d3bc61b7
C++
dillonhuff/TinyCPU
/alu_main.cpp
UTF-8
1,512
2.65625
3
[]
no_license
#include <iostream> #include <ctime> #include <cstdlib> #include "Valu.h" #include "verilated.h" using namespace std; void test_and_out(int argc, char** argv) { Verilated::commandArgs(argc, argv); Valu* top = new Valu; top->eval(); top->op_select = 1; top->in0 = 1; top->in1 = 0; top->eval(); asse...
true
12ddfcc73d1af683157c1128b01bcddef951bb36
C++
sravankr96/Authored-Problems
/surveyor/ipgen.cpp
UTF-8
299
2.625
3
[]
no_license
#include <iostream> #include <fstream> #include <cstdlib> using namespace std; int main() { ofstream ipfile; int n = 0,t = 9; char c[20]; while(t--) { n+=100; cin>>c; ipfile.open(c); ipfile<<n<<endl; for(int i=0;i<n;i++) ipfile<<rand()%n<<endl; ipfile.close(); } return 0; }
true
0c85264f222dd4faf2326abf0224d715070fba0e
C++
Crust3d/C867-Class-Project
/softwareStudent.cpp
UTF-8
653
2.921875
3
[]
no_license
#include <iostream> #include "softwareStudent.h" #include "degree.h" SoftwareStudent::SoftwareStudent() :Student() { major = Degree::SOFTWARE; } SoftwareStudent::SoftwareStudent( string studentID, string firstName, string lastName, string email, int age, double numDays[], Degree degreeProgram)...
true
339c4b3786baa141213f5486b8b24895360b0b56
C++
shivral/cf
/0600/60/667b.cpp
UTF-8
619
3.09375
3
[ "Unlicense" ]
permissive
#include <algorithm> #include <iostream> #include <numeric> #include <vector> template <typename T> std::istream& operator >>(std::istream& input, std::vector<T>& v) { for (T& a : v) input >> a; return input; } void answer(unsigned v) { std::cout << v << '\n'; } void solve(std::vector<unsigned>&...
true
ecedc48e9fd74f2b1d7437813a65a872264bdcff
C++
effekseer/Effekseer
/Dev/Cpp/Effekseer/Effekseer/Effekseer.Effect.h
UTF-8
24,259
2.640625
3
[ "LicenseRef-scancode-nvidia-2002", "BSD-3-Clause", "GPL-3.0-only", "GPL-3.0-or-later", "Bison-exception-2.2", "MIT", "Apache-2.0", "BSD-2-Clause", "GD", "MS-PL", "OFL-1.1", "LicenseRef-scancode-warranty-disclaimer", "IJG", "LicenseRef-scancode-khronos", "Zlib" ]
permissive
 #ifndef __EFFEKSEER_EFFECT_H__ #define __EFFEKSEER_EFFECT_H__ //---------------------------------------------------------------------------------- // Include //---------------------------------------------------------------------------------- #include "Effekseer.Base.h" #include "Effekseer.File.h" //---------------...
true
10434f81d7643a69598ad6974e5b7cf93496d665
C++
ermek-bdnf/c-cpp-sources
/19_accumulate.cpp
UTF-8
1,586
3.953125
4
[]
no_license
//19 accumulate #include<iostream> #include<algorithm> #include<vector> #include<list> #include<string> #include<numeric> //accumulate using namespace std; //sum of even elements //this algorithm can also work with strings int main() { int m[] = {2,3,4}; string result = accumulate(next(begin(m)), e...
true
1105d93f9b0e598a09aa25cc506bc4728cf576a5
C++
jonas2602/ParserGenerator
/ParserGenerator/src/ParserGenerator/Utils/StringUtils.cpp
UTF-8
1,218
3.65625
4
[]
no_license
#include "StringUtils.h" #include <algorithm> std::string StringUtils::ToUpperCase(const std::string& InString) { std::string UpperCaseString = InString; std::transform(UpperCaseString.begin(), UpperCaseString.end(), UpperCaseString.begin(), ::toupper); return UpperCaseString; } std::string StringUtils::ToLowerCas...
true
5f07cb12c0267025e8ab1918e927f6f52248ebb2
C++
OmerCora/NetworkFinalProject
/Project3-Network/GraphicalClient2/cAreaInfo.cpp
UTF-8
557
2.734375
3
[ "MIT" ]
permissive
#include "cAreaInfo.h" //#include "GlobalStuff.h" cAreaInfo::cAreaInfo() { //initialize the member variables with information from external file this->Max.x = 25.0f; this->Max.y = 10.0f; this->Max.z = 25.0f; this->Min.x = -25.0f; this->Min.y = -10.0f; this->Min.z = -25.0f; } cAreaInfo::~cAreaInfo() { } float...
true
c23f88bac6262b33b969bfb5840da4e572d9b65f
C++
NightTerror1721/kpl
/[Distarted]/Krampus Language/src/instruction.cpp
UTF-8
1,140
2.6875
3
[]
no_license
#include "instruction.h" namespace kpl::inst { Instruction& Instruction::b(int value) { if (value >= 0) _inst = (_inst & b_mask) | static_cast<Instruction>((value & 0xff) << 15); else { _inst = (_inst & b_mask) | static_cast<Instruction>((-value & 0xff) << 15) | (0x1 << 14); } return *this; } Ins...
true
25496d894aa7fe45d53d4e4a7ec5f06a7f50b21a
C++
fdfragoso/GameEngines
/Random-Engine/src/AnimationCmp.cpp
UTF-8
2,120
2.84375
3
[]
no_license
#include <iostream> #include "AnimationCmp.hpp" #include "RandomEngine.hpp" using namespace SRE; Animation::Animation(std::vector<Sprite*> sprites, float durationMs) : sprites(sprites), durationMs(durationMs) { minTime = durationMs / sprites.size(); } AnimationCmp::AnimationCmp(GameObject *gameObject) :Component...
true
731eee3e0ae593cacc869a6fadfcabf9ae4d6260
C++
DualBrain/df_win
/src/EventView.cpp
UTF-8
973
3.03125
3
[]
no_license
#include "EventView.h" namespace df { //Create view event with tag VIEW_EVENT, value 0 and delta false. EventView::EventView() : m_tag(VIEW_EVENT), m_value(0), m_delta(false) { setType(VIEW_EVENT); } //Create view event with tag, value and delta as indicated. EventView::EventView(std::string new_tag,...
true
0f54002257d66268181292df2e2a257f5c3ebdcd
C++
rnguyen18/CyclistAssist_Libraries
/LightController/LightController.h
UTF-8
522
2.71875
3
[]
no_license
/* LightController.h - Library for controlling lights. */ #ifndef LightController_h #define LightController_h #include "Arduino.h" class LightController { public: LightController(int headlightPin, int leftPin, int rightPin, int rearPin); void Update(); void UpdateInput(char charIn); bool CheckHeadlightSta...
true
93f518a89c1d7b7b2b7d3534fc4aa1ae813962e4
C++
cmaughan/mgfx
/mcommon/file/mfilesystem.h
UTF-8
6,634
2.984375
3
[ "MIT" ]
permissive
#pragma once #include <sys/stat.h> #include <sys/types.h> #include "string/stringutils.h" #include "file/fileutils.h" namespace mfilesystem { // NOTE: // This is a very simple implementation of the <filesystem> functionality in CPP 14/17. // It is not meant to be production code, but is enough to get this code worki...
true
1825623f84a555ecdebbc4d75647cc196b079c95
C++
softerhardware/jam-stapl
/source/jamnote.c
UTF-8
8,162
2.625
3
[]
no_license
/****************************************************************************/ /* */ /* Module: jamnote.c */ /* */ /* Copyright (C) Altera Corporation 1997 */ /* */ /* Description: Functions to extract NOTE fields from an JAM program */ /* ...
true
199573e821ec5ed03f536b92e4006555942df4ec
C++
wanggaoyang/code_skilss
/code/c++/练习/lintcode/倒数第n个结点.cpp
GB18030
430
3.609375
4
[]
no_license
//еn ֻдʵַ ListNode *nthToLast(ListNode *head, int n) { // write your code here if(head==NULL) return NULL; ListNode *result=head; int count=1; while(head->next!=NULL)//¼һм { head=head->next; count++; } for(int i=0;i<count-n;i++) { result=result->next;...
true
16fa0393021ce818fc4409f26f07bff9873fdea7
C++
Miserlou/RJModules
/src/PitShift.cpp
UTF-8
2,198
2.640625
3
[ "MIT" ]
permissive
/***************************************************/ /*! \class PitShift \brief STK simple pitch shifter effect class. This class implements a simple pitch shifter using delay lines. by Perry R. Cook and Gary P. Scavone, 1995--2019. */ /***************************************************/ #include "...
true
1d0af2e9819f27282bc2a49c633b82d8829e8307
C++
Gratt-5r2/ZippedStream
/ZippedStream/Array/Array.h
UTF-8
9,122
2.546875
3
[]
no_license
// Supported with union (c) 2018 Union team #ifndef __UNION_ARRAY_H__ #define __UNION_ARRAY_H__ namespace Common { template <class T> class ArrayLocator { T* Vector; uint Count; uint FullCount; uint MemoryUsed; uint MemoryAllocated; uint AllocMultiplier; uint refCrt; protected: ...
true
f18c47e797ed1dc2f18a15e193ab996c9a5e8b25
C++
ramzimort/Pudge-Adventures
/Pudge Adventures/Component_Managers/CollisionManager.cpp
UTF-8
6,290
2.625
3
[]
no_license
#include "CollisionManager.h" #include "..\Components\GameObject.h" #include "..\Components\Body.h" #include "..\Components\Transform.h" #include <glm/gtx/norm.hpp> #include <algorithm> #include <iostream> Contact::Contact() { mBodies[0] = nullptr; mBodies[1] = nullptr; } Contact::~Contact() { } bool CheckCollis...
true
6768bf38cfe37c099278f509cca4a5a0bb1c9032
C++
ricky-flyguy/RMZ_2014
/Game2014/Classes/Player.cpp
UTF-8
1,105
2.828125
3
[]
no_license
#include "Player.h" Player::Player(void) { screenSize = Director::getInstance()->getVisibleSize(); this->init(); } bool Player::init() { this->velocity = new Point(2, 5); //velocity->normalize(); return true; } Player* Player::create(const std::string &filename, Point* pos) { Player* p = new Player(); if ...
true
721f148c37f01e30d091074055bd27937be45487
C++
chancelee/Safe
/safe/VirusManage.cpp
GB18030
2,542
2.734375
3
[]
no_license
#include "stdafx.h" #include "VirusManage.h" CVirusManage::CVirusManage() { } CVirusManage::~CVirusManage() { ClearVirusLibData(); ClearProcessLibData(); } //ȡز DWORD CVirusManage::LoadVirusLibData() { HANDLE pFile = nullptr; pFile = CreateFile(GetProgramDir() + TEXT("VirusLib.dat"), GENERIC_READ | GENERIC_...
true
fe2f078e92fed89035af2f248b3120f1f358f0a6
C++
olicity-wong/Algorithm
/剑指offer/4_1.cpp
GB18030
679
3.359375
3
[]
no_license
/* ǴҵµʴϽ/½ǿʼ ʣµľǴСжϣɾɾ */ #include <iostream> #include <algorithm> using namespace std; int main(){ int num[100][100]; int n; int result; cin >> n; for(int i = 0; i < n; i++) for(int j = 0; j < n; j++){ cin >> num[i][j]; } cin >> result; int row = 0; int columns = n-1; while(num[row][columns]!=result ...
true
b4c4eec0435ba03dbf1ae9c64bb6596425f9ca17
C++
greg2010/CC3K
/src/ConcreteVampire.cc
UTF-8
305
2.53125
3
[]
no_license
#include "ConcreteVampire.h" const int defaultHP = 50; const int defaultAtk = 25; const int defaultDef = 25; ConcreteVampire::ConcreteVampire(std::pair<int,int> coords) : Enemy{defaultHP, defaultAtk, defaultDef, coords} { } SubjectType ConcreteVampire::getType() { return SubjectType::Vampire; }
true
da5b1e11729169bb85da2b5835825c8cd7c15d55
C++
dfpreston/Clue-less-Colonel-Mustard-group-
/Clueless_cppDesignIdeas/Clueless/CardDeck.cpp
UTF-8
13,838
2.734375
3
[]
no_license
//////////////////////////////////////////////////////////////////////////////// /// /// Clue-Less /// //////////////////////////////////////////////////////////////////////////////// /// /// \file CardDeck.cpp /// \brief /// /// \date 26 Feb 2019 1205 /// /// \note None /// ////////////////////////////...
true
9b6cfcc8f90734786fa35b3070f6126ab9aaa298
C++
AzJezebel/GameEngineJVK
/EngineEditor/sources/ECS/EntityManager.cpp
UTF-8
933
3.234375
3
[]
no_license
#include "EntityManager.h" #include <cassert> EntityManager::EntityManager() { for (Entity entity = 0; entity < MAX_ENTITIES; ++entity) { m_availableEntities.push(entity); } } Entity EntityManager::CreateEntity() { assert(m_livingEntityCount < MAX_ENTITIES && "Too many entities in existence."); Entity id = m...
true
8bdaa26ba92ee54e0ece41f0d465a50f6c543a3c
C++
lorenzomoulin/Programacao-Competitiva
/URI/matematica/1307.cpp
UTF-8
647
2.765625
3
[]
no_license
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; ull gcd(ull a, ull b){ return (b == 0) ? a : gcd(b, a % b);} int main(){ int t; cin >> t; int cases = 1; while(t--){ string s; cin >> s; bitset<32> bs(s); unsigned long long a = bs.to_ullong...
true
3425e85b059d2ea0ae018af52f5434074a4fde97
C++
Subhash703/CP_CipherSchools
/Assignment_1/Que3.cpp
UTF-8
2,403
4.09375
4
[]
no_license
#include <bits/stdc++.h> using namespace std; //Search in a row wise and column wise sorted matrix /* mat[4][4] = { {10, 20, 30, 40}, {15, 25, 35, 45}, {27, 29, 37, 48}, {32, 33, 39, 50}}; */ int binarySearch(vector<int> v, int start, int end, int x) // Binary ...
true
cbf5c13532584e74975dfce1adf9c49e1a1339d6
C++
MenglaiWang/Leetcode
/338. Counting Bits.cpp
UTF-8
513
3.0625
3
[]
no_license
class Solution { public: int count(int n){ int count = 0; while(n){ count++; n = n&(n-1); } return count; } vector<int> countBits(int num) { if(num < 0) return vector<int>(); std::vector<int> result(num+1,0); for(int i = 1; i <= num; i++ ){ if(result[i] <=0){ ...
true
0858b26f0b9e873442e1e57e3bc77bf6854e2498
C++
orsanawwad/APEX
/AP-MS2/POSIXSockets.h
UTF-8
1,937
3.015625
3
[]
no_license
#ifndef AP_MS2_POSIXSOCKETS_H #define AP_MS2_POSIXSOCKETS_H #include <sys/socket.h> #include <arpa/inet.h> #include <unistd.h> #include <cerrno> #include <iostream> #include <string> #include "string.h" #include <system_error> #include <stdexcept> namespace posix_sockets { class timeout_exception : public std::ru...
true
8c8255ca4f430966e06f8d808756ae49321df52d
C++
codacy-badger/mqtt_mosquitto
/mqtt.cpp
UTF-8
3,439
2.59375
3
[]
no_license
#include "mqtt.h" void MQTT_mosquitto::my_message_callback(struct mosquitto *mosq, void *userdata, const struct mosquitto_message *message) { puts("void my_message_callback()"); if(message->payloadlen){ printf("%s %s\n", message->topic, message->payload); }else{ printf("%s (null)\n", message...
true
2ee7ab519e8e546062bcc067067892c7ef924a1f
C++
jackeylove20XX/Cstudy
/algorithm/cs.cpp
UTF-8
727
3.328125
3
[]
no_license
#include<iostream> #include<vector> using namespace std; void count_sort(vector<int>&v,int k) { int max_v = INT_MIN; for (int i = 0; i < k; i++) //get max value { if (v[i] > max_v) { max_v = v[i]; } } vector<int>b(max_v+1,0); for (int i = 0; i <k; i++) //count { b[v[i]]++...
true
dd13966b6d48d0734650108c0185372537a02f74
C++
fast01/axon
/src/util/log.cpp
UTF-8
1,394
2.828125
3
[]
no_license
#include "util/log.hpp" #include <unistd.h> #include <cstring> #include <cstdarg> using namespace axon::util; Log& Log::get_instance() { static Log instance; return instance; } void Log::log(const char* fn, int ln, LogLevel level, const char* msg, ...) { va_list args; va_start(args, msg); std::str...
true
8ff709f6adf0382a9159ffbf6fead049f436c48c
C++
lukasz-borowka/Saper-remake
/Saper remake/GFX/GFX.cpp
UTF-8
492
3.1875
3
[]
no_license
#include "GFX.h" int Window_Width = 0, Window_Height = 0; /* surface surface to draw the point on int x x pos of the point int y y pos of the point Uint32 color color of the point */ void GFX(SDL_Surface * surface, int x, int y, Uint32 color) { if (x > -1 & y > -1 & x < Window_Width & y < Window_Height) ...
true
67f4457ebd157802006582390fc3065998de8b90
C++
amos42/AgeLib
/src/AGE_GRP/TILE.cpp
UTF-8
3,162
2.578125
3
[ "Apache-2.0" ]
permissive
/*################################################################# ------------------------------------------------------------------- AGE (Ver 1.0) (* =================== *) Amos Game Engine Author : Chu, Kyong-min( Amos ) Da...
true
9d8fea6a3b0a2fe8caa7384196432ca38ed30066
C++
palori/api_swarm_mobile_robot
/API_rpi/task_allocation/tasks.cpp
UTF-8
501
2.6875
3
[]
no_license
#include "tasks.h" Tasks::Tasks(){ init(); } Tasks::~Tasks(){} void Tasks::init(){ this->to_do.set_name("To do"); this->done.set_name("Done"); } int Tasks::get_MAX_LEN(){return MAX_LEN;} void Tasks::set_MAX_LEN(int i){ MAX_LEN = i; to_do.set_MAX_LEN(i); done.set_MAX_LEN(i); } //void print_info(); //Tas...
true
5dcd043a1869e9844598dbc9ba766e65e884c5a4
C++
Liamq12/Misty-Joystick
/Misty_Joystick_MK3/Misty_Joystick_MK3.ino
UTF-8
3,893
2.71875
3
[]
no_license
/* Liam Homburger This is the code for the Misty Joystick Project https://github.com/Liamq12 */ #include <WiFi.h> #include <HTTPClient.h> //Your Network Creds const char* ssid = ""; const char* password = ""; //Misty IP (Can find on the misty app) String MistyIP = ""; //X and Y Analog Pins #d...
true
2d6e51b8ae0485bb4f161ca8630ff2e519947a51
C++
kudotuanminh/CaveStory
/src/sprite.cpp
UTF-8
5,497
2.953125
3
[]
no_license
#include <sprite.h> /* Sprite class * Holds information for individual sprites */ Sprite::Sprite() {} Sprite::Sprite(Graphics &graphics, const std::string &filePath, int sourceX, int sourceY, int width, int height, float posX, float posY) : _x(posX), _y(posY) { this->_sourceRect.x = sourceX; ...
true
225a000cdc3d5aff423947f63744a5366eb48376
C++
swindonmakers/LogoBot
/software/firmware/LogoBotBasic/LogoBotBasic.ino
UTF-8
2,410
2.796875
3
[ "MIT" ]
permissive
#include "Configuration.h" #include <DifferentialStepper.h> #include <Bot.h> #include <Servo.h> Bot bot(MOTOR_L_PIN_1, MOTOR_L_PIN_2, MOTOR_L_PIN_3, MOTOR_L_PIN_4, MOTOR_R_PIN_1, MOTOR_R_PIN_2, MOTOR_R_PIN_3, MOTOR_R_PIN_4); String cmd; // cmd received over serial - builds up char at a time void setup() { initLED...
true
f42fe3a4e3ed81b522d6b696e7d2f8d709c516d6
C++
hitgavin/vehicle-mpc-controller
/src/unicycle_model.cpp
UTF-8
1,294
2.84375
3
[ "MIT" ]
permissive
#include <unicycle_model.h> UnicycleModel::UnicycleModel(const std::string& model_name) : VehicleModel(model_name, 3, 2) { dynamics_function_ = [this](const state_t& x, state_t& dxdt, const input_t& u) { dxdt[0] = u[0] * std::cos(x[2]); dxdt[1] = u[0] * std::sin(x[2]); ...
true
a834875cbbaa8f89fe3f2640be98ca476c349a2e
C++
Shahaf11111/WarGameAI
/vs2017test/HpKit.cpp
UTF-8
496
2.78125
3
[]
no_license
#include "HpKit.h" #include "glut.h" HpKit::HpKit(int c, int r, int hp) : Node(c, r) { this->hp = hp; } int HpKit::getHp() { return this->hp; } void HpKit::drawMe() { double size = 0.01; double* myCoors = this->cell2coor(this->getCol(), this->getRow()); double x = myCoors[0]; double y = myCoors[1]; glColor3d(...
true
8361920fb0a8fe861953a1a7269fbda83ef1ba8d
C++
zhiyu123/practice_project
/Project6/watch.cpp
UTF-8
290
3.15625
3
[]
no_license
#include"watch.h" Watch::Watch(int hour, int minute, int second):m_time(hour, minute, second) { cout << "Watch()" << endl; } Watch::~Watch() { cout << "~Watch()" << endl; } void Watch::display(void) { cout << m_time.m_hour << ":" << m_time.m_minute << ":" << m_time.m_second << endl; }
true
d56d214595102cca62a22468dad0738a38853adb
C++
CHP-EmAS/TWLA
/The worst Link Adventure/Logo_Screen.cpp
UTF-8
8,804
2.796875
3
[]
no_license
#include "Screens.h" #include "Graphic_Manager.h" #include "Sound_Manager.h" Logo_Screen::Logo_Screen(void) : Screen(Screen_Type::Logos) { initScreen(); } void Logo_Screen::updateScreen() { switch(screenState) { case 0: //Show "CHP presents" if(screenStateClock.getElapsedTime().asMilliseconds() > 1500) { ...
true
7df897237f61d515366af31c77352f8c3f2ea4bd
C++
SwordRebellion/algorithm
/6.2 装配线问题.cpp
UTF-8
817
2.578125
3
[]
no_license
#include<stdio.h> int n,e1,e2,x1,x2,a[2][1000],t[2][1000],f[2][1000]; void input() { int i; scanf("%d",&n); scanf("%d%d%d%d",&e1,&e2,&x1,&x2); for(i=0;i<n;i++) scanf("%d",&a[0][i]); for(i=0;i<n;i++) scanf("%d",&a[1][i]); for(i=0;i<n-1;i++) scanf("%d",&t[0][i]); for(i=0;i<n-1;i++) scanf("%d",&t[1][i]); } ...
true
e3e57ee8f9ec6ca80e849c924c7b6d1275b68894
C++
gashe-soo/Algorithm
/hackerrank/SherlockAndAnagrams.cpp
UTF-8
943
3.21875
3
[]
no_license
#include <bits/stdc++.h> using namespace std; // Complete the sherlockAndAnagrams function below. int sherlockAndAnagrams(string s) { int len = s.size(); unordered_map<string, int> m; for (int i = 1; i < len; i++) { for (int j = 0; j <= len - i; j++) { string sub = s.substr(j, i); ...
true
d44b95a23d849377c4b82752adf0d95aabb05329
C++
NullException0/Win32-API-Sample-Code
/Win32 API CreateDirectory/Win32 API CreateDirectory/Win32 API CreateDirectory.cpp
UTF-8
1,646
2.859375
3
[]
no_license
// Win32 API CreateDirectory.cpp : This file contains the 'main' function. Program execution begins and ends there. // https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createdirectorya /* lpPathName = The path of the directory to be created. lpSecurityAttributes = A pointer to a SECURITY_ATTRIBU...
true
9f17337a8cddbc824cd63b5f44ecea751ea29cdb
C++
ryucak/modernCPP
/mcp6/mcp54/54.cpp
UTF-8
568
3.375
3
[]
no_license
/* * 54.cpp * * Created on: 2019/07/16 * Author: hhhhh */ #include <vector> template<typename Input, typename Output> void pairwise(Input begin, Input end, Output result) { auto it = begin; while (it != end) { auto const v1 = *it++; if (it == end) break; auto const v2 = *it++; result++ = std::m...
true
f92d5a0dd36dd3c3d61e807e659b15e0df94f918
C++
nonothing/Dyna-Blaster-cocos2dx
/Classes/Model/Data/PlayerData.h
UTF-8
1,036
2.5625
3
[ "BSD-3-Clause" ]
permissive
#ifndef __PLAYER_DATA_H__ #define __PLAYER_DATA_H__ #include "cocos2d.h" #include "enumerate/EEventType.h" #include "enumerate/EPlayer.h" struct PlayerData { public: int _maxInterval; int _interval; cocos2d::Point _speed; int _sizeBomb; int _maxBomb; int _countBomb; int _speedCount; int ...
true
45c6b48853fd04db553abb414a7810e784fdd2f2
C++
DSobscure/Computer-Graphic-Assignments
/Assignment1_2/Texture.h
UTF-8
827
2.53125
3
[]
no_license
#pragma once #include "FreeImage.h" #include "glew.h" #include <string> #include "glut.h" using namespace std; namespace DSOpenGL { enum TextureType { No_Texture, Single_Texture, Multi_Texture, Cube_Map }; class Texture { public: virtual void Active(bool active) = 0; protected: GLuint* textures; ...
true
11b76897972b5e86235e26fa921a4e64c0f855ce
C++
ravi-dafauti/DataStructures
/Matrix/FloodFillApplication.cpp
WINDOWS-1252
2,459
3.734375
4
[]
no_license
/* Given a matrix where every element is either O or X, replace O with X if surrounded by X. A O (or a set of O) is considered to be by surrounded by X if there are X at locations just below, just above, just left and just right of it. Examples: Input: mat[M][N] = {{'X', 'O', 'X', 'X', 'X', 'X'}, {'X', 'O', 'X...
true
21ef1b7a892392d1f81bed8e5c1b5ff76d0fa765
C++
NandeeshG/projectEuler
/problem3.cpp
UTF-8
477
3.40625
3
[]
no_license
// largest prime factor of any given number #include <iostream> #include <cmath> using ull = unsigned long long; //using namespace std; int main() { ull number; int largest_factor = number; std::cin>>number; while(number % 2 == 0) { number /= 2; largest_factor = 2; } for(int i=3; i <...
true
0aff3f1a1d18af009d79441cfceee45c6282855b
C++
lukeandshuo/video-classifier
/minerva/minerva/optimizer/interface/LineSearch.h
UTF-8
1,161
2.71875
3
[]
no_license
/*! \brief LineSearch.h \date August 23, 2014 \author Gregory Diamos <solustultus@gmail.com> \brief The header file for the LineSearch class. */ #pragma once // Forward Declarations namespace minerva { namespace matrix { class Matrix; } } namespace minerva { namespace matrix { class Blo...
true
abf7789a7e654c9216de744e4c6af6cbbd315d5e
C++
onaycan/trivial_sensor_model
/ObjEnvironment.cpp
UTF-8
693
2.765625
3
[]
no_license
#include "ObjEnvironment.h" Environment::Environment(string filename) { string line; ifstream myfile(filename); if (myfile.is_open()) { while (getline(myfile, line)) { stringstream stream(line); vector<double> current_real_object_coordinates(3); for (int i = 0; i < 3; i++) { strea...
true
83d9c4ba03faaa4f592cefc462d720f3a7bb1ded
C++
dwax1324/baekjoon
/code/1895 필터.cpp
UTF-8
959
2.75
3
[]
no_license
#include <bits/stdc++.h> using namespace std; // 구현 // 1018 체스판 다시 칠하기랑 비슷한문제 //https://www.acmicpc.net/problem/1018 int main() { int n, m; cin >> n >> m; int arr[41][41]; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >> arr[i][j]; } } int t; ...
true
b1c4a9e04c92f2e841db204071010acddf59a74c
C++
fatemetkl/MicroController_course
/Assembly codes in Code Vision/ReverseWord.cpp
UTF-8
1,073
2.515625
3
[]
no_license
#define USE_STRLEN 0 ; //Use strlen to find string length? //#include "stdafx.h" #include <iostream> #include <cstdlib> #include <string> #include <vector> #include <sstream> using namespace std; void reverse(string word) { int n = word.length(); char *arr = new c...
true
2af29ba50d30338f169c65e81053b8bdd99be3df
C++
Dharnisingh/Git_test
/CPP/OperatorOverloading/comparision_operator.cpp
UTF-8
595
3.734375
4
[]
no_license
/*Program to implement comparision operator */ #include <iostream> using namespace std; class x { int i; public: x(int a):i(a) { } // We should implement such operatro using friend fucntions // as by mistake if we pass obj2>obj1 might give us incorrect result // because it will be treated as obj2.operator(ob...
true
033df9011934799c74150c2eb1d9e36d37bb2c85
C++
leandropaganotti/ChatApp
/ChatServer/utils.cpp
UTF-8
591
2.84375
3
[]
no_license
#include "utils.h" namespace utils { std::string &trim(std::string &s) { const std::string delimeters = " \f\n\r\t\v"; size_t p = s.find_first_not_of(delimeters); s.erase(0, p); p = s.find_last_not_of(delimeters); if (std::string::npos != p) s.erase(p+1); return s; } std::string t...
true
654c306955020ab2bd86826e6ddd55640a1741bd
C++
ezEngine/ezEngine
/Code/Engine/Foundation/Types/UniquePtr.h
UTF-8
3,535
3.09375
3
[ "MIT" ]
permissive
#pragma once #include <Foundation/Basics.h> /// \brief A Unique ptr manages an object and destroys that object when it goes out of scope. It is ensure that only one unique ptr can /// manage the same object. template <typename T> class ezUniquePtr { EZ_DISALLOW_COPY_AND_ASSIGN(ezUniquePtr); public: EZ_DECLARE_ME...
true
72fd98fa5249a3c7a8f93c1e41ae09f6f4fe5ea0
C++
MrAndMrswang/SimpleNetBase
/SrcFile/Poller.h
UTF-8
823
2.765625
3
[]
no_license
#ifndef MUDUO_NET_POLLER_H #define MUDUO_NET_POLLER_H #include <map> #include <vector> #include <boost/noncopyable.hpp> #include "Timestamp.h" #include "EventLoop.h" class Channel; class Poller : boost::noncopyable { public: typedef std::vector<Channel*> ChannelList; Poller(EventLoop* loop); virtual ~Poller(); ...
true
b49fa487db09e7ce213c24636d5b2fc344c90d71
C++
atubo/online-judge
/luogu/P4030.cpp
UTF-8
2,414
2.828125
3
[]
no_license
// https://www.luogu.org/problemnew/show/P4030 // [Code+#2]可做题1 #include <bits/stdc++.h> using namespace std; // note row and col are 1-indexed here class FenwickInFenwick { public: const int N, M; int **root; FenwickInFenwick(int N_, int M_): N(N_), M(M_) { alloc(); } ~FenwickInFenwick(...
true
1c9ae3120888120da00d756ac7932e7d1521c16f
C++
cruzj6/Syntax-Analyzer
/ConsoleApplication8/SyntaxAnalyzer.cpp
UTF-8
5,568
3.234375
3
[]
no_license
#include "SyntaxAnalyzer.h" int main() { SyntaxAnalyzer SyntaxAnalyzer; } SyntaxAnalyzer::SyntaxAnalyzer() { if (lexer.openFile()) { lexer.getChar(); nextToken = lexer.lex(); cout << "Deriving how your class is going from code: \n"; //cout << "First token is: " << nextToken << "\n"; taking_a_class...
true
772501c2d8293af38b0a9c6987697367c7e96d5f
C++
sttie/game_of_patterns
/include/model/field.h
UTF-8
2,667
2.578125
3
[]
no_license
#pragma once #include <cstdint> #include <tuple> #include <optional> #include <vector> #include <game_objects/npc.h> #include <model/cell.h> #include <game_objects/player.h> #include <logging/notifier.h> #include <common.h> #include <snapshots/field_snapshot.h> namespace Model { class Field { public: ...
true
428e08b6568dca78556c9f3084f514ba4556a81d
C++
klzwii/UDPSpeeder
/RS.cpp
UTF-8
4,298
2.578125
3
[]
no_license
// // Created by liuze on 2021/4/12. // #include "RS.h" #include <cstdio> #include <cstring> void RS::encode(uint8_t **shards, unsigned ShardLength) { for (int i = DataShards; i < DataShards + FECShards; i++) { for (int j = 0; j < ShardLength; j++) { for (int k = 0; k < DataShards; k++) { ...
true
aafe8c2e3870545553f19f95d534b16f1271c307
C++
NightCreature/SpaceSim
/SpaceSim/Input/InputState.cpp
UTF-8
2,424
2.84375
3
[]
no_license
#include "Input/InputState.h" #include "Math/MathUtilityFunctions.h" #include "Input/InputSystem.h" #ifdef _DEBUG ///----------------------------------------------------------------------------- ///! @brief TODO enter a description ///! @remark ///---------------------------------------------------------------------...
true
2403ab95db95841a714cc0122c0e0c2c73fd96c7
C++
gammabray/Mario-Stuff
/mario cplus/Tile.hpp
UTF-8
906
2.8125
3
[]
no_license
#pragma once #ifndef TILE_HPP #define TILE_HPP #include <SFML\Graphics.hpp> #include <memory> #include "DisplayObject.hpp" namespace Game { enum tileID : char { DIRT = '1', SNOW, // 2 SAND, // 3 METAL,// 4 DLTOP,// 5 DRTOP,// 6 DLBOT,// 7 DRBOT,// 8 DLEDGE = 'G', DREDGE, //H DTEDGE, //I D...
true
cece1307937317875a56eca77429b87ae28bc2de
C++
wfnuser/POJ
/1273.DrainageDitches/main.cpp
UTF-8
1,214
2.609375
3
[]
no_license
#include<iostream> #include<string.h> #include<cstdio> #include<queue> using namespace std; #define min(a,b) (a<b?a:b) #define INF 1000000 const int MAX = 210; struct Node { int c; int f; }; int sx,ex; int pre[MAX]; Node map[MAX][MAX]; int n,m; bool BFS() { memset(pre,0,sizeof(pre)); queue<int> Q; Q.push(sx...
true
581371cc8a3c24b63b5521d2b212f60704f8ffa1
C++
a6461/Qt-PyQt
/C++/I/05-FORMS/4/form.cpp
UTF-8
1,152
2.578125
3
[]
no_license
#include "form.h" #include "ui_form.h" Form::Form(QWidget *parent) : QWidget(parent), ui(new Ui::Form) { ui->setupUi(this); setFixedSize(size()); form2->setWindowFlags(Qt::Dialog | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint); form3->setWindowFlags(Qt::Dialog | Qt::WindowCloseButton...
true
7e294608da8b741d12fc5a97e2ecab8d5a39cd93
C++
raychaudhuri-amitava/prog
/c++/double_arithmetic/double_arithmetic.cc
UTF-8
1,844
3.171875
3
[]
no_license
#include<iostream> #include<fstream> #include<stdint.h> #include <fcntl.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <limits.h> using namespace std; template <class T> std::ostream& safe_write(std::ostream& s, const T& val ) { s.write( reinterpret_cast<const char *>(&val), sizeof(T) )...
true
a7ca56d5fc3da36396fdd051e05781aca1285657
C++
anonymouss/cpp_notes
/head_first_design_patterns/10_State_Pattern/src/GumballMachine.cpp
UTF-8
5,449
2.703125
3
[]
no_license
#include "GumballMachine.h" #include <iostream> constexpr int DEFAULT_COUNT = 5; struct GumballMachine::BaseState : public IState { explicit BaseState(GumballMachine *machine) : mMachine(machine) {} virtual ~BaseState() = default; virtual void insertQuarter() override{}; virtual void ejectQuarter() ...
true
2f0251345449bd9073c7812e73278fb57c3ab6ec
C++
leobang17/algorithms-assignment
/Algorithms02/Algorithms02_04.cpp
UTF-8
1,001
3.53125
4
[]
no_license
#include <stdio.h> #define _CRT_SECURE_NO_WARNINGS int binarySearch(int arr[], int target, int start, int end); void arrayPrinter(int arr[], int arrayLen); int main(void) { int arr[9] = { 12, 34, 37, 45, 57, 82, 99, 120, 134 }; int target; int start = 0; int end = (sizeof(arr) / sizeof(int)) - 1; arrayPrinter(a...
true
c68ba0daf6a3e188bc53e83003a07772b04cb7a2
C++
metodos-computacionales-1/ejercicio13-JFRodriguezH
/ejercicio_c_13.cpp
UTF-8
1,724
3.515625
4
[]
no_license
#include <iostream> int fill(int **m, int N); int producto(int **m, int **n, int **mult, int N); int main(){ std::cout.precision(16); std::cout.setf(std::ios::scientific); int N; std::cout<<"Escriba el valor de N: "<<std::endl; std::cin>> N; std::cout<<std::endl; int **m; m =...
true
962c2ac3a20b1ce1b852e37afae1420ff92752ca
C++
gnuevo/median-data-structure
/tests.cpp
UTF-8
1,200
3.34375
3
[]
no_license
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file #include "catch2/catch.hh" #include "data_structure.hh" #include <iostream> using namespace std; TEST_CASE( "Test the computing of the median", "[median]" ) { int i; DataStructure data; SECTION( "Trying with...
true
2203edcc3243fd1d4fb06f1845fa45fe31ecbcf1
C++
TWLK139/Discrete-Prim
/Prim/Prim.cpp
GB18030
5,446
2.734375
3
[]
no_license
#include<iostream> #include <cstdlib> #include <ctime> #include<stdlib.h> #define INF 65535 // #define MaxVerNum 8 //󶥵 typedef int elementType; //ͼж typedef float eInfotype; //eInfoͣȨֵ typedef struct eNode //Ľṹ { int adjVer; //ڽӶϢ˴Ϊţ1ʼ eInfotype eInfo; //бʾߵϢߵȨֵ struct...
true
c261beb4823e62930640122ca8bf6752e882da2e
C++
BartoszSiemienczuk/GL_Cubes
/ConsoleApplication1/Camera.cpp
UTF-8
665
3.078125
3
[]
no_license
#include "Camera.h" void Camera::setLastPost(Vector3 lastPos) { this->lastPos = lastPos; } Vector3 Camera::getLastPost() { return this->lastPos; } void Camera::setVertAngle(float angle) { this->vertAngle = angle; } float Camera::getVertAngle() { return this->vertAngle; } void Camera::setAngle(float angle) { t...
true
7ba0d552eeb8551030fe2059e7f0183cba4da327
C++
naseem366/Data-Structures-and-Algorithms-master
/Array Data Structures/noble.cpp
UTF-8
494
3.3125
3
[]
no_license
#include<iostream> #include<bits/stdc++.h> using namespace std; int noble(int arr[],int n) { sort(arr,arr+n); for(int i=0;i<n-1;i++){ if(arr[i]==arr[i+1]) continue; if(arr[i]==n-i-1){ return arr[i]; } } return 1; } int main() { int arr[] = {10, 3, 2...
true
db7eb8574aee0609d55d1e8fe918d0c0f7f173fe
C++
alkaidlong/PaperDemo
/Dev/Common/MedusaCore/Core/String/BaseString.h
UTF-8
20,424
2.90625
3
[]
no_license
#pragma once #include "Core/String/TStringRef.h" #include "Core/Assertion/CommonAssert.h" #include "Core/Utility/HashUtility.h" #include "Core/Memory/Memory.h" #include "Core/String/StdString.h" MEDUSA_BEGIN; template<typename T> class BaseString { public: const static T LineSeparator=StdString::ConstValues<T>::Lin...
true
46e656cc35db7331a32d5c0516e547f4758bb014
C++
9-5-2-7/learning
/src/27_conpare_list<int>_vector<int>.cpp
UTF-8
635
3.4375
3
[]
no_license
#include <iostream> #include <list> #include <vector> bool compare(const std::list<int> &a, const std::vector<int> &b) { if(a.size() != b.size()) { return false; } auto ablist = a.begin(); //auto aelist = a.end(); auto bb = b.begin(); while(ablist != a.end()) { if(*abli...
true
5211357378f5976cee7ab103e38cd2bb6c7b4728
C++
rinconm/ENGR19C
/examples/CH4-A.CPP
UTF-8
1,069
3.21875
3
[ "MIT" ]
permissive
/* Eddie Rangel */ /* COMS B35 OOP C++ */ /* CH4-A.CPP */ /* 2-13-03 */ /* Asks user for a double */ /* HEX value in each byte */ #include<iostream.h> #include<conio.h> #include<iomanip.h> union uprgrm { double number; unsigned char c[8]; }; main() { uprgrm byte; clrscr(); cout << "Please...
true
88d444b021439685757063427ad07e30fdf41073
C++
ren-zhe/landlordD
/card.h
GB18030
938
3.1875
3
[]
no_license
#include"cocos2d.h" enum pukeType { Heart, Spade, Diamond, Club, Joker }; class Card : public cocos2d::Sprite { public : Card(pukeType type, int num):puketype(type),number(num),select(false),moveState(false){} virtual bool init(pukeType type, int number); static Card* create(pukeType type, int numb...
true
29469a1d0175194a3064d378a2061d443e2b63a6
C++
whoozle/toolkit
/src/toolkit/text/Formatters.cpp
UTF-8
697
2.90625
3
[ "MIT" ]
permissive
#include <toolkit/text/Formatters.h> namespace TOOLKIT_NS { namespace text { void HexDump::ToString(StringOutputStream & ss) const { if (!Name.empty()) ss << Name << ": "; if (Buffer.empty()) { ss << "[empty]"; return; } for(size_t base = 0, size = Buffer.size(); base < size; base += 16) { s...
true
38c9fe043c8c4a583fbfb5761388f074e371fcd8
C++
mcszymist/homework
/HW5/build.cpp
UTF-8
2,502
3.453125
3
[]
no_license
// build.cpp // City to City Max Toll // By Tyler J Roberts // For CS411 HW5 #include "build.hpp" #include <vector> using std::vector; #include <algorithm> using std::sort; //compare to sort bridges with west then sort same west bridges by east const bool compare(const Bridge &a,const Bridge &b){ if(a[0] == b[0])...
true
5f0e9743f32f62fe9fb22af005778470ffbaefb3
C++
astone30/PopeyeEngine
/Popeye/src/Popeye/Resource/Mesh.cpp
UTF-8
1,215
2.75
3
[]
no_license
#include "Mesh.h" namespace Popeye { Mesh::Mesh(std::vector<float> _vertices, std::vector<unsigned int> _indices, BoundBox _boundbox) { vertices = _vertices; indices = _indices; boundbox = _boundbox; SetMesh(); } void Mesh::SetMesh() { glGenVertexArrays(1, &VAO); glGenBuffers(1, &VBO); glGenBuffer...
true
859850ad51c20cb6ec77a1647c085989d4573912
C++
ajtazer/cpp
/62.cpp
UTF-8
628
3.09375
3
[]
no_license
#include<iostream> #include<string.h> using namespace std; int main() { char string[3][30],ch; int i,j,k,len; cout<<"Enter your 3 string : \n"; for(i=0;i<3;i++) cin.getline(string[i],30); cout<<"Your entered string : \n"; for(i=0;i<3;i++) cout<<string[i]<<"\n"; cout<<"Reverse...
true
04e5c3c3b0faded9c67de67760b4f7c0d7c6b2ea
C++
alexandraback/datacollection
/solutions_2652486_0/C++/black3r/main.cpp
UTF-8
1,557
2.75
3
[]
no_license
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <queue> #include <stack> #include <unordered_map> #include <unordered_set> #include <set> #include <map> #include <cstdio> #include <cstdlib> using namespace std; vector<int> cards; vector<int> input; int R, N, M, K; void gen_cards...
true
a01a39f42c004e2f431b2f61a4a235e5ec6d55ea
C++
supercomputra/comp6618036-tnca-week-4
/Source/User.hpp
UTF-8
689
2.84375
3
[ "MIT" ]
permissive
#ifndef USER_HPP #define USER_HPP #include "Foundation.hpp" typedef UInt64 UserIdentifier; struct Profile { String name; String address; Profile() { name = ""; address = ""; } }; struct User { public: UserIdentifier id; String email; Profile profile; Bool isPasswordMatched(String password...
true
6ec22678039fe6c873ca1c9b64276db19edb43b6
C++
sam007961/toy-browser
/src/dom.hpp
UTF-8
1,796
3.046875
3
[]
no_license
#pragma once #include <memory> #include <vector> #include <unordered_map> #include <unordered_set> #include <string> class DomVisitor; namespace dom { struct Node; typedef std::unique_ptr<Node> NodePtr; // Node base class struct Node { // child nodes std::vector<NodePtr> children; ...
true
af5e90a85c4bc7799160cceb21f45b6a3d74b9de
C++
ZMLight/DataStructureHomework
/dataStructureHomework/1316/1316.cpp
UTF-8
1,881
3.34375
3
[]
no_license
#include <iostream> using namespace std; struct MilkProcessTime { int start, end; MilkProcessTime *next; MilkProcessTime(int s = 0, int e = 0, MilkProcessTime *t = NULL):start(s), end(e), next(t){} }; int main() { int N, startT, endT, oneInterval, noInterval; bool flag = false; M...
true
3072582177e918f40fe020b2508fd21d7269ec77
C++
alexxyjiang/photo-sign-freeimage
/src/hsvcolor.cpp
UTF-8
2,956
2.859375
3
[ "MIT" ]
permissive
/** hsvcolor.cpp - Support RGB & HSV color convert * @author: Alex.J. (alexxyjiang@gmail.com) * @date: 2017-09-19 */ #include "hsvcolor.h" namespace PhotoMgr { HSVACOLOR convert_rgba2hsva(const RGBQUAD rgba_color) { double r = double(rgba_color.rgbRed / 255.0); double g = double(rgba_color.rgbGre...
true
8b6faba8dd0f8df87c522e869b8e5216e744f157
C++
dtraczewski/zpk2014
/home/kgawron/projekt_zaliczeniowy_poprawiony/main.cpp
UTF-8
19,640
2.578125
3
[]
no_license
/* ****************************** ** 2048 game ** ****************************** */ #include <allegro5/allegro.h> #include <allegro5/allegro_primitives.h> #include "allegro5/allegro_image.h" #include <allegro5/allegro_font.h> #include <allegro5/allegro_ttf.h> #include <iostream> #include <sstream> #in...
true
011a545499299853e99ee19d063782adc8058ba7
C++
jaye1944/lcpp
/cpp11/template.cpp
UTF-8
255
2.75
3
[]
no_license
#include <iostream> //g++ -std=c++11 <file.cpp> int rValue(int k) { int kk = k*k; return kk; } int main (int argc, char *argv[]) { std::cout << "Hello World" << std::endl; auto answ = rValue(3); std::cout << answ << std::endl; return 0; }
true
64808e114a457eb5baf8610a0bc94ec8cc87d52e
C++
klowell/COMP-2010-Summer-2018-Lab8
/Lab8.cpp
UTF-8
1,319
3.921875
4
[]
no_license
/***************************************************************************************** Project Name: Lab 8 Name: Kristopher Lowell Date Completed: 8/8/2018 Purpose: Using a class with overloaded operators, add, subtract, multiply, and divide two rational numbers represented by two integers each. *******************...
true
1adbd3648406ae49b885eca517b8e6991527a0b7
C++
maryllb/all_studey
/c++/day5/company/include/Employee.h
UTF-8
476
2.8125
3
[]
no_license
#pragma once #include<iostream> #include<string> using namespace std; /*---抽象类----*/ class Employee { public: Employee(); virtual ~Employee(); //人员初始化 virtual void init(string name) = 0; //升级 virtual void uplevel(int level) = 0; //获取薪资 virtual double getsalary() = 0; //显示员工信息 voi...
true
e8cba4dde2ddf8364334e9b76a98b16bb2f17d3b
C++
canon4444/AtCoder
/etc./colopl2018-final-open/A.cpp
UTF-8
1,372
2.90625
3
[]
no_license
#include <iostream> using namespace std; int main() { long long int N; string S; cin >> N >> S; int len = (int)S.length(); long long int ans = 0, k = 0; if( S[0] == 'A' && S[len-1] == 'A' ){ long long int s = -1, e = -1; for( int i = 0; i < len; ++i ) if( s == -1 ...
true
a955e63a83309e68f6ca8769e97b01fbbfd375e2
C++
syrota-roman/LeetCode
/findTheDifference.cpp
UTF-8
926
3.984375
4
[]
no_license
/* Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at a random position. Find the letter that was added in t. */ #include <iostream> #include <algorithm> using namespace std; class Solution { public: char findTh...
true
e79ebaca70787b03167dc73cc4db2cfefc4c2cb5
C++
dhruvpatel348/C-Programming
/L-8.cpp
UTF-8
225
2.953125
3
[]
no_license
#include<stdio.h> int main() { int i,n,s=1; printf("\nEnter n=>"); scanf("%d",&n); for(i=n; i>=1; i--) { printf(" %d * ",i); s=s*i; } printf("\n factorial is %d",s); }
true
03c308519d612a7b441723375b1cd3eeeb978d5b
C++
rohitbakoliya/algorithms
/Data Structures/Linked list/Singly_link_list.cpp
UTF-8
3,753
3.796875
4
[]
no_license
#include<stdio.h> #include <stdlib.h> struct node{ int data; struct node* next; }; void Finsert(struct node** pointerToHead , int x) { struct node* temp; temp = (struct node*)malloc(sizeof(struct node)); temp->data= x; //temp->next = NULL; // if(head!=NULL) temp->next = *pointerToHead; ...
true
a8dfacf8510ee2340164edd0e4456b4bf6d086a3
C++
FcoCarlosMM/C2-5
/src/move_turtlesim/src/test1.cpp
UTF-8
6,082
3.265625
3
[]
no_license
// Code: Test1. // Objective: Simulate the movement of a Turtlebot usin Turtlesim as basis for a further code using Turttlebot hardware. // Mini project. // Author: Team C2-05, Robot Programming, Robotics, AAU. // December 2018. //////////////////////////////////////////////////////////////////////////////////////...
true
d588765d5dc722b15ebc88b19ad59f28ead996be
C++
snowynguyen/atcoder
/ARC113/d.cpp
UTF-8
850
2.828125
3
[]
no_license
#include <bits/stdc++.h> using namespace std; const int mod = 998244353; int pw(int a, int b) { if (b == 0) return 1; long long c = pw(a, b / 2); c =c * c % mod; if (b % 2 == 1) c = c * a % mod; return c; } int F(int n, int k) { return ((pw(k, n) - pw(k ...
true
5c05f71477bf51094e2236bf2cc6b608aa1e5796
C++
IdanTo1/spl-assignment1
/src/PopularTag.cpp
UTF-8
1,080
3.171875
3
[]
no_license
// // Created by idanto on 20/11/2019. // #include "../include/Session.h" PopularTag::PopularTag() : _name(""), _count(0) {} PopularTag::PopularTag(std::string name) : _name(name), _count(1) {} PopularTag::PopularTag(const PopularTag& other) : _name(other._name), _count(other._count) {} PopularTag::~PopularTag() ...
true
d2bf358810a21c1b60e79d9ff59236459b72698e
C++
mahamedHassan/Dev-projects
/c++/pointer1/pointer1/main.cpp
UTF-8
833
3.859375
4
[]
no_license
// // main.cpp // prints the values and addresses of values // // Created by Mahamed Hassan on 1/27/21. // #include <iostream> using namespace std; int var, *ptr; //Definition of variables var and ptr int main() //outputs the values and addresses of the variables var and ptr. { var = 100; ptr = &var;...
true
563787c8a2f3d242c2f134a07fd186422b4923a6
C++
romanchom/WiFlyer
/main/MotorPWM.hpp
UTF-8
604
2.984375
3
[]
no_license
#pragma once #include "PWM.hpp" struct MotorPWM : PWM { MotorPWM(PWMTimer * timer, gpio_num_t pin, float durationAtZeroPower = 0.001f, float durationAtFullPower = 0.002f) : PWM(timer, pin), mDurationAtZeroPower(durationAtZeroPower), mDurationAtFullPower(durationAtFullPower) { t...
true
74f90f740295a727373415b80a9f6969070cb1dc
C++
nitinkumar2558/LAB-8
/l2.cpp
UTF-8
2,037
3.921875
4
[]
no_license
//Write a program to find the largest, smallest, mean, median, elements with highest frequency of the elements of all elements of an array. (Use functions for each of the task in the question) #include<iostream> using namespace std; void foomean(int aarray[],int sizeofarray); void foomedian(int aarray[],int sizeofarr...
true