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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
bf8377b144a8200f4d142d02d61f87e8cd9e0bd5 | C++ | priyananda/projects | /pixelx/src/PxPhysics/src/PxVector4d.cpp | UTF-8 | 2,016 | 3 | 3 | [] | no_license | //////////////////////////////////////////////////////////////////////////////////////////
// PxVector4d.cpp
// Function definitions for 4d vector class
// You may use this code however you wish, but if you do, please credit me and
// provide a link to my website in a readme file or similar
// Downloaded from: www.paul... | true |
b9e5e2790d1baf0ade4358c60895d9af280f352e | C++ | Akrakas/Custom_Neural_Network | /Sources/Database_class.cpp | UTF-8 | 627 | 2.859375 | 3 | [] | no_license | #include "Database_class.h"
Database_class::Database_class()
{
Sequences = NULL;
}
Database_class::~Database_class()
{
if(Sequences!=NULL){
for(int i=0 ; i<number_of_categories ; i++)
{
for(int j=0 ; j<number_of_sequences ; j++)
{
Sequences[i][j].~Sequence();
}
free(Sequences[i]);
}
free(Seq... | true |
0332a4c7df17f21b88390f4c2ff094a26e411d46 | C++ | tsintermax/algorithms_and_data_structures | /cpp/mergsort.cpp | UTF-8 | 1,390 | 3.578125 | 4 | [] | no_license | #include<stdio.h>
#include <cstdlib>
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
void merge(int array[],int start, int partition, int end){
int i = start;
int j = partition + 1;
int index_sorted = start;
int tmp_arr[end - start];
while (i <= partition && j <= end )
{
... | true |
d4a36701f3bcf6b9ed07cbe34e9ca5931e34e77f | C++ | tangodown1934/Algorithm-judge | /20150710/locker.cpp | UHC | 800 | 2.796875 | 3 | [] | no_license | /*
VC, GCC
*/
#include <stdio.h>
int main()
{
int itr;
int nCount; /* Ʈ ̽ */
int n, k;
int i, j, mul, temp;
int locker[100];
scanf("%d", &nCount); /* Ʈ ̽ Է */
for (itr = 0; itr<nCount; itr++)
{
printf("#testcase%d\n", itr + 1);
scanf("%d %d", &n, &k);
for (i = 0; i < 100; i++){
locker[... | true |
7ef853f6ef0d108be03819475537964db15f0ccb | C++ | jeremtop/CatchMe | /Catch_me.cpp | UTF-8 | 13,820 | 3.296875 | 3 | [] | no_license | /**
* \file Catch_me.cpp
* \author Mathis Garcia, Arnaud Sanchez, Jérémy Topalian, Loïc Vigne.
* \version 2.0
* \date 17 Decembre 2013
* \brief Jeu "Catch me if you can".
*
*/
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <utility>
#include <cstdlib>
#inc... | true |
81c19fa612105ca4c452e1164e9dbde83c8f0d48 | C++ | karnkittik/AlgorithmDesign | /inversion.cpp | UTF-8 | 297 | 2.796875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int n;cin>>n;
int a[n];
for(int i=0;i<n;i++){
int x;cin>>x;
a[i]=x;
}
int inv = 0;
for(int i =0;i<n;i++){
for(int j=i+1;j<n;j++){
if(a[j]<a[i]) inv+=1;
}
}
cout<<inv;
} | true |
50ed915f17d02dccc2d605009bdceed3aeedc3db | C++ | DmytroHaponov/searchTextInWeb | /scannerinline.h | UTF-8 | 866 | 2.5625 | 3 | [] | no_license | #pragma once
#include <QObject>
#include <QRegularExpression>
namespace search {
class ScannerInLine
{
public:
explicit ScannerInLine(const QString& target_text);
/**
* @brief searches target text in a single line
* @param line in which search is implemented
* @return list of positions of fou... | true |
1369348fd73e852c8b16774e256155b62ceda3fc | C++ | again1943/zoj-solution | /src/1496.cpp | UTF-8 | 1,204 | 2.96875 | 3 | [] | no_license | #include<cstdio>
#include<utility>
#include<cstdlib>
#include<algorithm>
#include<numeric>
using namespace std;
#define PI 3.14159
int f[3];
int r[9];
double diameter,target;
#define eps 1e-10
inline double myabs( double t )
{
if( t > eps )
return t;
else if( t < -eps )
return -t;
else
retu... | true |
72f6484198d65962f66c1c072e2ac39a17bb9db2 | C++ | comerje/PillarVendingAlt | /VendingAlternate/Display.cpp | UTF-8 | 604 | 2.578125 | 3 | [] | no_license |
#include "Display.h"
#include <iostream>
#include "MessageData.h"
void WriteToStdOut(std::string& msg)
{
std::cout << msg << std::endl;
}
Display::Display(AbstractConductor& machine)
:Component(machine),
DisplayCallback(&WriteToStdOut)
{
}
Display::~Display()
{
}
void Display::Notify(eNotifyM... | true |
2be87346797275de0656f4a6e56e2a1dd7cfcc93 | C++ | monsterbasher/Multicraft | /Aurora/Aurora/System/touch/TouchSystemManager.h | UTF-8 | 1,411 | 2.546875 | 3 | [] | no_license | #ifndef TOUCHSYSTEMMANAGER_H
#define TOUCHSYSTEMMANAGER_H
#include <Aurora/System/SystemManager.h>
#include <Aurora/Math/Vector2.h>
#include <vector>
using namespace Key;
namespace Aurora
{
namespace System
{
class Touch
{
public:
int hash;
float positio... | true |
3cda83214ed4f6a3e11d94610a3f67342b1eed1e | C++ | xiangbai/Homework | /08_IO/08_09/file_in.cpp | UTF-8 | 1,825 | 3.171875 | 3 | [] | no_license | /*************************************************************************
> File Name: file_in.cpp
> Author: wang
> Mail:xiangbai@qq.com
> Created Time: Sat 12 Apr 2014 07:05:27 PM CST
************************************************************************/
#include<iostream>
#include<string>
#include<vect... | true |
4130c68343bdfdcb0fed2c5e7a810f554e371f16 | C++ | shaaker-ma/Advanced-Programming | /CA 4/Task.cpp | UTF-8 | 648 | 2.84375 | 3 | [] | no_license | #include <string>
#include <vector>
#include "Task.hpp"
using namespace std;
Task::Task(string nameNew, unsigned int estimatedTimeNew, unsigned int priorityNew, string descriptionNew){
name = nameNew;
estimatedTime = estimatedTimeNew;
priority = priorityNew;
description = descriptionNew;
isDone= false;
isAssi... | true |
e7113ae9df01e15bb615aa675054d61f7c7d4b0a | C++ | nschaech/nickschaecher_comp2 | /NODE.h | UTF-8 | 4,595 | 3.953125 | 4 | [] | no_license | #ifndef NODE
#define NODE
#include <iostream>
using namespace std;
//binary node template class to create binaryNodes
template<class T>
class binaryNode {
public:
T data;
binaryNode<T >*left;
binaryNode<T> *right;
binaryNode(T d)
:data(d),left(nullptr),right(nullptr){}
};
//binarySearhtree cl... | true |
cdc4ace92b661ed9813a79bfedc5e6e79fea3850 | C++ | AbrahamFB/Programaci-n-en-C-B-sico---Intermedio---Avanzado- | /Funciones/Ejercicio22.cpp | UTF-8 | 410 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include <conio.h>
using namespace std;
int escribeNum(int ini, int fin){
if(ini == fin){
return ini;
}
else{
return escribeNum(ini, fin-1);
}
}
int main(){
int ini, fin;
cout << "Ingresa un Inicio:" << endl;
cin >> ini;
cout << "Ingresa un Final:" << endl;
cin >> fin;
for(int ... | true |
ec9740bc418eb951f68a26b4372dad63ebdf860d | C++ | SpeedZhang/1071-C-Progrmming | /w012/3%knightTour.cpp | UTF-8 | 3,378 | 3.265625 | 3 | [] | no_license | #include<stdio.h>
struct Pos
{
int row;
int col;
};
Pos KnightTour(int access[][8],int row,int col)
{
Pos pos;
int min=9;
int minrow=-1,mincol=-1,nextrow,nextcol;
int h[8]= {2,1,-1,-2,-2,-1,1,2};
int v[8]= {-1,-2,-2,-1,1,2,2,1};
access[row][col]=0;
for(int i=0; i<8; i++)
{
nextrow=... | true |
1c485221f94e9b617861eea7d1d9d80ee508d43d | C++ | ElexandroTorres/hashTable | /include/hashtbl.h | UTF-8 | 11,482 | 3.5 | 4 | [] | no_license | /*
* Autoria: Elexandro Torres Tavares
* T.I, 2019.
*/
#ifndef HASHTBL_H
#define HASHTBL_H
#include <forward_list>
#include <cmath>
// Namespace
namespace ac {
/// Classe HashEntry. Representa um item de tabela.
template<class KeyType, class DataType>
class HashEntry {
public:
KeyType m_key; //<! Amazena um... | true |
3b55ea78ae4c19c26d2422a395644bc26a6bafe5 | C++ | andyyhchen/coursera-cpp | /ch5-lec.cpp | UTF-8 | 600 | 3.390625 | 3 | [] | no_license | #include <iostream>
using namespace std;
class Bug{
private:
int nLegs; int nColor;
public:
int nType;
Bug(int legs, int color)
{
nLegs = legs;
nColor = color;
}
void PrintBug(){
cout << "Bug with nLegs " << nLegs <<" and color " << nColor << endl;
}
};
class FlyBug: public Bug{
int nWings;
public:... | true |
9a9e54386f40b5f219ed396ebad5fb802252e11a | C++ | nags5454/1SI16CS068_SIT_CSE_OOPLAB | /to find area FuncOverload.cpp | UTF-8 | 973 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include <cmath>
using namespace std;
void fnVol(int);
void fnVol(double);
void fnVol(double, int);
void fnVol(int, int, int);
int main()
{
int iSide, iL, iB, iH;
double dRad;
cout << "\nEnter side length of cube" << endl;
cin >> iSide;
fnVol(iSide);
cout << "\nEnter radius of sphere" << endl;... | true |
155bdccf80d82831c8ee2769ed23987adf982b4e | C++ | tetraa-coder/tetra | /produits.cpp | UTF-8 | 2,522 | 2.671875 | 3 | [] | no_license | #include "produits.h"
produits::produits(){
nbr=0;
id=0;
nom_type="";
nom_produit="";
}
produits::produits(int n,int i,std::string t,std::string p){
nbr=n;
id=i;
nom_type=t;
nom_produit=p;
}
int produits::get_nbr(){return nbr;}
int produits::get_id(){return id;}... | true |
853933147d0a143b60742652d1500f55036a54e5 | C++ | kedumuc1712/INT2002 | /Tuan 2/BT ThayKhoi/BT02.cpp | UTF-8 | 167 | 2.8125 | 3 | [] | no_license | # include <iostream>
# include <cmath>
using namespace std;
int main(){
float x;
int y;
cin >> x >> y;
float hat = pow(x,y);
cout << hat <<endl;
return 0;
}
| true |
50780ae5def7f0a2ad8c26b9bddc6afb34a5c1f6 | C++ | cpatrasciuc/nine-men-morris | /src/console_game/ai_player.cc | UTF-8 | 1,211 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright (c) 2013 Cristian Patrasciuc. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "console_game/ai_player.h"
#include <memory>
#include <sstream>
#include <string>
#include "ai/ai_algorithm.h"
#include "game/game.h"
#inclu... | true |
52cde0e3d2d8e37dfbaa9c0a5a3679ca815989af | C++ | ouchiminh/ouchitest | /include/ccol.hpp | UTF-8 | 1,791 | 2.890625 | 3 | [] | no_license | #pragma once
#ifdef __linux__
#include <cstdio>
namespace ouchi::test {
class ccol {
public:
enum color_code : unsigned short {
foreground_blue = 34,
foreground_green = 32,
foreground_red = 31,
background_blue = 44,
background_green = 42,
background_red = 41,
}... | true |
eb8de2e1bf4a876df087174eafe312fd63f2a758 | C++ | whitead/WordModel | /lib/simple_model.cpp | UTF-8 | 2,874 | 2.71875 | 3 | [] | no_license | #include "simple_model.hpp"
wordmodel::SimpleModel::SimpleModel(){
std::string delims(TOKENIZER_DELIMS);
for(unsigned int i = 0; i < delims.size(); i++) {
delimiters_.push_back(delims.substr(i,1));
}
}
wordmodel::SimpleModel::SimpleModel(const char* delimiters[], int dlength){
for(int i = 0; i < dlength; ... | true |
ac050fa28cef611862e087ee2b15611b29a438b5 | C++ | LuannMateus/c-exercises | /repetition-structure/01 - Exercícios - Desafio/exer02.cpp | UTF-8 | 1,996 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include <string.h>
using namespace std;
int main(){
setlocale(LC_ALL, "Portuguese");
string resp;
double rendaP, rendaF,totA = 0, totO = 0, acumula1 = 0, acumula2 = 0, acumula3 = 0, porcem1, porcem2, porcem3;
int totD = 0, totR = 0, tot = 0;
cout << "===================... | true |
c8241bb3c22b3c218dd7a02d9f7a25ef62d17410 | C++ | alisson2000rj/SE | /02 - Exercicios SE/exercicio-03-Blink-alisson-1touch-always/exercicio-03-Blink-alisson-1touch-always.ino | UTF-8 | 2,594 | 3.25 | 3 | [] | no_license | /*
* Versao by alisson
* modificado 12 set 2018
* utilizada com referencia o exemplo blink existente na IDE do arduino
* http://www.arduino.cc/en/Tutorial/Blink
* Blink - 1touch-always
Utiliza o pino 13 como saida para fornecer sinal positivo ao LED.
O estado do pino 13 muda conforme e alterado o estado do pin... | true |
5c466360370d13f5b3777eb98ba3827cd4961717 | C++ | tusharchopratech/mouse_project | /wearablecode/windows/src/modules/stm32/SerialPort.cpp | UTF-8 | 3,615 | 2.828125 | 3 | [] | no_license | /*
* Author: Manash Kumar Mandal
* Modified Library introduced in Arduino Playground which does not work
* This works perfectly
* LICENSE: MIT
*/
#include "SerialPort.h"
SerialPort::SerialPort()
{
// char *portName;
comPort += getSerialCOMport();
cout << comPort.c_str() << endl;
this->connected = fals... | true |
1800d70eff7912dc887174fcebc84cac33caf85d | C++ | amrzakii2000/Snake-and-Ladder-Roll-Dice-Game | /CardTen.h | UTF-8 | 750 | 2.71875 | 3 | [] | no_license | #pragma once
#include "Card.h"
#include"Player.h"
class CardTen : public Card
{
static int price;
static int fees;
static bool flag_P_F;
static Player* owner;
static bool flag_owner;
static Player* Passer;
public:
class CardTen(const CellPosition& pos); // A Constructor takes card position
virtual void ReadC... | true |
9849ef20cb9464e3ceba1541ecaa5c77f99176c2 | C++ | tallbl0nde/Aether | /source/utils/Utils.cpp | UTF-8 | 3,032 | 3.03125 | 3 | [
"MIT"
] | permissive | #include <filesystem>
#include "Aether/utils/Utils.hpp"
namespace Aether::Utils {
std::string buttonToCharacter(const Button b) {
switch (b) {
case Button::A:
return "\uE0E0";
break;
case Button::B:
return "\uE0E1";
br... | true |
80f8bdd848093ff94a6faeedf0c848ff936c8524 | C++ | m0rjjj/plant-watering-device | /src/main.cpp | UTF-8 | 6,813 | 2.546875 | 3 | [] | no_license | #include <Arduino.h>
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
const uint8_t PUMP_PIN = D0;
const uint8_t SOLENOID_1_PIN = D1;
const uint8_t SOLENOID_2_PIN = D2;
const uint8_t plants[] = {SOLENOID_1_PIN, SOLENOID_2_PIN};
// Connect to the WiFi
const char *ssid = "****";
const char *password = "****";
// to... | true |
22d99e71443f4f446dc01cb9d6939c0786928ea4 | C++ | jhy156456/python-algorithm | /이전/백준/(백준)DFS-단지짓기.cpp | WINDOWS-1252 | 1,166 | 2.703125 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
using namespace std;
int n;
int answerCount = 1;
vector<vector<int>>problems;
vector<vector<int>>visited;
vector<int> answers;
int dy[4] = {-1,1,0,0};//,,,
int dx[4] = {0,0,-1,1};
void dfs(int y, int x) {
visited[y][x] = true;
f... | true |
76345f1349ccfe451f9cfcf6f899392e3b483716 | C++ | slagusev/CrossPlatformEngine | /Engine/CQuaternion.cpp | WINDOWS-1252 | 6,773 | 2.78125 | 3 | [] | no_license | ///////////////////////////////////////////////////////////////////////////////
// Icarus Game Engine
// Copyright 2011 Timothy Leonard
///////////////////////////////////////////////////////////////////////////////
#include "CQuaternion.h"
#include "CVector3.h"
#include "CVector4.h"
#include "CMatrix3.h"
#include "... | true |
51dad55802bf90f5485257db348a095c96f2b45c | C++ | igonzalezb/EDA-TP8 | /COMPRESOR+DESCOMPRESOR/Tile.h | UTF-8 | 333 | 2.78125 | 3 | [] | no_license | #pragma once
#include <string>
using namespace std;
class Tile
{
public:
Tile() { ; }
Tile(string path);
~Tile();
void select();
void deselect();
void toggleSelection();
bool isSelected();
string getFilePath();
int getLength();
void setLength(int length);
private:
string filePath;
bool selected;
int ... | true |
d881d3b13c2f904fa40460fa2a231bdf49a2ca23 | C++ | andrzej0szczepanczyk0muzyk/rekrutacja-techocean | /MergeSortTest/MergeSortTest/Source.cpp | WINDOWS-1250 | 2,308 | 3.1875 | 3 | [] | no_license | #define RAPORT "raport.txt"
#include <stdlib.h> /* malloc, free, rand */
#include <iostream>
#include <string>
#include <stdio.h>
#include <cstring>
#include <vector>
#include <cstdio>
#include <ctime>
#include <fstream>
using namespace std;
typedef vector<int> V;
//sortuje rosnco tablic pod ref... | true |
529dc8acf86419dd60d857e5001a84ffbe03e493 | C++ | kcaHder/Secrets | /histograph.cpp | UTF-8 | 575 | 2.984375 | 3 | [] | no_license | //
// histograph.cpp
//
//
// Created by Michele Iannello on 13/11/17.
//
//
#include "histogram.cpp"
#include "graph.cpp"
using namespace std;
void histograph()
{
bool again = 1;
while(again)
{
//Histogram or Graph?
bool choice;
cout << "Vuoi fare un istogramma (0) o un grafico (1)?" << endl;
... | true |
7571ae82748952d7343fb5c30edaabda7d2a21a0 | C++ | yonasadiel/cp | /FacebookHackerCup/2018_1_A_EthanTraversesATree.cpp | UTF-8 | 1,379 | 2.671875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int n, k;
int a[2005];
int b[2005];
vector<int> pre;
vector<int> post;
vector<int> adj[2005];
int label[2005];
void traverse(int node) {
pre.push_back(node);
if (a[node]) { traverse(a[node]); }
if (b[node]) { traverse(b[node]); }
post.push_back(node);
}
... | true |
939e97a1d1a4770fd7f3a2fcf53daa87bf8b261b | C++ | zh880517/GMServer | /CoreLib/LibActor/Message/ValueMessage.h | UTF-8 | 850 | 2.875 | 3 | [] | no_license | #pragma once
#include <LibActor/Message/IMessage.h>
namespace ActorLite
{
template <class ValueType>
class ValueMessage : public IMessage
{
public:
explicit ValueMessage(const Detail::Address& from, bool bUdp):IMessage(from, false, bUdp){ }
explicit ValueMessage(const Detail::Address& from, ValueTyp... | true |
ca7d385e39720c2f49926b278324e4c195c62c64 | C++ | Radziu1202/AISD | /problem plecakowy/Rucksack.cpp | UTF-8 | 9,645 | 2.90625 | 3 | [] | no_license | #include "stdlib.h"
#include "time.h"
#include <Windows.h>
#include "math.h"
#include "random"
#include "stdio.h"
#include "iostream"
#include "algorithm"
#include <fstream>
using namespace std;
double PCFreq = 0.0;
__int64 CounterStart = 0;
void StartCounter()
{
LARGE_INTEGER li;
if (!QueryP... | true |
f2302d6bac52511e4a20e045f14c4a0411c6812e | C++ | corenel/ip-camera-ehome-server | /include/ices/util.h | UTF-8 | 1,381 | 3.140625 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
template <typename Ret, typename... Param0>
class Callback {
public:
virtual Ret invoke(Param0... param0) = 0;
};
template <typename Ret, typename... Param0>
class StaticFunctionCallback : public Callback<Ret, Param0...> {
private:
Ret (*func_)(Param0...);
public:
StaticFunctionCallback(Ret (*f... | true |
380335ddb7de5936426adb3019e211f344c1294c | C++ | sydchen/leetcode | /best-time-to-buy-and-sell-stock.cpp | UTF-8 | 535 | 3.296875 | 3 | [] | no_license | #include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
int maxProfit(vector<int> &prices) {
int minPrice = INT_MAX, bestProfit = 0, profit;
for(auto &price:prices) {
if(price < minPrice)
minPrice = price;
profit = price - minPric... | true |
72770058554d9fb5610d5a5fbf927a97af4bb957 | C++ | mgmourgos/juke-engine | /Files/Player.cpp | UTF-8 | 1,358 | 2.5625 | 3 | [] | no_license | #include "Player.h"
#include "PlayerConstants.h"
const int PLAYER_WIDTH = 25;
const int PLAYER_HEIGHT = 32;
Player::Player(Graphics& graphics, int x_, int y_) : Actor(x_, y_, PLAYER_WIDTH, PLAYER_HEIGHT, MOVEABLE)
{
sprite.reset(new Sprite(graphics, "Files/ghostSheet.bmp", 0, 0, width, height));
move_context_state... | true |
0870470bd5da1c3bf135291d9f1cfcd4d38bbbb7 | C++ | mojtabafazeli/competitive-programming | /07. Heap/4 [hackerearth] Roy and Trending Topics.cpp | UTF-8 | 2,017 | 3.265625 | 3 | [] | no_license | // Problem: Roy and Trending Topics
// Link: https://www.hackerearth.com/practice/data-structures/trees/heapspriority-queues/practice-problems/algorithm/roy-and-trending-topics-1/description/
// Solution: Mai Thanh Hiep
#include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
struct R... | true |
b221b32330bbc89281ce8285d096414525356ca4 | C++ | ZhouAaron/PAT | /PAT A1076 Forwards on Weibo/PAT A1076 Forwards on Weibo/main.cpp | UTF-8 | 1,612 | 2.796875 | 3 | [] | no_license | //
// main.cpp
// PAT A1076 Forwards on Weibo
//
// Created by Aaron on 5/19/19.
// Copyright © 2019 周杰. All rights reserved.
//
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
const int MAXV = 1010;
struct Node{
int id;//节点编号
int layer;//层数
};
vector<Node> Adj[MAXV];//邻接表
bool... | true |
79b9f88d2f6159d6f54a20fcaf814e32964db441 | C++ | SEOYEONGO/CPP | /함수 중복 작성 & 디폴트 매개변수/함수 중복 작성 + 디폴트 매개 변수/실습2-2 Person class 디폴트.cpp | UTF-8 | 429 | 3.75 | 4 | [] | no_license | #include <iostream>
using namespace std;
class Person{
int id;
double weight;
string name;
public:
Person(int id=1, string name="Grace", double weight=20.5){
this->id=id;
this->name=name;
this->weight=weight;
}
void show() { cout<<id<<' '<<weight<<' '<<name<<endl;}
};
int main (){
Pers... | true |
efdadf66e8a8915ab5fccb8cbfbe5b5ae9f2b548 | C++ | karthich/programming-contest | /spoj/cpp/Completed/Prime.cpp | UTF-8 | 1,847 | 3.0625 | 3 | [] | no_license | // Prime1.cpp : Defines the entry point for the console application.
//
#include<math.h>
#include<stdio.h>
#include<stdlib.h>
#define SIEVE_LIMIT 31627
#define TEST_CASES 10
#define PRIME_LIMIT 100001
#define LENGTH 100000
#define NUM_PRIMES 3402
using namespace std;
int primes[NUM_PRIMES];
void prime1(long a, lo... | true |
4138dda22bf86702b5ddb15bfa613970b3a36c62 | C++ | Schnee-B/SCAU_OJ | /Advanced Progreamming/Advanced Progreamming/17243 Huzi酱和他的俄罗斯套娃.cpp | UTF-8 | 595 | 2.71875 | 3 | [] | no_license | #include<cstdio>
#include<cstdlib>
#include<cstring>
int cmp(const void *a, const void *b)
{
return *(int *)a - *(int *)b;
}
int main()
{
int count, n, a[502], i, j;
while (scanf("%d", &n) != EOF)
{
for (i = 0; i < n; i++)
scanf("%d", &a[i]);
qsort(a, n, sizeof(a[0]), cmp);
count = 0;
for (i = 0; i < n -... | true |
ac3cab0725074c95fce057d06b6e3986d5de086b | C++ | unisb-bioinf/TransitivityClusteringILP | /Distance.h | UTF-8 | 19,319 | 2.5625 | 3 | [] | no_license | /**
* Copyright (C) 2020 Tim Kehl <tkehl@bioinf.uni-sb.de>
* Kerstin Lenhof <klenhof@bioinf.uni-sb.de>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the Lesser GNU General Public License as
* published by the Free Software Foundation, either v... | true |
8be0d1e31419136abddc099e61310a1a7faacbbd | C++ | numpad/snong | /Obstacles.cpp | UTF-8 | 974 | 2.875 | 3 | [] | no_license | #include "Obstacles.hpp"
Obstacles::Obstacles() {
Obstacles::array = std::vector<Obstacle>();
}
void Obstacles::add(Obstacle o) {
Obstacles::array.push_back(o);
}
void Obstacles::each(std::function<void (Obstacle &)> func) {
for (auto &o : Obstacles::array) {
func(o);
}
}
void Obstacles::update() {
}
void ... | true |
8ec9bc2f7c44a6012046c249fd877705d6b8c548 | C++ | Starname28/YellowBelt | /Console/Console.cpp | UTF-8 | 2,646 | 3.109375 | 3 | [] | no_license | // Console.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <map>
#include <sstream>
#include <typeinfo>
#include <tuple>
template<typename Collection>
std::string join(const Collection& col, ch... | true |
a8a3b181090736a0fcb850693caeaefbd5c321f9 | C++ | bruceding/leetcode | /algorithms/cpp/longest-common-prefix/main.cpp | UTF-8 | 1,339 | 3.453125 | 3 | [] | no_license | #include<string>
#include<iostream>
#include<vector>
using std::string;
using std::vector;
class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
string ret = "";
if (strs.size() == 0) {
return ret;
}
auto first_str = strs[0];
for (int i = 0;... | true |
f10fbaecfc2eeddf62d7ce65ec8de4bc3c26f51f | C++ | tmdghks9574/Algorithm | /C++/2864.cpp | UTF-8 | 733 | 2.765625 | 3 | [] | no_license | #include<iostream>
#include<cstdlib>
#include<cstring>
char aa[10];
char bb[10];
using namespace std;
int main()
{
string a;
string b;
cin >> a >> b;
for(int i = 0; i < a.length(); i++)
aa[i] = a[i];
for(int i = 0; i < b.length(); i++)
bb[i] = b[i];
for(int i = 0; i < strlen(aa)... | true |
3efb2857ec899f9f2c009f92d6bf310b356dae4f | C++ | maobenz/qtnewForum | /forum/post.h | UTF-8 | 619 | 2.671875 | 3 | [] | no_license | #ifndef POST_H
#define POST_H
#include "header.h"
#include "string.h"
class Post
{
public:
Post(string a,string b,string c,string d,int e);
string getContents();
string getTitle(); //返回标题
string getTime(); //返回时间
void changeComments(int i); //增加评论
string getuserName(); //获取用户名
int getI... | true |
14375b5c47c24b44dff2667b5ee62356a95bb11a | C++ | MikolajKarpeta/JiPP | /Lab6/include/employee.h | UTF-8 | 577 | 3 | 3 | [] | no_license | #include <iostream>
#ifndef LAB6_EMPLOYEE_H
#define LAB6_EMPLOYEE_H
class Employee {
private:
std::string ID;
std::string Name;
std::string Surname;
std::string DepartmentID;
std::string Position;
public:
Employee(std::string NewID, std::string NewName, std::string NewSurname, s... | true |
58dd645a2ed0a78fff689aed022401908d722c2e | C++ | TheLightWay/vaca | /vaca/Spinner.h | UTF-8 | 1,873 | 2.6875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Vaca - Visual Application Components Abstraction
// Copyright (c) 2005-2022 David Capello
//
// This file is distributed under the terms of the MIT license,
// please read LICENSE.txt for more information.
#ifndef VACA_SPINNER_H
#define VACA_SPINNER_H
#include "vaca/base.h"
#include "vaca/Widget.h"
#inc... | true |
b486c9efbf5e12e0f8366b08b5e158749b888547 | C++ | Petterf91/ScrapEscape-Game | /graphics/include/light_grid.hpp | UTF-8 | 748 | 2.734375 | 3 | [] | no_license | #ifndef LIGHT_GRID_HPP
#define LIGHT_GRID_HPP
#include <array>
#include <GL/glew.h>
#include "lights.hpp"
#include "camera.hpp"
namespace graphics
{
struct Sphere
{
glm::vec3 center;
float radius;
};
struct Plane
{
glm::vec3 normal;
float distance;
};
struct Frustum
{
Plane left;
Plane right;
Plane top;
Pl... | true |
ee972adb5c39ecf3dbe055ba809f3dc1489760a2 | C++ | WhiteCatFly/Student-Code-RUC | /The third Homework/张若琦-2017201981/DisposeStr.cc | UTF-8 | 2,921 | 2.71875 | 3 | [] | no_license | #include <string>
#include <set>
#include <queue>
#include "DisposeStr.h"
extern std :: set<string> url_set;
extern std :: queue<string> url_que;
bool URLS :: check_in_set() const
{
if (url_set.count(url_))
return true;
return false;
}
bool URLS :: check_out_site(const string & root_url) const
{
if (url_.substr... | true |
35957f6df67907d891d118aaa0b4ffa2ce606ae6 | C++ | kenshindeveloper/lorena | /headers/vardeclarationglobal.hpp | UTF-8 | 622 | 2.53125 | 3 | [] | no_license | #ifndef VAR_DECLARATION_GLOBAL_HPP
#define VAR_DECLARATION_GLOBAL_HPP
#include "statement.hpp"
#include "identifier.hpp"
#include "expression.hpp"
namespace april
{
class VarDeclarationGlobal: public Statement
{
private:
Identifier* ident;
Identifier* type;
Expressi... | true |
d4c3cc0347d8a4cf350c31a0e3d5e6faeb75bc25 | C++ | JohnathanLP/cmcppgroups | /cpptictactoe/window.cpp | UTF-8 | 4,936 | 3.328125 | 3 | [] | no_license | #include <SFML/Graphics.hpp>
#include <iostream>
#include "game.hpp"
//Size of the window
#define HIGH 600
#define WIDE 600
//Defines the positions of each row and collumn
#define POS1 28
#define POS2 228
#define POS3 428
int main()
{
Game myGame;
int mouseX, mouseY, moveX, moveY;
int turn = 0;
//Creates Wi... | true |
478cb1e7dfd04990b76706834d3a1f358f0aaa1b | C++ | JannisN/BMA | /Crystal/src/Vertex.cpp | UTF-8 | 333 | 2.5625 | 3 | [] | no_license | #include "Vertex.h"
namespace Crystal
{
Vertex::Vertex()
{
}
Vertex::Vertex(Vec pos)
{
this->pos = pos;
}
Vertex::Vertex(Vec pos, Vec normal)
{
this->pos = pos;
this->normal = normal;
}
Vertex::Vertex(Vec pos, Vec normal, Vec uvCoord)
{
this->pos = pos;
this->normal = normal;
this->uvCoord = ... | true |
e83b68f50c3643b9312ada3ac3fa17c8b4b488ea | C++ | ndoxx/wcore | /source/tests/catch_bezier.cpp | UTF-8 | 1,477 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | #include <catch2/catch.hpp>
#include <iostream>
#include "catch_math_common.h"
#include "bezier.h"
static const float precision = 1e-4;
TEST_CASE("Bezier curve order 3 interpolation.", "[bez]")
{
Bezier curve(vec3(0.0,0.0,0.0),
vec3(1.0,0.2,0.0),
vec3(1.0,0.4,1.0),
... | true |
4ff640d4b3daac7a9bce508f01c7003c0dfde621 | C++ | metrix/printatronic | /I2C_RGB_master_uno/I2C_RGB_master_uno.ino | UTF-8 | 1,736 | 3.015625 | 3 | [] | no_license | // Wire Master Writer
// by Nicholas Zambetti <http://www.zambetti.com>
// Demonstrates use of the Wire library
// Writes data to an I2C/TWI slave device
// Refer to the "Wire Slave Receiver" example for use with this
// Created 29 March 2006
// This example code is in the public domain.
#include <Wire.h>
#define... | true |
fcbf51f2f19460bea0938596369df58ed49379c8 | C++ | Shaniamoro/2143-OOP-Roberts | /Assignments/P04/ExtraFiles/main.cpp | UTF-8 | 12,054 | 3.34375 | 3 | [] | no_license | /**
* Course: CMPS 2143 - OOP
* Program: Program 2
*
* Purpose: Game of Life Solution
*
* @author Shania Roberts
* @version 1.1 10/08/18
* @github repo: https://github.com/Shaniamoro/2143-OOP-Roberts
*/
#include <string>
#include <iostream>
#include <fstream>
#include <cstring>
#include <exception>
#include <SFML... | true |
e24484ff336b8194841f85ffcdb851b4c93fd4ae | C++ | KamiGoku/Polysectoid | /CPG_Main3/cpg.cpp | UTF-8 | 1,252 | 2.609375 | 3 | [] | no_license | #include <math.h>
#include "brain.cpp"
extern Brain b;
class Actuator {
public:
//float weights[SIZE]; // Weights for neighboring arduinos (0-4 -> vertical connection) (5,6 -> horizontal connections)
//float int_freq; // Intrinsic Frequency
//float bias[SIZE]; // Bias for neighboring arduinos
//float t... | true |
eb34cfca47a2ad2e0b219db4368583cb784088f1 | C++ | muhaiwang/buptsse-2018-study-materials | /算法分析与设计/算法导论实验/2016级算法实验/实验五/动态规划01背包.cpp | GB18030 | 1,696 | 3.375 | 3 | [] | no_license | /*
*
*ʵ ̬滮01
*
*BY TianYu
*
*2018 12 20
*
*
*/
#include<stdio.h>
int bag_w,num;
int goods_v[5],goods_w[5];
int bag_v[5][11];
void Start()
{
printf("뱳");
scanf("%d",&bag_w);
printf("ƷĿ");
scanf("%d",&num);
printf("ֱÿƷļֵ\n");
for(int i=1;i<=num;i++)
{
scanf("%d",&goods_v[i]);
}
printf("ֱÿƷ\n");
for(int j=1... | true |
dc0b337064680f56200368c2b72f47003538b19e | C++ | sahilgoyals1999/GFG-Algorithms | /03. Greedy Algorithms/09. Job Sequencing Problem.cpp | UTF-8 | 808 | 2.953125 | 3 | [] | no_license | // https://practice.geeksforgeeks.org/problems/job-sequencing-problem-1587115620/1
// T.C => O(n^2)
bool comp(Job a, Job b) {
return a.profit > b.profit;
}
pair<int, int> JobScheduling(Job a[], int n) {
// sort in dec. order of profit
sort(a, a + n, comp);
vector<int> result(n); // To store result (Sequenc... | true |
2bdada02cbfb7db7991967e00cf7fdb1a08bcd45 | C++ | prafullgangboir/cpptest | /Chapter11/Class.h | UTF-8 | 905 | 3.3125 | 3 | [] | no_license | // ClassAndConstructor.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
class Name
{
const char* s;
};
class Table
{
Name* p;
size_t sz;
public:
Table(size_t s=15) //Constructor
{
sz = s;
p = new Name[sz];
}
Table(const Table& t) //... | true |
9aa9712810d7b674c49500d1fe15daa701e8ffc7 | C++ | NEDJIMAbelgacem/Graphics_Engine | /Engine/Headers/2D/Camera_2D.h | UTF-8 | 2,573 | 2.890625 | 3 | [] | no_license | #pragma once
#include "Core/Common.h"
#include "glm/glm.hpp"
#include "glm/gtc/matrix_transform.hpp"
#include "AbstractCamera.h"
class Camera_2D : public AbstractCamera {
private:
glm::vec2 camera_pos;
glm::vec2 camera_right = glm::vec2(-1.0f, 0.0f);
glm::vec2 camera_up = glm::vec2(0.0f, 1.0f);
float zoom_level... | true |
7e08a065c6e73ac0b32c0074cd45338fec7ff739 | C++ | hellocomrade/happycoding | /leetcode/GameOfLife.cpp | UTF-8 | 4,938 | 3.6875 | 4 | [] | no_license | #include <vector>
#include <algorithm>
using namespace std;
//https://leetcode.com/problems/game-of-life/
/*
289. Game of Life
According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised
by the British mathematician John Horton Conway in 1970."
Given a board w... | true |
6748bc00bb360c9ac8def5592b37b63547783727 | C++ | hobbsben/wes237b | /Assignment_3/code/dct/src/student_dct.cpp | UTF-8 | 5,504 | 2.859375 | 3 | [] | no_license | #include "main.h"
//#define USE_BASELINE
//#define USE_BASELINE_WITH_LUT
//#define USE_1D_DCT
//#define USE_MM
#define USE_MM_BLOCK
using namespace cv;
Mat LUT_w;
Mat LUT_h;
// Helper function
float sf(int in){
if (in == 0)
return 0.70710678118; // 1 / sqrt(2)
return 1.;
}
// Initialize LUT
void... | true |
46d75da6e23de9e18012c8cb53b71ab6132ee1b6 | C++ | Kowsihan-sk/Codeforces-Solutions | /Contests/Codeforces 717 div2/B_AGAGA_XOOORRR.cpp | UTF-8 | 1,075 | 2.609375 | 3 | [] | no_license | /** Author : S Kowsihan **/
#include <bits/stdc++.h>
using namespace std;
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define ll long long
#define f(a, b, c) for (ll i = a; i < b; i += c)
typedef vector<ll> vl;
#... | true |
c874dc8c05f665a2ec8a85c1105373dc1f150b92 | C++ | qpding/slambook | /ch7/triangulation.cpp | UTF-8 | 2,296 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "vo1.h"
using namespace std;
using namespace cv;
int main(int argc, char const *argv[])
{
// Print usage information if wrong usage occured.
if( argc != 3 )
{
cout << "application usage: feature_ex... | true |
31df3bce6978ec233e928da4cde4b288f7d3b030 | C++ | adityarev/online-judge | /TimusOJ/1313.cpp | UTF-8 | 1,325 | 3.5625 | 4 | [] | no_license | #include <algorithm>
#include <iostream>
#include <vector>
int N;
std::vector<std::vector<int> > arr;
void
run_input() {
std::cin >> N;
for (int i = 0; i < N; i++) {
std::vector<int> row;
for (int j = 0; j < N; j++) {
int x;
std::cin >> x;
row.push_back(x);
}
arr.push_back(row);
}
}
bool
... | true |
a43e3bd859269ea04d0d940d89fb039787f6f9c7 | C++ | LittleYoung/Leaning_Cpp | /Leaning_Cpp/7.7main.cpp | UTF-8 | 1,427 | 3.609375 | 4 | [] | no_license | #include <iostream>
using namespace std;
const int max = 5;
int main()
{
double m[max];
cout << "The following is to fill the array with numbers: " << endl;
double* x = fill_array(m, max);
show(m, x);
if (x == (m - 1))
cout << "You cannot convert because you have not entered a valid number." << endl;
else
... | true |
d589d92a8baa71260c032245303c858655927a6e | C++ | Andres6936/Editogia | /Include/Editogia/Util/Container.hpp | UTF-8 | 2,034 | 3.578125 | 4 | [] | no_license | // Joan Andrés (@Andres6936) Github.
#ifndef EDITOGIA_CONTAINER_HPP
#define EDITOGIA_CONTAINER_HPP
#include <algorithm>
#include <type_traits>
/**
* Wrapper around of method that set all the values of a Container
* to the value send for parameter.
*
* @tparam Container The parameter must be of meet the requireme... | true |
4afe267a94cafab66df51399bf8297408bbd5b72 | C++ | amirghx/Algorithms_Jupyter | /Covid Challenge/Round-0/judge/submissions/96105886/challenge.cpp | UTF-8 | 7,327 | 2.90625 | 3 | [] | no_license | //
// Created by Mahsa Sheikhi on 4/19/20.
//
#include <iostream>
#include <cstdio>
#include <random>
#include <algorithm>
#include <climits>
#include <deque>
#include <string>
using namespace std;
long long INF = 99999999;
#define SIZE 1000
struct Edge{
int u;
int v;
int cost;
};
Edge mstEdges[SIZE];
voi... | true |
984f9f14b714578a25da79373dfa236688a10f84 | C++ | YOSSHUA/mechatronicsLaboratory | /practice2/p2_4_3/p2_4_3servo/p2_4_3servo.ino | UTF-8 | 763 | 2.875 | 3 | [] | no_license | #include <Servo.h>
#include <LiquidCrystal.h> // include the library code:
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // initialize the interface pins
int analogPin = A0;
Servo myservo; // create servo object to control a servo
int val = 0; // variable to read the value from the analog pin
float tot;
void setup() {
... | true |
0167d75612d25cc08ca275b83aa589ca8ff944fe | C++ | srod-prog-cwiczenia/CPlusPlus | /Przykladowe_Okruchy_Programistyczne/permutacje.cpp | UTF-8 | 1,148 | 3.65625 | 4 | [] | no_license | /*
liczba 10 cyfrowa złożona z 10 różnych cyfr,
liczba utworzona przez 2 pierwsze dzieli się przez 2
liczba utworzona przez 3 pierwsze dzieli się przez 3,
etc.
*/
#include <iostream>
using namespace std;
void uwzglednij(int t[], int max) {
if (!t[0]) return; //nie może być zera na początku liczby
bool jest = true;... | true |
a026f07cc556061eb66015ea10c9bd95841a77db | C++ | jordsti/stigame | /StiGame/files/FileSystem.cpp | UTF-8 | 2,821 | 3.015625 | 3 | [
"MIT"
] | permissive | #include "FileSystem.h"
#ifdef _WIN32
#include "windows.h"
#endif
#ifdef __unix__
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
#endif
#include <iostream>
namespace StiGame
{
namespace FS
{
FileSystem::FileSystem()
{
}
#ifdef __unix__
//POSIX implementation
std::vector<Entr... | true |
ce710371aecb841e9c9a05cf1ba04d0de8fb1c26 | C++ | samiavasil/temporary | /src/frame_work/base/CProtocolPackFactory.cpp | UTF-8 | 7,994 | 2.53125 | 3 | [] | no_license | #include "base/CProtocolPackFactory.h"
#include "base/CPacket.h"
#include "base/CProtocolDb.h"
//#define ENABLE_VERBOSE_DUMP
#include "base/debug.h"
CProtocolPackFactory::CProtocolPackFactory(CProtocolDb *protDb ) {
m_pDB = NULL;
if( NO_ERR != attachProtocolDb( protDb ) ){
CRITICAL << "!!!Default Prot... | true |
144c3311d6f40986ff1029e4f7d2a5d523f47508 | C++ | zero4drift/Cpp-Primer-5th-Exercises | /chapter-15/15.24.cpp | UTF-8 | 169 | 2.546875 | 3 | [
"MIT"
] | permissive | // Base class and its derived class require a virtual destructor;
// a virtual destructor of class type should release the resource occupied by the object of that type.
| true |
cda1a4df998062f98efdde594289a9806f53fa4d | C++ | TJUMomonga/TheFifteenthGroup | /CAN信号测试用例/produceTestCase.cpp | GB18030 | 8,018 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <cstdio>
#include <cstring>
#include <stdlib.h>
#include <algorithm>
#include <cmath>
using namespace std;
string chan10_2(int num,int ord,int le);//ʮת
string chan2_16(int * a2, int len_t);//תʮ
string chan10_16(string a10);//ʮתʮ
void zerosort(int * tar ,string x, i... | true |
05eedd7d885a293c04a0af26c81b3004aa041a2a | C++ | yifeir33/cs4500 | /assignment3/part2/array.h | UTF-8 | 926 | 2.515625 | 3 | [] | no_license | // lang: CwC
#pragma once
#include <iostream>
#include <cstring>
#include "object.h"
#include "string.h"
#include "assert.h"
/**
* NOTE: Just use your implementations - our API makes no assumptions about this interface
* besides basic functionality.
*
* Authors: Neil Resnik (resnik.n@husky.neu.edu) & Yifei Wang (... | true |
d468ca8b195c7fc8bb8c9b8dc2da133317c9204d | C++ | demonsheart/C- | /rongyu/homework1/file/2018192045_1038_正确_337.cpp | UTF-8 | 679 | 2.765625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main ()
{
int m,t,i,a1,a2,a3,j,b1,b2,b3;
cin>>t;
while(t--)
{
char *ch1=new char[10];
char *ch2=new char[10];
char *ch3=new char[10];
cin>>ch1; cin>>ch2; cin>>ch3;
cin>>a1>>b1;
cin>>a2>>b2;
cin>>a3>>b3;
m=b1-a1+b2-a2+b3-a3+3;
char... | true |
731a9e843c3566d69e83f239cfec3e2fd7599d55 | C++ | abique/mimosa | /mimosa/time.hh | UTF-8 | 2,900 | 3.0625 | 3 | [
"MIT"
] | permissive | #pragma once
#include <cstdint>
#include <cstddef>
#include <ctime>
#include <stdexcept>
#include <unistd.h>
#include <sys/time.h>
#ifdef __MACH__
# include <mach/mach.h>
# include <mach/clock.h>
#endif
#ifndef CLOCK_MONOTONIC_COARSE
# define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC
#endif
#ifndef CLOCK_REALTIME_CO... | true |
c21a18d57fb5003f8aea15594169ab5fcde319b1 | C++ | notoraptor/cigmar | /src/cpp/filesystem_windows.cpp | UTF-8 | 5,918 | 2.796875 | 3 | [] | no_license | /* Reference code for Windows: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365200(v=vs.85).aspx */
#ifdef WIN32
// #include <cstdio>
#include <cassert>
#include <string>
#include <direct.h>
#include <windows.h>
#include <cigmar/filesystem.hpp>
#include <cigmar/classes/String.hpp>
namespace cigmar {
na... | true |
15e0cb2a479ce56fed976770acd6ef4d162ff7dd | C++ | aniketshelke123/hello-world.io | /bst_using_linked_list.cpp | UTF-8 | 5,262 | 3.5 | 4 | [] | no_license |
# include <iostream>
using namespace std;
struct Node{
int data;
struct Node *left;
struct Node *right;
};
struct Node *root = nullptr, *t;
void insert(){
struct Node *temp, *parent;
temp = new Node();
cout << "Enter the data: ";
cin >> temp -> data;
temp -> right = ... | true |
f231e177e24030710f230d698438fb28b82c61c4 | C++ | eyalya/Experis-CDR-Project | /include/cat.hpp | UTF-8 | 1,232 | 3.59375 | 4 | [] | no_license | #ifndef CAT_H
#define CAT_H
#include <cassert>
#include <iostream>
class Cat
{
public:
explicit Cat(int a_id=0, int a_age=0);
int ID() const;
int Age() const;
void ID(int const& a_ID);
void Age(int const& a_age);
std::ostream& Print(std::ostream& a_os) const;
private:
int m_id;
int m_age;
};
Cat::Cat(in... | true |
f644d2aa57ed7cbff7e60d4fe8202daf1ac1397a | C++ | SinncaStudios/SinncaEngine | /SinncaEngine/ListAlloc.h | UTF-8 | 1,227 | 2.640625 | 3 | [] | no_license | //
// ListAlloc.h
// SinncaEngine
//
// Created by Ryan Oldis on 12/13/13.
// Copyright (c) 2013 Ryan Oldis. All rights reserved.
//
#ifndef __SinncaEngine__ListAlloc__
#define __SinncaEngine__ListAlloc__
#include <iostream>
#include "Memory.h"
namespace sinnca
{
class list : public Memory
{
struct allocHe... | true |
3ed6aff6d7e981f53bc831a05017564d04a4c219 | C++ | Nguyen-Duc-Cong/code-C | /Workshop1.cpp | UTF-8 | 596 | 2.515625 | 3 | [] | no_license | #include <stdio.h>
int n;
double x;
char cl;
int main()
{
int m;
short s;
long L;
float y;
printf("Code of main:%u\n", &main);
printf("Variable n, add:%u, memory size:%d\n", &n, sizeof(n));
printf("Variable x, add:%u, memory size:%d\n", &n, sizeof(x));
printf("Variable cl, add:%u, memory size:%d\n", &cl, sizeof... | true |
3c284ed9900e07b6ea29d265c11c4ccc060cb9ea | C++ | leejaeseung/Algorithm | /BOJ/C++/4358_생태학.cpp | UHC | 2,256 | 3.046875 | 3 | [] | no_license | /*
п ϴ ߿ϴ. Ƿ ̱ ־ , ü % ϴ ϴ α Ѵ.
Է
α ٷ ̷ , ٿ ϳ ̸ ־. ̸ 30ڸ , Է¿ ִ 10,000 ־ ִ 1,000,000 ־.
־ ̸ ϰ, ϴ Ҽ 4°ڸ Բ Ѵ.
Ǯ:
Ʈ ˰ ⺻ Դϴ.
*/
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
using namespace std;
#de... | true |
8d854b8ec1f124ec58e840518692220f0efb3212 | C++ | lyh458/InteractionModels_DemoCode | /src/iModOSG/MyInteractionTriangleMeshView.h | UTF-8 | 2,546 | 2.921875 | 3 | [] | no_license | //
// MyInteractionTriangleMeshView.h
// BoneAnimation
//
// Created by Christian on 30.11.13.
//
//
#ifndef __BoneAnimation__MyInteractionTriangleMeshView__
#define __BoneAnimation__MyInteractionTriangleMeshView__
#include "MyInteractionMeshView.h"
#include "MyInteractionTriangleMesh.h"
namespace MyInteractionMe... | true |
b969b8e422333411d826f7a48bca5901a041595c | C++ | LenyKholodov/wood | /new/misc/misc/list.inl | IBM866 | 2,576 | 2.890625 | 3 | [] | no_license | template <class T> List<T>::List (Pool* pool)
: MemObject (pool)
{ }
template <class T> List<T>::~List ()
{
int count = this->count (), i = 0;
for (iterator iter = *this;i<count;erase(iter),i++);
}
template <class T> bool List<T>::InsertFirst (const T& obj,bool exc) throw (ExcNoMemory&... | true |
13cb2a83ea7e03b2edf0a88db37a4850de3d583c | C++ | zgzhengSEU/Algorithm-Learning | /LeetCode/34.find-first-and-last-position-of-element-in-sorted-array.cpp | UTF-8 | 1,496 | 3.234375 | 3 | [] | no_license | /*
* @lc app=leetcode id=34 lang=cpp
*
* [34] Find First and Last Position of Element in Sorted Array
*
* https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/description/
*
* algorithms
* Medium (38.84%)
* Likes: 7670
* Dislikes: 244
* Total Accepted: 856.3K
* Total S... | true |
5d2d30e4058ed877311a45518a959d60cd76de16 | C++ | weirdrag08/Data-Structures-Algorithms | /Graphs/Adjacency_list_implementation.cpp | UTF-8 | 813 | 3.453125 | 3 | [] | no_license | #include<iostream>
#include<list>
using namespace std;
class Graph{
int vertices;
list<int> *l;
public:
Graph(int vertices){
this-> vertices = vertices;
l = new list<int>[vertices];
}
void addEdge(int u, int v, bool bidir = true){
l[u].push_back(v);
if(bidir){
... | true |
b98527369df7ab4f6f6a2ce8d9392725946c9738 | C++ | GreggGut/coen345 | /src/Grid.cpp | UTF-8 | 4,074 | 3.171875 | 3 | [] | no_license | /*
* Grid.cpp
*
* Created on: Jan 21, 2013
* Author: k_berson
*/
//Self
#include "Grid.h"
//C Library
#include <iostream>
//namespace
using namespace std;
//Constructor
// [I n|i n] Initialize the system: The values of the array floor are zeros and the robot is back to [0, 0], pen up and facing north. n s... | true |
0b2129c43d626fd22a150094d87383e0773557a0 | C++ | MattFiler/Planned-Obsolescence | /Source/ConfigParsers/MapData.h | UTF-8 | 2,407 | 2.984375 | 3 | [] | no_license | #ifndef PLANNEDOBSOLESCENCE_MAPDATA_H
#define PLANNEDOBSOLESCENCE_MAPDATA_H
#include "../Map/Room.h"
#include "../Sprites/ScaledSpriteArray.h"
#include <Engine/Renderer.h>
#include <vector>
struct MapData
{
// Load config data in
void load(json& passed_map_config)
{
// Select a map set
for (json::iterat... | true |
f089cfc689f0bb3a270e3712ca499933bd482e7e | C++ | bryanibit/mosaic_multi_photos | /mosaic_multi_photos/mosaic.cpp | GB18030 | 6,646 | 2.78125 | 3 | [] | no_license | #include "mosaic.h"
#define SURFMETHOD 0
using namespace std;
using namespace cv;
mosaic::mosaic(){
}
mosaic::~mosaic(){
}
void mosaic::to_homogeneous(const std::vector< cv::Point2f >& non_homogeneous, std::vector< cv::Point3f >& homogeneous)
{
homogeneous.resize(non_homogeneous.size());
for (size_t i = 0; i <... | true |
d4aa141032894b254d76a2cf5c20defc5a3d0d28 | C++ | wonsangL/algorithm | /Problem/baekjoon/10987_vowelCount.cpp | UTF-8 | 265 | 3.0625 | 3 | [] | no_license | #include<iostream>
#include<string>
using namespace std;
int main() {
int result = 0;
string input;
cin >> input;
for (char word : input)
if (word == 'a' || word == 'i' || word == 'e' || word == 'o' || word == 'u')
result++;
cout << result << endl;
} | true |
b57ba41370b7fcf9a0027685903c52bf80e572b2 | C++ | lucraraujo/CodesFromCollege | /POO/PraticalWork-III/03/graph.cpp | UTF-8 | 2,342 | 3.328125 | 3 | [
"Unlicense"
] | permissive | #include "graph.h"
GraphSingleton::GraphSingleton(int a) : Tamanho(a)
{
ListaDeAdjacencia.resize(a);
Arestas = 0;
}
bool GraphSingleton::insert(const Edge& aresta)
{
int no1 = aresta.GetNode1();
int no2 = aresta.GetNode2();
if (no1 > (Tamanho-1) || no2 > (Tamanho-1))
return false;
if (edge(a... | true |
10b254c27ffe259a0ddbc9015b5e428fd51b7c6c | C++ | anand722000/DSA-cpp-Hacktoberfest2021 | /CPP Programs/Cpp/cpp-check-leap-year.cpp | UTF-8 | 194 | 2.5625 | 3 | [
"MIT"
] | permissive | #include<iostream.h>
#include<conio.h>
void main()
{
int y;
cout<<"Enter a year: ";
cin>>y;
if(y%4==0)
{
cout<<"Leap Year";
}
else
{
cout<<"Not a Leap Year";
}
getch();
} | true |
1e8c28f91f6e8d97986404da380434c90ef421a2 | C++ | yuanlinhu/AI_SDL | /Src/BTNode_Move.cpp | UTF-8 | 953 | 2.734375 | 3 | [] | no_license |
#include "BTNode_Move.hpp"
#include "GameObject.hpp"
BTNode_Move::BTNode_Move(GameObject* objParent)
: BTNode(BTNT_LEAF, objParent)
{
}
bool BTNode_Move::check()
{
GameObject* obj = getObjParent();
if (nullptr == obj)
{
return false;
}
if (obj->getCurPos() == obj->GetTargetPos())
{
return false;
}
r... | true |