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
dc0add341acad2cd7f0f777b9ec98b23b14c1a99
C++
as99if/Algorithm
/C++/02. queue enqueue dequeue using array.cpp
UTF-8
1,304
3.53125
4
[]
no_license
#include<iostream> using namespace std; #define size 4 int a[size+1] ; int f=0, r=0; void display(){ int i, s; cout<<"\nArray : "; if(f==r){ cout<<"Queue is empty"<<endl; } if(f!=r){ for(i=f; i<r; i=s){ s=(i+1)%(size+1...
true
51e17841c82f7134b8f3d91510a209bb58d2d395
C++
gyunderscorebe/ActionFPS-Game
/source/src/command.cpp
UTF-8
63,002
2.640625
3
[ "BSD-3-Clause", "Cube", "Zlib" ]
permissive
// command.cpp: implements the parsing and execution of a tiny script language which // is largely backwards compatible with the quake console language. #include "cube.h" bool allowidentaccess(ident *id); char *exchangestr(char *o, const char *n) { delete[] o; return newstring(n); } void scripterr(); vector<int> con...
true
e1166b8780e2692c255ff48d79f6713c339f1e75
C++
tlund80/automated-colour-calibration
/src/experiments/classifyBall.cpp
UTF-8
3,243
2.953125
3
[]
no_license
#include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <iostream> #include <stdio.h> using namespace cv; using namespace std; /** @function main */ int main(int argc, char** argv) { Mat srcOrig; /// Read the image srcOrig = imread( argv[1], 1 ); //src_grayOrig = imread(...
true
ea1e00b92621861295937fb7ca3dea7c5d5f9e01
C++
yangjufo/LeetCode
/2021/1228. Missing Number In Arithmetic Progression.cpp
UTF-8
544
2.84375
3
[]
no_license
class Solution { public: int missingNumber(vector<int>& arr) { int firstDiff = arr[1] - arr[0], secondDiff = arr[2] - arr[1]; if (abs(firstDiff) < abs(secondDiff)) { return arr[1] + firstDiff; } if (abs(firstDiff) > abs(secondDiff)) { return arr[1] - ...
true
74c2d2e2db046a06335df940dc189f53bf700ac1
C++
GeorgiMinkov/SD-Practicum-2016-2017
/HW01/Request.cpp
UTF-8
13,434
2.984375
3
[]
no_license
#include "stdafx.h" #include "Request.h" // In every request we check some equals condition: if file we want to read from, exist in directory, if it is open. // We have check if there is already output file request then we check for infile equality and if it is not equal we delete file and write over it, to // save co...
true
2ea772ba5bbc91f550fbc8775837a8a138aedc0d
C++
alloncm/spirit
/Engine/Font.h
UTF-8
489
2.546875
3
[]
no_license
#pragma once #include"Surface.h" #include"Vec2.h" #include"Graphics.h" class Font { public: Font(std::string filename, Color chroma = Colors::White); void DrawText(std::string& src, Location& pos,Color color, Graphics& gfx); private: RectI MapGleaphRect(char c); private: Surface sprite; int gliphHeight; int gli...
true
e541710426efc9ffcadaf87cfb6bd67c723a59bb
C++
yok3r/COVID_Ambu
/Arduino/seguridad_v1/seguridad_v1.ino
UTF-8
1,118
2.8125
3
[]
no_license
const int endstopper1 = 2; // Endstopper 1 const int onoff = 3; // Endstopper 1 int endstopper1State = 0; int onoffState = 0; int lastendstopper = 1; const int alarm = 12;// Alarm on pin 4 unsigned long previousMillis = 0; unsigned long currentMillis = 0; const long interval = 6000; // Set the Time in milli...
true
3affb5ab6026407658671791447f85811b8909f1
C++
mooleetzi/ICPC
/contest/ac_automation/hdu2896.cpp
WINDOWS-1252
2,709
2.609375
3
[]
no_license
#include<iostream> #include<cstring> #include<cstdio> #include<queue> #include<algorithm> using namespace std; const int maxn=5e5+10; struct node{ node *fail; node *next[180]; int cnt,num; node(){ fail=NULL; memset(this->next,NULL,sizeof this->next); cnt=num=0; } }*q[maxn]; v...
true
7cb7b87a19fa92be98379956f717b7b9cbff35d5
C++
OverlordOvl/MemoryModificator
/op_in.cpp
UTF-8
251
2.578125
3
[]
no_license
#include <vector> #include <string> // verification of the occurrence bool op_in(const std::string &verifiable, std::vector<std::string> &root) { for (const auto& i: root) { if (verifiable == i) return true; } return false; }
true
e075e1f31cc16549e441f9f0884776d55ad4362d
C++
DanMitroshin/Tech1
/game1.0.0.cpp
UTF-8
9,019
3.359375
3
[]
no_license
#include <iostream> #include <vector> #include <ctime> #include <random> #include <string> using namespace std; class Hero { public: Hero() { doll = 0; } bool doll; string status; }; // Абстрактный базовый класс видов людей class Worker { public: virtual void info() = 0; virtual ~Worker() {} }; ...
true
78260e4dcbaeb8c739788415d5f7253169d9dcf6
C++
trungtle/Project3-CUDA-Path-Tracer
/src/shaderProgram.cpp
UTF-8
3,349
2.71875
3
[]
no_license
/* * Adpated from OpenGL Tutorial: http://www.opengl-tutorial.org/beginners-tutorials/tutorial-2-the-first-triangle/ */ #include "shaderProgram.h" ShaderProgram::ShaderProgram( const char* vertFilePath, const char* fragFilePath ) { m_programID = glslUtility::LoadShaders(vertFilePath, fragFilePath); m_unifMod...
true
52990feb5f15ffc2b307d635afcf38c8e961b763
C++
xlu29466/TCI
/TCI/TDIC.cpp
UTF-8
23,064
2.59375
3
[]
no_license
/* * File: TDIC.cpp * Author: Kevin Lu * * Created on April 25, 2015, 6:13 PM */ using namespace std; #include "TDIC.h" #include <fstream> #include <math.h> #include <iostream> #include <fstream> #include <string.h> #include <string> #include <vector> #include <sstream> #include <stdio.h> #include <stdlib.h> ...
true
4d06088eea5cfda964083c0a20354bc4818c6a5b
C++
caixiaomo/leetcode-ans1
/leetcode C++/DP/2D/Interleaving_String/Interleaving_String.cpp
UTF-8
1,489
2.953125
3
[]
no_license
class Solution { public: bool isInterleave(string s1, string s2, string s3) { // Note: The Solution object is instantiated only once and is reused by each test case. int size1 = s1.size(); int size2 = s2.size(); int size3 = s3.size(); vector<vector<bool>> matrix(size1 + 1...
true
d042dfc4d938e207bf0f21a8871751bf6897383c
C++
StanPlatinum/idash-sgx-bench
/mojo-cnn_demo/examples/parser/imagenet_parser.cpp
UTF-8
2,646
2.78125
3
[ "MIT" ]
permissive
#include <vector> #include <iostream> #include "imagenet_parser.h" using namespace std; using namespace imagenet; std::string data_path="./testdata/"; int main(int argc, char *argv[]) { //int width, height; vector<vector<float>> train_records; vector<int> train_labels; vector<vector...
true
41ce426fe0fba0e52d04445e37d72ff4211e93cd
C++
Mozenn/SDLGame
/SDLGame/Source/UI/Button.cpp
UTF-8
2,297
3.015625
3
[]
no_license
#include "Button.h" Button::Button() { } Button::~Button() { free(); } void Button::free() { mTexture->free(); mText->free(); } void Button::render(int x, int y, SDL_Rect* clip , double angle , SDL_Point* center , SDL_RendererFlip flip ) { mTexture->render(x,y,clip,angle,center,flip); if (mText != null...
true
c0aa3d6410ccec79227c42fb3d1b2321707cc50d
C++
JournKim/BOJ
/1813_마지막_한마디.cpp
UTF-8
288
2.75
3
[]
no_license
#include<iostream> using namespace std; int table[100002] = { 0, }; int main() { int n,a; cin >> n; for (int i = 0; i < n; i++) { scanf("%d", &a); table[a]++; } int max = -1; for (int i = 0; i <= n; i++) { if (i == table[i]) { max = i; } } cout << max << endl; }
true
253843b284580af6d5510dcd9c2ef02659bc3e39
C++
mcaiox/BankAccounts
/Account.cpp
WINDOWS-1252
534
3.34375
3
[]
no_license
#include "Account.h" using namespace std; Account::Account(double balance){ deposit(balance); } void Account::setInterest(double interestRate) { interest = interestRate; } double Account::getInterest(){ return interest; } void Account::deposit(double amount) { if (amount >= 1.0) balance += amount; else th...
true
16952c509001504f7b4cd32dd8e95fa306d15a76
C++
Arunpar/C-Program
/Pattern_Of_Alphabets.cpp
UTF-8
274
2.796875
3
[]
no_license
#include<iostream> using namespace std; main() { int row,col,num; char c='A'; cout<<"Enter the Number : "; cin>>num; for(row=1;row<=num;row++) { for(col=1;col<=row;col++) { cout<<" "<<c; c=c+1; } cout<<"\n"; c='A'; } return 0; }
true
278f3b05366c991981c7f2cdd070e9b87940d6ff
C++
TheRemote/BattleCity-Classic
/Client/CExplode.h
UTF-8
816
2.9375
3
[]
no_license
#ifndef __CEXPLODE__ #define __CEXPLODE__ #include "CGame.h" class CGame; class CExplosion { public: CGame *p; int X, Y; int Type; int Animation; __int64 tick; CExplosion *next; CExplosion *prev; CExplosion(int X, int Y, int Type, CGame *Game) { p = Game; this->X = X; this->Y = Y; this->Type = Ty...
true
83b34de00eec469b1ba3d406bb3fa74c99680463
C++
Grarak/Pong-Cpp
/point.cpp
UTF-8
1,469
2.78125
3
[ "Apache-2.0" ]
permissive
/* * Copyright (C) 2015 Willi Ye * * 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 t...
true
9143acf335f1980c5354ff4a849f0c01786a3261
C++
sarahkittyy/ScriptableTCP
/include/State/State.hpp
UTF-8
1,176
3.328125
3
[ "MIT" ]
permissive
#pragma once #include <SFML/Graphics.hpp> #include <memory> /** * @brief A program state. * Contains methods to draw what it needs to, as well as * update it per frame. * */ class State { public: /** * @brief Construct a new State object * * @param window The SFML window to draw to. */ State(sf::Ren...
true
c72940783fec1b6d0c0fc79173d98b06cfa49f2b
C++
Seaftware/locked-up
/src/utils.cpp
UTF-8
1,165
3.390625
3
[]
no_license
#include <cmath> #include "utils.hpp" float Utils::min(float a, float b) { return a < b ? a : b; } float Utils::max(float a, float b) { return a > b ? a : b; } float Utils::lerp(float a, float b, float f) { return a + f * (b - a); } float Utils::clamp(float v, float min, float max) { if(v < min) ...
true
2cdfdb5578aa52610d5b5f54effa52ee7828347f
C++
fabiuccio/University
/System Programming Project - Minifilter driver plus remote logger (Italian Language)/VLService/DisinstallazioneServizio/DisinstallazioneServizio.cpp
UTF-8
1,523
2.609375
3
[]
no_license
#include "stdafx.h" #include <Windows.h> #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { SC_HANDLE myService, scm; BOOL success; SERVICE_STATUS status; cout << "Removing Service...\n"; // Open a Service Control Manager connection scm = OpenSCManager(0, 0, SC_MANAGER...
true
f2fb885ea25e8af864b3623f3c636112f0163eea
C++
McSimp/ts3-auto-afk
/TS3AutoAFKPlugin/plugin.cpp
UTF-8
4,242
2.625
3
[]
no_license
#include "plugin.hpp" #include <iostream> #include <thread> #include <Windows.h> static struct TS3Functions ts3; static bool shouldExitMonitorThread; static std::thread idleMonitorThread; static DWORD secondsForIdle; static bool isSetToAFK; static bool shouldRestoreAFK; static bool shouldRestoreMuteSound; static bool...
true
dd2eb83b4005c89eb51c8dd2daf24171a3ed3314
C++
martinnobis/Head-First-Design-Patterns-Cpp
/Command/Remote_Control/main.cc
UTF-8
1,286
2.859375
3
[]
no_license
#include <iostream> #include <memory> #include "remote_control.h" #include "Light/light_on_command.h" #include "Light/light_off_command.h" #include "Light/light.h" #include "Stereo/stereo_on_command.h" #include "Stereo/stereo_off_command.h" #include "Stereo/stereo.h" int main(void) { RemoteControl remote_contro...
true
8e42a2a825969172050ced55466fd7dd636eb4e0
C++
jourdanj/JoynerJourdan_CSC5_46091_SUM2015-
/Assignments/Assignment 4/Gaddis 7th ed ch 5 #1/main.cpp
UTF-8
746
3.171875
3
[]
no_license
/* * File: main.cpp * Author: Jourdan Joyner * Created on July 13, 2015, 6:53 PM * Purpose: Gaddis 7th Ed ch 5 # 1 */ #include <iostream>//i/o libraries using namespace std; //User functions // Global Constants //Function proto1types //execution begins int main(int argc, char** argv) { int num...
true
38195f7bfcbc8e326f530f0184c8d78bd961e769
C++
ashleygay/DCP
/day6/solve.cpp
UTF-8
1,245
4.03125
4
[]
no_license
#include <iostream> class list_head { /* Contents of the diff fields: * * A B C D E * B <-> A^C <-> B^D <-> C^E <-> D */ public: list_head(void* elt) : _elt(elt){} // Add an elt to the list void add(void* elt) { list_head* list = this; list_head* prev = nullptr; while (list->diff != (size_t)prev) { ...
true
1399fc14860c88e7bd4c2da57bb32faada7125dc
C++
WenqiJiang/Fast-Vector-Similarity-Search-on-FPGA
/FPGA-ANNS-local/generalized_K_10_12_bank_4_PE/src/LUT_construction.hpp
UTF-8
30,811
2.625
3
[]
no_license
#pragma once #include "constants.hpp" #include "types.hpp" //////////////////// Function to call in top-level //////////////////// template<const int query_num> void lookup_table_construction_wrapper( const int nprobe, const int nprobe_per_table_construction_pe_larger, const int nprobe_per_table...
true
6120a67ef68b3746f608d220f66c3c3a71f5dfc1
C++
huoxiaodan-kaihong/C-Plus-Plus
/Practice_primer/pta_6-3.cpp
UTF-8
520
3.625
4
[]
no_license
#include <iostream> using namespace std; const double PI=3.1415926; class Circle { protected: double radius; Circle(double r) { radius = r; } double getArea() { return PI * radius * radius; } }; class Cylinder : public Circle { private: double h; public: Cylinder(double r, dou...
true
67d6649c59974d761ee9cb19fd19de72e4a3f91c
C++
ItzelXu/EE569-ImageProcessing
/569_HW4/p1/p1_code/Morphology.cpp
UTF-8
16,814
2.671875
3
[]
no_license
/* EE569 Homework Assignment #4 * Date: Noverber 29, 2015 * Name: Meiyi Yang * ID: 6761054585 * email: meiyiyan@usc.edu * Problem1. OCR * * Main function: * p1_main.cpp * * Class OCR: * OCR.h * OCR.cpp * * Class Image: * image.h * image.cpp * * Class Morphology: * Morphology.h * Morphology.cpp */ #...
true
881d91abb8eab2ec433e5b1368beb5a3eb44edbb
C++
Anguei/OI-Codes
/LuoguCodes/P1100.cpp
UTF-8
195
2.609375
3
[ "MIT" ]
permissive
//【P1100】高低位交换 - 洛谷 - 0 #include <iostream> int main() { unsigned long long n; std::cin >> n; std::cout << ((n & 0x0000ffff) << 16 | (n & 0xffff0000) >> 16) << std::endl; }
true
49a6001fbca611f51c6130c1767d39ce3cada98a
C++
10n1/RiotPrototype
/src/scene/ObjectManager.h
UTF-8
5,237
2.625
3
[]
no_license
/*********************************************************\ File: ObjectManager.h Purpose: Handles allocation of objects Author: Kyle Weicht Created: 3/31/2011 Modified: 5/20/2011 4:16:57 PM Modified by: Kyle Weicht \*********************************************************/ #if...
true
97f24eb4f268036b61672767b45e47e0f615296d
C++
Emily-ejag/PlayingwithCPP
/FunctionFun1/FunctionFun1/main.cpp
UTF-8
255
2.96875
3
[]
no_license
#include <iostream> using namespace std; void printSomething(); //function prototipe, otherwise all funtions must be set before main int main() { return 0; } //funtion itself void printSomething() { cout << "Hello beautiful human being" << endl; }
true
cb718e9d117cf027981cef5ded18a03329f0c1c5
C++
Small-Embedded-Systems/assignment-2-asteroids-W15016306
/asteroids/src/model.cpp
UTF-8
10,117
2.59375
3
[]
no_license
//Joshua Higgins - W15016306 //Connor Moore - W15012760 /* Asteroids model */ #include <stdbool.h> #include <stdint.h> #include <stdlib.h> #include <math.h> #include "model.h" #include "utils.h" #include "asteroids.h" #include "view.h" //variable Decleration static const int heapsize = 25; static node_t heap[heap...
true
50d334e7bcc2b822a00eb6315014f94e8791fec4
C++
tidus-open/ClickHouse
/src/Parsers/ClickGraph/ParserCypherEntity.cpp
UTF-8
1,762
2.625
3
[ "Apache-2.0" ]
permissive
#include <Parsers/ClickGraph/ParserCypherEntity.h> #include <Parsers/ClickGraph/ParserCypherMapList.h> #include <Parsers/ClickGraph/ParserCypherAliasAndLabel.h> #include <Parsers/ClickGraph/ASTCypherMapList.h> #include <Parsers/ClickGraph/ASTCypherAliasAndLabel.h> #include <Parsers/ClickGraph/ASTCypherNode.h> namespac...
true
4186fc62c383a1101ac69ef16e1751e40f680ffe
C++
efleming111/2DEngine
/2DEngine_Win32/2DEngine_Win32/src/engine/components/lilRigidbody.h
UTF-8
2,095
2.578125
3
[]
no_license
// // 2DEngine // lilRigidbody.h // Eric Fleming // 5/18/2018 // #pragma once #include <list> #include <string> #include <Box2D\Box2D.h> #include "lilComponent.h" #define lilVector2D b2Vec2 #define lilMax b2Max #define lilMin b2Min class lilRigidbody : public lilComponent { public: lilRigidbody(lilGameObject...
true
231df06af382d3d89c3ead6ca7dc624c65893423
C++
ldcduc/CS202
/Week_5/ex01/function.cpp
UTF-8
1,867
3.40625
3
[]
no_license
#include "function.h" int Staff:: base_salary = 10; int Staff:: paper_support = 40; int Staff:: project_salary = 100; void Staff:: set_static(int salary, int paper, int project) { base_salary = salary; paper_support = paper; project_salary = project; } double Staff:: get_salary() { return salary; } ...
true
ec7a1e2f27c464fa2a363cd651434a569da2b418
C++
sanasarjanjughazyan/Data_structures
/List.cpp
UTF-8
4,797
3.53125
4
[]
no_license
#include <iostream> #include <cassert> #include <initializer_list> template <typename T> class List { template <typename T> struct Node { T data; Node* next; Node(const T& data) : data(data), next(nullptr) {} }; mutable size_t size; Node<T>* head; public: template <typename T> class iterator { Node<T...
true
a502eb9166f31d481f439435562c3ffeb8335ccc
C++
butchhoward/cmake_exmample
/tests/testlib.cpp
UTF-8
258
2.703125
3
[ "MIT" ]
permissive
#include "gtest/gtest.h" #include <modern/lib.hpp> TEST( example, first_two_returned ) { std::vector<double> values {1, 2., 3.}; auto [the_first, the_second] = first_two(values); EXPECT_EQ( the_first, 1.0 ); EXPECT_EQ( the_second, 2.0 ); }
true
657e4c6702a7328e71531a31ca4c1243f1884d3d
C++
vikash7325/AlgorithmDesign
/CharMaxLen.cpp
UTF-8
639
3.109375
3
[]
no_license
/*Author Vikash Kumar Goldman Sachs*/ #include<iostream> using namespace std; char getMaxLen(string inp){ int len; int max = 1; char val; char temp; char Output = '\0'; int count = 1; len = inp.length(); temp = inp[0]; val = temp; for (int index=1; index < len; index++){ if (temp == inp[...
true
2bb314a12c9d230138ec74b8f1647dd1b1f413d2
C++
WasiqMemon/level-based-mario
/hammer_bros.hpp
UTF-8
354
2.578125
3
[]
no_license
#pragma once #include "enemy.hpp" class Hammer: public Enemy{ //Does not do damage, but pushes you away SDL_Rect onimage[3]; // to make animation int frame; // frame to be currently displayed for animation public: Hammer(SDL_Renderer*, SDL_Texture*, SDL_Rect); void draw(); //Draws an...
true
551e17b07cc20b14cff18869ce6efd0c0d3f05b4
C++
UCC-Programacion3-historico/segundo-parcial-el-equipo
/src/TPFinal/arbolmail.cpp
UTF-8
1,965
2.84375
3
[]
no_license
#include "arbolmail.h" arbolMail::arbolMail() { raiz = NULL; } arbolMail::~arbolMail() { } nodoMail* arbolMail::put(email n,int modo) { if (raiz == NULL) { raiz = new nodoMail(n); return raiz; } return raiz->put(n,modo); } void arbolMail::put(nodoMail* n,int modo) { if (raiz == ...
true
9e927d6df7657ee0128fc88f400e37651e26dfca
C++
wildstar84/fauxdacious
/src/libfauxdcore/inifile.cc
UTF-8
3,053
2.515625
3
[ "LicenseRef-scancode-public-domain", "BSD-2-Clause", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
/* * inifile.c * Copyright 2013 John Lindgren * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions, and the f...
true
5eccdf78f3da9e15d4ed8c0c606fd68b05d945de
C++
slashformotion/prc
/EXERCICES/3/rollingMean.cpp
UTF-8
789
3.046875
3
[]
no_license
#include "rollingMean.hpp" namespace moy { double RollingMean::total() const { double result=0; for (auto &elem: tableau_) { result+=elem; } return result; } double RollingMean::mean() const { return (total() / double(count())); ...
true
d41afd5eeffda7c8071b3ab2c4e3acd1efead465
C++
mitkooo12345/excel-table-project
/OOP Project/Main.cpp
UTF-8
1,517
3.046875
3
[]
no_license
#include <fstream> #include "Cell.h" #include"UserController.h" const int BUFF_SIZE = 5000; void printFileName(char* arr, int pos, int size) { for (int i = pos; i < size; i++) { std::cout << arr[i]; } } int getFileNameStart(char* arr, int size) { for (int i = size; i > 0; i--) { if (arr[i] == '\\') { retur...
true
7c8c09f7ca0e6c3ad154dfe208c7b63d4c3a232c
C++
graphics-rpi/oasis_dependencies
/dynamic_projection/source/applications/magnification/cursor.cpp
UTF-8
5,733
2.796875
3
[]
no_license
#include "cursor.h" #include <random> #include <ctime> #include "canvas.h" #include "argparser.h" // Static variable since all cursors have same base model bool Cursor::initialized_ = false; GLuint Cursor::cursor_pos_vbo_ = 0; GLuint Cursor::cursor_color_vbo_ = 0; GLuint Cursor::cursor_vao_ = 0; ArgParser* Cursor::...
true
94d4f3cb21c3916296bf5ffa7f1c30cb014b37db
C++
KaranPupneja/cpp-programming
/Level 4 - Advanced Programming Concepts/uca 110 - improved.cpp
UTF-8
738
3.53125
4
[]
no_license
#include<iostream> using namespace std; int main() { int i, n, largest, sec_largest; cout << "Enter number of values: "; cin >> n; int arr[n]; cout << "Enter values:\n"; for(i = 0; i < n; i++) { cin >> arr[i]; } largest = arr[0]; for(i = 1; i < n; i++) { ...
true
91e2af8e5425b5adc18b4be113402743300251be
C++
kokeiro001/YamabiYagiNoHoko
/山火-ヤギの咆哮-/SpriteNode.hpp
SHIFT_JIS
8,058
2.890625
3
[ "MIT" ]
permissive
#pragma once // Złقlj /// XvCg̕`W enum DrawPosType { DRAWPOS_ABSOLUTE, ///< EBhE̐΍W DRAWPOS_RELATIVE, ///< eXvCg̑΍W }; /// eNX`̓@ enum TextureDivType { TEX_DIVTYPE_NONE, ///< Ȃ TEX_DIVTYPE_SIMPLE, ///< TEX_DIVTYPE_USER, ///< [U[w肵`Qŕ }; /// XvCg@\񋟂 class Sprite : public boost::enable_sha...
true
5826d0c851390dd412f7628f505dd8319889ec7e
C++
KimiroDev/NIM
/variables.h
UTF-8
4,108
2.703125
3
[]
no_license
#ifndef VARIABLES_H_INCLUDED #define VARIABLES_H_INCLUDED //#define _WIN32_WINNT 0x0601 //not always necessary // Unicode needs to be enabled so that //WHITESPACE character can be used #ifndef UNICODE #define UNICODE #define UNICODE_WAS_UNDEFINED #endif #include <Windows.h> #ifdef UNICODE_WAS_UNDEFINED #undef UNICO...
true
13bc841345f874f0ddc2c4485d9d76533fa422c8
C++
Barkole/sudoku
/src/Condition.h
UTF-8
2,318
2.625
3
[ "MIT" ]
permissive
// Condition.h: interface for the CCondition class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_CONDITION_H__1AE36C4B_CAA5_4210_B176_990D8447C9BA__INCLUDED_) #define AFX_CONDITION_H__1AE36C4B_CAA5_4210_B176_990D8447C9BA__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif ...
true
6b64736a83e2d885555dabb5ffe7de5bd5be72e0
C++
everbgs/OpenCV-Testes
/projetos/simple1/first.cpp
UTF-8
511
2.5625
3
[]
no_license
#include <opencv/cv.h> #include <opencv/highgui.h> int main(int argc, char** argv) { //Carregar a imagem IplImage *img = argc > 1 ? cvLoadImage(argv[1], -1) : cvLoadImage("lena.jpg", -1); //Cria uma janela para exibir a imagem cvNamedWindow("tela1", CV_WINDOW_AUTOSIZE); //Exibir a imagem cvShowImage("...
true
c5b58a8f167937f600ff12a5d453a3d42e82704b
C++
furkan-enes-polatoglu/C-Basics
/C 5 (Döngüler - While,Do-While,For )/For.cpp
ISO-8859-9
771
2.84375
3
[]
no_license
#include <stdio.h> #include <locale.h> #include <math.h> int main() { setlocale(LC_ALL,"Turkish"); /* for(int i=1; i<=10; i++) { printf("%d - Hello World\n",i); } */ /* for(int i=1; i<=10; i++) { printf("%d saysnn kp = %d\n",i,i*i*i); } */ /* int s1,i; printf("...
true
264f0e6d7ad73643e0aaa2fb79daf1e31361848a
C++
tgni/alg
/kaoYan/tsinghua/buildTree.cc
UTF-8
886
3.703125
4
[]
no_license
#include <iostream> #include <string> using namespace std; struct Node { char val; struct Node *lchild, *rchild; Node(char c) : val(c), lchild(nullptr), rchild(nullptr) {} }; typedef struct Node Tree; Tree * createTree(string &str, int &i) { char c; Node *T; if ((c = str[i++]) == '#') return NULL; T = n...
true
5d31d365754d6faff19512e06f2be2351a2a82ec
C++
adyjunior/adyjrpucgo
/3_semestre/workspace/Triangulo/Principal.cpp
ISO-8859-1
590
3.125
3
[]
no_license
/* * Principal.cpp * * Created on: 21/09/2009 * Author: jUniN C.Z.N */ #include<iostream> #include<cmath> #include"Triangulo.h" using namespace std; int main() { float a,b,c; Triangulo t(a,b,c); cout<<"Digite o Valor do lado a \n"; cin>>a; cout<<"Digite o Valor do lado b \n"; cin>>...
true
e8444713935a4203ba138df8292ae9a6c53cd147
C++
wobushimotou/Daily
/ACM/其它/week4/3.cpp
UTF-8
726
3.53125
4
[]
no_license
/* * 修改钟表显示时间 * 若时间显示正常,则不做修改,若不正常,则显示修改最少的数字来达到的最小合理时间 * * * */ #include <iostream> using namespace std; int main() { string time; cin >> time; string Hour,Minute,Second; Hour = time.substr(0,2); Minute = time.substr(3,2); Second = time.substr(6,2); if(Hour[0] > '2') { ...
true
b104e1c143d8cc4f0fc7faba478cfb3c774f8a2f
C++
7kia/OOD
/Lab6/shape_drawing_lib/Triangle.cpp
UTF-8
439
2.6875
3
[]
no_license
#include "stdafx.h" #include "Triangle.h" namespace shape_drawing_lib { CTriangle::CTriangle(const Point & p1, const Point & p2, const Point & p3) : m_point1(p1) , m_point2(p2) , m_point3(p3) { } void CTriangle::Draw(graphics_lib::ICanvas & canvas) const { canvas.MoveTo(m_point1.x, m_point1.y); canvas...
true
6c68ee807c236f31e651727f1cce1d406156f959
C++
Sam-Evans-Thomson/Platformer_Live
/Window/Texture.h
UTF-8
2,116
2.640625
3
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: Texture.h * Author: sam * * Created on 31 January 2016, 1:05 PM */ #ifndef TEXTURE_H #define TEXTURE_H #include ...
true
e7d76c542b5413bdca4b9e16d95481232fb59257
C++
sumagowri/CGMiniProject
/ShortestPath.h
UTF-8
1,796
3.015625
3
[]
no_license
#include <stdio.h> #include <limits.h> #include <vector> int minDistance(int dist[], bool sptSet[], int size){ int min = INT_MAX, min_index; for (int v = 0; v < size; v++) if (sptSet[v] == false && dist[v] <= min) min = dist[v], min_index = v; return min_index; } void printPath(int parent[], int j, std::v...
true
6962ac23798a07688b340fad24b96a9d5ab7bc9a
C++
michaelwangzhenan/gitskills
/codeJam/codeJam/src/machineStudy.cpp
UTF-8
1,389
2.734375
3
[]
no_license
#include <iostream> #include <fstream> #include <string.h> #include <stdlib.h> //#include "../inc/machineStudy.hpp" using namespace std; #define MAX 26 int study[MAX][2] = {0}; void readNameGender(char* p) { char seps[] = ","; char *token=NULL; token = strtok( p, seps ); int i=0,index=0; while( token != NULL ...
true
1dcf67dbc476b224a6bef0586aeaab68f2fa5604
C++
Sahil12S/MarioReborn
/GameEngine/States/GameState.h
UTF-8
833
2.515625
3
[]
no_license
#ifndef GAME_STATE_H #define GAME_STATE_H #include "State.h" #include "../Game.h" #include "../Entities/Player.h" namespace SSEngine { class GameState : public State { public: GameState( GameDataRef data ); ~GameState(); void Init() override; void HandleInput( float dt ) o...
true
d4712d5b098f28c17aa23f2a47073322c8a1a056
C++
liuq901/code
/CF/cd_59_A.cpp
UTF-8
344
2.734375
3
[]
no_license
#include <cstdio> #include <cstring> #include <cctype> char s[10000]; int main() { scanf("%s",s); int n=strlen(s),a=0,b=0; for (int i=0;i<n;i++) if (islower(s[i])) a++; else b++; for (int i=0;i<n;i++) s[i]=a>=b?tolower(s[i]):toupper(s[i]); printf("%s\n...
true
756dc6076f5e225723d806d2000a27a1d665f5d0
C++
Neverous/xivlo08-11
/OBOZY/2010 - Październik/kkostniezer.cpp
UTF-8
643
2.90625
3
[]
no_license
/* 2010 * Maciej Szeptuch * XIV LO Wrocław */ #include<cstdio> //#define DEBUG(args...) fprintf(stderr, args) #define DEBUG(args...) unsigned int tests, number, magic[21] = { 1, 1, 2, 6, 4, 2, 2, 4, 2, 8, 4, 4, 8, 4, 6, 8, 8, 6, 8, 2, 6, }; inline unsigned int factorial(unsigned int...
true
ae57fdcb8be65376beaef6bc89e2f6366abbea24
C++
tmf7/Engine-of-Evil
/EngineOfEvil/source/Box.cpp
UTF-8
2,272
2.640625
3
[]
no_license
/* =========================================================================== Engine of Evil GPL Source Code Copyright (C) 2016-2017 Thomas Matthew Freehill This file is part of the Engine of Evil GPL game engine source code. The Engine of Evil (EOE) Source Code is free software: you can redistribute it and/or mo...
true
f92cb572de04e43e6d6b071f32a13b05d3fef19f
C++
ranjiewwen/Everyday_Practice
/C--C++/设计模式/SingletonPatternEx/SingletonPatternEx/SinglePattern/SingletonFactory.cpp
UTF-8
542
2.78125
3
[]
no_license
#include "SingletonFactory.h" #include "FactoryA.h" #include "FactoryB.h" SingletonFactory *SingletonFactory::m_Instance = NULL; SingletonFactory::GC SingletonFactory::gc; SingletonFactory *SingletonFactory::GetInstance(FactoryEnum factory) { if (m_Instance == NULL) { switch (factory) { case kFactory_A: m_...
true
cbee3d37517672107161ec44659a8bbd29a72dc6
C++
wowns9270/code_up
/백준/그리디/2457_공주님의 정원.cpp
UHC
1,013
3.09375
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int n, st, en, cnt; vector<pair<int, int>> arr; bool cmp(pair<int, int> x, pair<int, int> y) { if (x.first < y.first) { return true; } return false; } int main() { // Ǵ³ Ѵ. cin >> n; for (int i = 0; i < n; i++) { int a, b, c, d; cin >> a >> b >> c >> d; arr....
true
11b8d63aae149eb15fb23637602c6c23967679f3
C++
Abhiramon/ioi-training
/CodeForces/479A - Expression.cpp
UTF-8
431
2.734375
3
[]
no_license
//11064485 2015-05-10 19:50:12 Hiasat98 A - Expression GNU C++ Accepted 15 ms 0 KB #include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { int a1, a2 , a3; cin >> a1 >> a2 >> a3; int ans = a1 + a2 * a3; ans = max(ans,a1 * a2 * a3); ans = max(ans,a1 * (a2 + a3))...
true
441dbb9b1e5316a8f6e44a8efda907c7da79881c
C++
GorMkrtchyan/Test1
/ConsoleApplication2.cpp
UTF-8
6,161
3.0625
3
[]
no_license
// ConsoleApplication2.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <vector> #include <list> #include <algorithm> #include <numeric> #include <map> #include <set> #include <string> #include <iterator> #include <mutex> #include"windows.h" ...
true
daea85975d136e834ddbf5cce910ce83da882fbf
C++
hamstache/CoffeeDecorator
/Whip.cpp
UTF-8
251
2.90625
3
[]
no_license
#include "Whip.h" Whip::Whip(const Beverage& beverage) : CondimentDecorator("Whip", beverage) { } std::string Whip::description() const { return "Whip, " + beverage().description(); } double Whip::cost() const { return 0.10 + beverage().cost(); }
true
19abebeabe1cdf34652ca2ac9185956016c6b66d
C++
dytron/obi
/batalha2.cpp
UTF-8
380
2.953125
3
[]
no_license
// OBI 2018 PJ Fase 3 #include <iostream> using namespace std; int main(){ int a1, d1, a2, d2; cin >> a1 >> d1 >> a2 >> d2; int v1 = 0, v2 = 0; if (d1 == a2) v1 = 1; if (d2 == a1) v2 = 1; if (v1 == v2){ cout << -1 << endl; }else{ if (v1){ cout << 1 << endl; ...
true
427b9e0db83c6bc572be9d9878c185b4b38a0bda
C++
yfisyak/star-sw
/garfield/Source/ComponentComsol.cc
UTF-8
23,058
2.546875
3
[]
no_license
// Copied and modified ComponentAnsys123.cc #include <iostream> #include <fstream> #include <sstream> #include <stdlib.h> #include <math.h> #include <map> #include "ComponentComsol.hh" namespace Garfield { ComponentComsol::ComponentComsol() : ComponentFieldMap() { m_className = "ComponentComsol"; } ComponentCom...
true
cacba5eb9451e275433a25338f2022bb8e758cdf
C++
Subzero-10/leetcode
/.history/57.insert-interval_20200728174058.cpp
UTF-8
5,174
3.15625
3
[]
no_license
/* * @lc app=leetcode id=57 lang=cpp * * [57] Insert Interval * * https://leetcode.com/problems/insert-interval/description/ * * algorithms * Hard (32.65%) * Likes: 1657 * Dislikes: 185 * Total Accepted: 254.2K * Total Submissions: 759.8K * Testcase Example: '[[1,3],[6,9]]\n[2,5]' * * Given a set ...
true
99af6a0e655b7ea821c0fcf995bc834e7565ba1c
C++
FilipaDurao/Advent-Of-Code-2017
/Day 4/Day 4 Part 2.cpp
UTF-8
1,003
3.3125
3
[]
no_license
/* * Day 4 Part 2.cpp * * Created on: 04/12/2017 * Author: filipa */ #include <iostream> #include <fstream> #include <string> #include <vector> #include <sstream> #include <algorithm> using namespace std; bool checkRep(string input){ stringstream ss; ss << input; vector<string> words; string word; ...
true
11dbe4fdc17bf1642d2305d592ca1bb47572eb7d
C++
joepisconte/Envio-y-Recepcion-de-Trama-Serial-Arduino
/ReceptorSerial/ReceptorSerial.ino
UTF-8
1,786
3.34375
3
[ "MIT" ]
permissive
/* Recepción de Trama Serial de datos separados por comas * Se espera un mensaje en el formato: -12.5, 15.6, -0.7, 26.0, 3.6, 27.1$ * Este programa requiere un $(dolar) para indicar el final de la trama */ const int NUMERO_DE_DATOS = 30; // numero de campos esperados int fieldIndex = 0; // el a...
true
309b0851eaf3135527d726580cb03534fa9b85ed
C++
mnm1021/lz78
/hw2.cpp
UTF-8
630
2.859375
3
[]
no_license
#include <iostream> #include <fstream> #include <sstream> #include <string> #include "lz78.h" using namespace std; int main(int argc, char** argv) { string input, encoded_string; ifstream input_file (argv[1]); ofstream encoded_file (argv[2]); ofstream decoded_file (argv[3]); stringstream str_stream; str_strea...
true
66fab56f92f0c3191219651dc66988b8f7bc2812
C++
vinicius-godoy/Projetos-Faculdade
/teatro-c++/main.cpp
ISO-8859-1
4,897
3.421875
3
[]
no_license
#include <iostream> #include <iomanip> #include <cstdlib> #include <clocale> #include "contador.h" #include "teatro.h" //Namespaces using namespace std; //Prottipos de Funo void imprimir_teatro(int, int, Teatro&); void menu_compra(Teatro&, Contador&); void menu_troca(Teatro&); void menu_devolucao(Teatro&, Contador&);...
true
638a3bd651c0e441e346ea0a24d8eee0ec852744
C++
Vishal-Maharathy/Hostel-Management-DTU
/student_checkin.h
UTF-8
4,752
2.90625
3
[]
no_license
#include <stdlib.h> #include <ctime> #include <fstream> #include <iostream> #include <string> #include <vector> #include "checkin.h" using namespace std; void check_time() { string branch; int roll; cout << "\033[1;33mPlease enter your Branch: \033[0m"; cin >> branch; cout << "\033[1;33mPlease ente...
true
e1f31626ae2ed7d878a5fcf4cda1561e013c279a
C++
liuzyon/group-project-ctzl
/ConwaysGame_Serial.cpp
UTF-8
3,135
2.8125
3
[]
no_license
// #include <iostream> // #include <sstream> // #include <fstream> // #include <cstdlib> // #include <time.h> // #include <vector> // #include <chrono> // using namespace std; // //Note that this is a serial implementation with a periodic grid // vector<vector<bool>> grid, new_grid; // int imax, jmax; // int max_step...
true
1b30af208e159d0c1dc53061a87a6e134470f59d
C++
dyninst/paradyn
/pdutil/h/tunableConst.h
UTF-8
4,897
2.78125
3
[]
no_license
/* * tunableConstant - a constant that might be changed during execution. * * $Log: tunableConst.h,v $ * Revision 1.10 1994/12/21 07:10:06 tamches * Made the "allConstants" variable protected and added a few member * functions to let outside code access it (safely) in a manner useful * for doing iterations thr...
true
f7879d67df3c8a7d10421851db227ba1ce3bb1ce
C++
Shahaf11111/Maze_BestFirstSearch_AStar
/vs2017test/cell/cell_group/CellGroup.cpp
UTF-8
1,246
3.28125
3
[]
no_license
#include "CellGroup.h" CellGroup::CellGroup(int source, int target, int gray, int black, int path) : CellContainer::CellContainer(source, target, gray, black, path) { } bool CellGroup::doesBelongToTarget(int color) { return color != this->sourceColor && color != this->targetColor && color != this->grayColor && c...
true
395bd9693454e08a1af4569216a3f0c4c6e6656b
C++
Artanic30/CS171-ASSIGNMENTS
/cs171-assignment3-Artanic30/code/head/shape.hpp
UTF-8
420
2.78125
3
[]
no_license
#pragma once #include <utility> #include "aabb.hpp" #include "interaction.hpp" class Shape { public: AABB m_BoundingBox; Eigen::Vector3f color; Shape(Eigen::Vector3f color) : color(std::move(color)) {} Shape(AABB aabb, Eigen::Vector3f color) : m_BoundingBox(std::move(aabb)), color(std::move(color)) {} virtual ~S...
true
a71e54a46e7040c93d5deb66359cccc2b10ac5d1
C++
lankokelly/qt---shooting-game
/bullet.cpp
UTF-8
1,702
2.578125
3
[]
no_license
#include "bullet.h" #include "mainwindow.h" #include <QGraphicsPixmapItem> #include <QDebug> #include <typeinfo> #include <QList> #include <QFont> int count=0; void increment() { count=count+14; } void increment2() { count=count+88; } int enemyhp=100; void minus2() { enemyhp=enemyhp-2; } void minus8(){ ...
true
12d6f0d7b4f922daff2b1f965866392a4d418f2e
C++
fanfeng2015/Object-Oriented-Programming
/Demo/LinearDataStructures/cell.hpp
UTF-8
1,100
3.234375
3
[]
no_license
// ------------------------------------------------------------------------ // A cell contains an Item* and a link. Cells are used to build lists. // A. Fischer June 13, 2000 file: cell.hpp // ------------------------------------------------------------------------ #pragma once #includ...
true
fc90324565e3d45359c5e0320b4ce7bf408694b3
C++
davidkazlauskas/templatious
/virtual/VirtualCollection.hpp
UTF-8
15,718
2.53125
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
//================================================== // Copyright (c) 2015 Deividas Kazlauskas // // See the file license.txt for copying permission. //================================================== /* * ===================================================================================== * * Filename: V...
true
76177ae45d851216c2c0f82a82e1ac42092bea1c
C++
fmarz96/algo1
/labo06/ejercicios.cpp
UTF-8
2,590
3.609375
4
[]
no_license
#include <iostream> #include <vector> using namespace std; /********* Ejercicio 1 *********/ vector<vector<int>> mostrarMatriz(vector<vector<int>> m){ for(int i = 0; i < m.size(); i++){ for(int j = 0; j < m[i].size(); j++){ std::cout << m[i][j] << "\t"; } std::cout << "\n"; ...
true
c54d5d12ccb2604cae1c903020043f4f76ba2c54
C++
shrutisonone/usual-coding
/stack/Trapping Rain Water .cpp
UTF-8
1,341
2.90625
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int arr[n]; for(int i=0;i<n;i++) { cin>>arr[i]; } int maxl[n]; maxl[0]=arr[0]; for(int i=1;i<n;i++) { maxl[i]=max(maxl[i-1], arr[i]); } int maxr[n]; maxr[n-1]=arr[n-1]; ...
true
299db3fe75ce26752667e91357495ef19d1e3fa6
C++
nwkotto/bounded_queue
/boundedQueue.h
UTF-8
970
3.34375
3
[]
no_license
#ifndef BOUNDEDQUEUE_H #define BOUNDEDQUEUE_H /* Note: If you wanted to make this queue thread-safe, you would (for example) need to implement an atomic test_and_set function and a clear function, to manipulate some guard variable and make all public functions accessing the queue (in this case, enqueue and dequeue)...
true
0eb45255e5cc5a9737a6588580d00e13c29312b1
C++
FeibHwang/OJ-Leetcode
/Code/311_Sparse_Matrix_Multiplication.cpp
UTF-8
1,543
3.515625
4
[]
no_license
/* Given two sparse matrices A and B, return the result of AB. You may assume that A's column number is equal to B's row number. Example: A = [ [ 1, 0, 0], [-1, 0, 3] ] B = [ [ 7, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 1 ] ] | 1 0 0 | | 7 0 0 | | 7 0 0 | AB = | -1 0 3 | x | 0 0 0 | = | -7 0 3 | ...
true
d18193891a4f1c4c5f6ab5b4b581e5ca1fc3ce3b
C++
vincent-weber/Generateur-Carreaux-De-Bezier
/mainwindow.cpp
UTF-8
5,325
2.84375
3
[]
no_license
/* R. Raffin * M1 Informatique, Aix-Marseille Université * Fenêtre principale * Au cas où, l'UI contient une barre de menu, une barre de status, une barre d'outils (cf QMainWindow). * Une zone est laissée libre à droite du Widget OpenGL pour mettre de futurs contrôles ou informations. */ #include "mainwindow.h" #...
true
5dce2260cc4f86039df3d755ef2f22f4c907255b
C++
weimingtom/eepp
/include/eepp/graphics/cscrollparallax.hpp
UTF-8
3,447
2.765625
3
[ "MIT" ]
permissive
#ifndef EE_GRAPHICSCSCROLLPARALLAX_H #define EE_GRAPHICSCSCROLLPARALLAX_H #include <eepp/graphics/base.hpp> #include <eepp/graphics/ctexture.hpp> #include <eepp/graphics/csubtexture.hpp> namespace EE { namespace Graphics { /** @brief The scroll parallax renders a SubTexture to the screen from a position and a size s...
true
811121946d8d859d396e8ced2b4900ed9e5dd04e
C++
victoreuceda/Lab7_Victor
/vector01/main.cpp
UTF-8
665
2.859375
3
[]
no_license
#include "vector.h" #include <iostream> using std::cout; using std::endl; void wapa(Vector, char); int main(int argc, char* argv[]){ cout << "Iniciando el main" << endl; Vector a(3), b(3), c(2); a.set(2.5,0); a.set(-4,1); a.set(0,2); b.set(5,0); b.set(2,1); b.set(-1.1,2); cout << a.toString() << endl << b....
true
d8aff6befedb4f166efc218cdccfdf081f2bb8ef
C++
nikisonowal4899/codes
/structures/demo1.cpp
UTF-8
315
3.65625
4
[]
no_license
#include <iostream> using namespace std; //Defining a structure struct student { int rollNo; char sex; }; int main() { struct student Niki; //Declaring a variable Niki.rollNo = 170108026; Niki.sex = 'M'; cout << "Roll Number: " << Niki.rollNo << endl; cout << "Sex: " << Niki.sex << endl; return 0; }
true
c4965788e7d1e0eb408f3792e15d882aa9bdb86e
C++
rahilmalhotra001/Competitve-programming
/C++ data structures.cpp
UTF-8
10,883
3.046875
3
[]
no_license
Struct in c++ - struct B { int x,y; B() {} B (int x, int y) : x(x), y(y){} bool operator<(const B &num) const { if(x==num.x) return y<num.y; return x<num.x; } }; set- (distinct elements, sorted) set <int> s; s.insert(k); s.erase(k); auto it=s.lower_bound(k); (lowerb...
true
beec08bf692a2aa23a66a11ac9989ba8717e440f
C++
xiaohuanlin/nand2tetris
/projects/07/vmtranslator/test/code_writer/code_writer_test.cpp
UTF-8
1,722
2.5625
3
[ "MIT" ]
permissive
#include <string> #include "gtest/gtest.h" #include "code_writer.hpp" namespace vmtranslator { TEST(CodeWriterTest, OstreamToFile) { std::stringbuf sb(""); std::ostream output(&sb); CodeWriter code_writer(&output); code_writer.WritePushpop(COMMAND::C_PUSH, "constant", 1); ...
true
a19451320c5e9fe97edb5a8f379597455adf33b1
C++
Aaditya-Singh78/Competitive-Programming-June-Course-
/Keshav Mishra/Array and Strings/Max No of vowels in a substring of given length.cpp
UTF-8
427
2.625
3
[]
no_license
class Solution { public: int maxVowels(string s, int k) { int i=0,j=0,mx=0,cnt=0; while(j < s.length()) { if(s[j]=='a' || s[j] == 'e' || s[j] == 'i' || s[j] == 'o' || s[j] == 'u') cnt++; if(j-i+1<k) j++; else if(j-i+1 == k) { mx = max(mx,cnt); if(s[i]=='a' || s[i] == 'e' || s[i]...
true
ca82b868472dd910055791beb9402ac87fa0ad2f
C++
lhalam/firstProject1415
/firstProject1415/main.cpp
UTF-8
1,031
2.90625
3
[]
no_license
#define DLL_IMPORT #include <iostream> #include "UI/UI.h" using std::cout; using std::cerr; using std::cin; using std::endl; int main() { cout << "Welcome to our shop!" << endl; cout << "Type 'help' for list of available commands" << endl; cout << "_________________________________________________________________...
true
beead408abbc03a21d36f05fd303c2b59beff4c2
C++
idumenskyi/learn_cpp
/variables.cpp
UTF-8
521
3.171875
3
[]
no_license
#include <iostream> using namespace std; int main() { //int a; //a = 5; //int name var; wrong declaration variable, using whitespase in name of variable //int a = 7; //cout << a << endl; //a = 108; //cout << a << endl; int Age, a, b; // int Age = 26, a = 2, b = 5; double e = 2.72; ...
true
145f0e70747b6a910668f88290fcc8428b3a638b
C++
edodo1337/BoxPacking3
/abstract_box.cpp
UTF-8
3,349
2.71875
3
[]
no_license
#include <iostream> #include <array> #include <vector> #include "abstract_box.h" #include "utils.h" #include <iterator> #include <algorithm> // #include <boost/lambda/lambda.hpp> // #include <boost/numeric/ublas/vector.hpp> // #include <boost/numeric/ublas/matrix.hpp> // #include <boost/numeric/ublas/io.hpp> // #includ...
true
31718ca40cb3503878f6eb4e1056fe694f850b2a
C++
WalkervilleElementary/robot
/src/hardware/encoder.cpp
UTF-8
1,684
2.703125
3
[]
no_license
#include "hardware/encoder.h" #include "utils/encoderinterrupts.h" #include "math.h" namespace hardware { float Encoder::distance_to_ticks = GEAR_RATIO() * ENCODER_TICKS_PER_REVOLUTION() / (WHEEL_DIAMETER() * M_PI); float Encoder::degrees_to_ticks = AXLE_LENGTH() * M_PI / 180.0; int32_t Encoder::cmToTicks(float cm) ...
true
d9eba7ddb5f5630245ca237403c95913a03bfe3c
C++
BarryChenZ/LeetCode2
/P232_Implement_Queue_usingStacks.cpp
UTF-8
702
3.75
4
[]
no_license
class MyQueue { public: /** Initialize your data structure here. */ vector<int> stack; MyQueue() { stack.clear(); } /** Push element x to the back of queue. */ void push(int x) { stack.push_back(x); } /** Removes the element from in front of queue and returns th...
true
072e020ec98ede67cceee453537afb3281b1bcbf
C++
giuinktse7/vulkan-learning
/vulkan-tutorial/map_io.cpp
UTF-8
8,449
2.6875
3
[]
no_license
#include "map_io.h" #include <iostream> #include "debug.h" #include "version.h" #include "definitions.h" #include "tile.h" #include <string> enum NodeType { NODE_START = 0xFE, NODE_END = 0xFF, ESCAPE_CHAR = 0xFD, }; constexpr uint32_t DEFAULT_BUFFER_SIZE = 0xFFFF; SaveBuffer::SaveBuffer(std::ofstream &strea...
true