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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
5bfe7b1166980361b0f21624e195742d117e4e5b | C++ | avencat/cpp_r-type | /client/inc/AComponent.hpp | ISO-8859-1 | 675 | 2.90625 | 3 | [] | no_license | #ifndef ACOMPONENT_HPP_
# define ACOMPONENT_HPP_
# include "Sprite.hpp"
class AComponent
{
public:
AComponent();
AComponent(int);
virtual ~AComponent();
void setId(const int &);
void setPosition(int, int);
void setSprite(const Sprite::TypeSpriteEnum &, int);
const int &getId() const;
const Spr... | true |
3ff61be118582d31328836f79b7561cdeec6da60 | C++ | 8Observer8/PlotAndTable | /PlotWindow.cpp | UTF-8 | 1,118 | 2.515625 | 3 | [] | no_license |
#include <QVector>
#include <QSqlRecord>
#include "PlotWindow.h"
#include "ui_PlotWindow.h"
PlotWindow::PlotWindow(QWidget *parent) :
QDialog(parent),
ui(new Ui::PlotWindow)
{
ui->setupUi(this);
}
PlotWindow::~PlotWindow()
{
delete ui;
}
void PlotWindow::slotUpdatePlot(const QSqlTa... | true |
5a2736189bba04c285cc737ee89649544d408fa7 | C++ | bss9395/bss9395.github.io | /_en/Computer/Data_Structure/Node/BalanceNode.cpp | UTF-8 | 1,679 | 3.203125 | 3 | [] | no_license | /* BalanceNode.cpp
Author: BSS9395
Update: 2018-07-02T19:16:00 +08
*/
#ifndef BalanceNode_h
#define BalanceNode_h
#include <iostream>
using std::cout;
using std::cerr;
using std::endl;
using std::ostream;
#include <string>
using std::string;
template <typename T>
class BalanceNode {
friend auto operator<<(ostream ... | true |
7f2887ddf23afff19b2f53834c15d0ab26ce4b4f | C++ | eassuncao/my-first-calculator | /Calculator/main.cpp | UTF-8 | 1,613 | 4.53125 | 5 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
string sign;
double num1;
double num2;
cout<<"Welcome to my c++ simple calculator!"<<endl;
cout<<"This calculator supports two numbers at a time and four operators."<<endl<<endl;
cout<<"Please type the first number in your calculation, t... | true |
85293526751cc4d6aed947299d576b4b37b13d7e | C++ | royalneverwin/Codes-in-Sophormore | /模拟机考题/现代艺术.cpp | UTF-8 | 2,686 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <stack>
using namespace std;
/*普通方法:模拟画图——result:超时
struct Paint{
int color;//最终颜色
int laser;//层数
};
struct Paint p[100001];//记录图画的颜色和出度
int N[100001];//记录图画
int color_start[100001] = {0};//记录该颜色的开始
int color_end[100001] = {0};//记录该颜色的结束
int main(){
... | true |
8dcb2a4cd1bbe3b3fc345fdfb1aa537162c7d70e | C++ | SimKyuSung/Algorithm | /BeakJoon C++ Algorithm/1012Farming.cpp | UHC | 1,236 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <queue>
#include <utility>
#include <algorithm>
#include <memory.h>
using namespace std;
int field[50][50];
int M, N, K;
int counter;
int moveX[4] = { 1, -1, 0, 0};
int moveY[4] = { 0, 0, 1, -1};
queue< pair< int, int> > q;
void bugMove(int, int);
bool range_error1(int, int);
int main... | true |
c5e395295bdbb3eba26677da9914439609d6d043 | C++ | dotrado/TDEngine2 | /TDEngine2/source/core/memory/CPoolAllocator.cpp | UTF-8 | 3,675 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | #include "./../../../include/core/memory/CPoolAllocator.h"
namespace TDEngine2
{
CPoolAllocator::CPoolAllocator():
CBaseAllocator(), mObjectSize(0), mObjectAlignment(0),
mppNextFreeBlock(nullptr)
{
}
E_RESULT_CODE CPoolAllocator::Init(U32 objectSize, U32 objectAlignment, U32 totalMemorySize, U8* pMemoryBlock... | true |
b2da69808d7a99e08649885536392aa0f1b0ea53 | C++ | IanFinlayson/tetra | /source/ide/console.cpp | UTF-8 | 3,360 | 2.921875 | 3 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | /* console.cpp
* A text editor component that is designed specifically for Tetra code
* */
#include <QtWidgets>
#include "console.h"
#include "settingsmanager.h"
#include "ui_mainwindow.h"
Console::Console(MainWindow* parent)
: QPlainTextEdit(parent) {
setContentsMargins(50, 50, 50, 50);
ensureCursorV... | true |
f1918fdcc57a7e371f230bd60889de239558dbbb | C++ | dianaachim/Object-Oriented-Programming | /lab14/DynamicVector.h | UTF-8 | 2,712 | 3.5625 | 4 | [] | no_license | #pragma once
#include "Comparator.h"
template <typename T>
class DynamicVector
{
private:
T * elems;
int size;
int capacity;
public:
DynamicVector<T>(int capacity = 10);
//copy constructor for a DynamicVector
DynamicVector<T>(const DynamicVector& v);
~DynamicVector<T>();
//overload the operator -
DynamicVe... | true |
d70d3e276bd345b2fee0abf02412169a7856e674 | C++ | tonyhan18/MicroProcessor2016_Arduino | /Practice/TimeInterruptPractice/TimeInterruptPractice_DotMatrix.ino | UTF-8 | 1,251 | 3.0625 | 3 | [] | no_license | #include <TimerOne.h>
//ROWS : R1 ~ R8 <-> PIN 36 ~ 43
//COLS : C1 ~ C8 <-> PIN 46 ~ 49,9,8
// 윗방향 화살표를 올라가도록 하는 프로그램
int row_pin[] = {36, 37, 38, 39, 40, 41, 42, 43};
int col_pin[] = {46, 47, 48, 49, 6, 7, 9, 8};
int led[][8] = {{1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1},
{1, 1... | true |
10f7c0a115ab55e74ad8b3d72003b1c82fa5cd02 | C++ | zbs/Pedestrian-Detection | /Feature.cpp | UTF-8 | 11,151 | 2.578125 | 3 | [] | no_license | #include "Feature.h"
void
FeatureExtractor::operator()(const ImageDatabase& db, FeatureSet& featureSet) const
{
int n = db.getSize();
featureSet.resize(n);
for(int i = 0; i < n; i++) {
CByteImage img;
ReadFile(img, db.getFilename(i).c_str());
featureSet[i] = (*this)(img);
}
}
CByteImage
FeatureExtractor... | true |
66fcd56af3819bf20aaec59be7e9a39e717f66cd | C++ | yydaor/OtterUI | /API/src/Math/Vector3.cpp | UTF-8 | 255 | 2.71875 | 3 | [
"MIT"
] | permissive | #include "Math/Vector3.h"
namespace VectorMath
{
const Vector3 Vector3::ZERO (0.0f, 0.0f, 0.0f);
const Vector3 Vector3::UNIT_X (1.0f, 0.0f, 0.0f);
const Vector3 Vector3::UNIT_Y (0.0f, 1.0f, 0.0f);
const Vector3 Vector3::UNIT_Z (0.0f, 0.0f, 1.0f);
} | true |
8933b936befd3dc037e41c894ed8b2ac9d144c9b | C++ | diluises/TShine | /TShine/include/TSHistogramFld.h | UTF-8 | 2,650 | 2.671875 | 3 | [] | no_license | /*
* TSHistogramFld.h
*
* Created on: Jun 2, 2014
* Author: Silvestro di Luise
* Silvestro.Di.Luise@cern.ch
*
*
* Class to create a folder of Histograms (TH1,TH2, TH2Poly...)
*
* Each histogram-axis has associated the name of the corresponding TSVariable.
* Those names are to be pro... | true |
a23de8a609e2d4e06404bcf70ddc0d8148bbabea | C++ | Cabahamaru/PRO1-FIB | /Llista_08/regla_horner/P50036.cc | UTF-8 | 535 | 3.296875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <math.h>
using namespace std;
//Llegeix una seq. de nombres reals i els gaurda a v
void read(vector<int>& v) {
int n = v.size();
for (int i = 0; i < n; ++i) cin >> v[i];
}
int avalua(const vector<int>& p, int x) {
int n = p.size();
int horner = 0;
... | true |
68f5986af0dfbf0b711ed8ee4716146a3ef9e0d9 | C++ | google/orbit | /third_party/libutils/RefBase_test.cpp | UTF-8 | 13,792 | 2.640625 | 3 | [
"BSD-2-Clause",
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] | permissive | /*
* Copyright (C) 2016 The Android Open Source Project
*
* 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 app... | true |
ebc6a79a60954c7d6a811f4d8b4a79fa01815fdd | C++ | adityarbhatia/C-C-1 | /TwosAndOnesNested.cpp | UTF-8 | 322 | 2.8125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int a = 1, b = 2;
for(int i = 0; i<7; i ++)
{
for(int j = 0; j <i; j++)
{
cout << b;
}
for(int k = 0; k < 6-i; k++)
{
cout << a;
}
cout << endl;
}
return 0;
} ... | true |
f08e5a82121aa383036082dd54c7a8bd03ecbccd | C++ | XsnTrcK/AdventOfCode | /2020/main.cpp | UTF-8 | 2,748 | 3.375 | 3 | [] | no_license | #include <iostream>
#include "dayOne.h"
#include "dayTwo.h"
#include "dayThree.h"
#include "dayFour.h"
#include "dayFive.h"
#include "daySix.h"
#include "daySeven.h"
#include "dayEight.h"
#include "dayNine.h"
using namespace std;
using namespace AdventOfCode2020;
int main() {
string inputPath;
cout << "Path t... | true |
18fcf5b015e9ba0ee6f360336f6d82e8c7bcbbeb | C++ | kinshukk/competitive_programming | /USACO/CowTipper.cpp | UTF-8 | 1,048 | 2.984375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
bool arr[11][11];
void flip(int y, int x){
// for(int i=0; i<=y; i++){
// for(int j=0; j<=x; j++){
// cout << arr[i][j] << " ";
// }
// cout << endl;
// }
//
// cout << "becomes" << endl;
for(int i=0; i<=y; i++){
... | true |
0fd1325387d698dc5469d018f2ae31f559d16395 | C++ | 0x7DD/Maratones | /gameTheory/crazyCalendar.cpp | UTF-8 | 665 | 2.625 | 3 | [
"MIT"
] | permissive | # include <cstdio>
# include <cstdlib>
# include <iostream>
# include <cmath>
using namespace std;
int main(){
int t,cont = 0;
scanf("%d", &t);
while(t--){
int n,m;
scanf("%d %d", &n, &m);
int nim = 0;
for(int i = 0; i < n; ++i){
for(int j = 0; j < m; ++j){
... | true |
1c63f062e648f8d4fd6193fbe68879154c203663 | C++ | McCampins/LightAndDarkness | /LightAndDarkness/LightAndDarkness/Exit.cpp | UTF-8 | 1,084 | 3.015625 | 3 | [
"Apache-2.0"
] | permissive | #include <iostream>
#include <assert.h>
#include "Exit.h"
#include "Room.h"
using namespace std;
Exit::Exit(const char* name, const char* oppositeName, const char* description, Room* origin, Room* dest,
bool oneWay, bool locked, Entity* key) :
Entity(name, description, (Entity*)origin),
oppositeName(oppositeName... | true |
4a8a0f169fff9e6bbf72605f064c1c15a29c781b | C++ | kandouss/monospace | /science/cpp/monospace_math.cpp | UTF-8 | 1,834 | 2.8125 | 3 | [] | no_license | void Matrix2f::svd(Matrix2f* w, Vector2f* e, Matrix2f* v) const{
//If it is diagonal, SVD is trivial
if (fabs(data[0][1] - data[1][0]) < EPSILON && fabs(data[0][1]) < EPSILON){
w->setData(data[0][0] < 0 ? -1 : 1, 0, 0, data[1][1] < 0 ? -1 : 1);
e->setData(fabs(data[0][0]), fabs(data[1][1]));
... | true |
e7c968b6acc535a0b886de9a64ce660ddd268c75 | C++ | a-cha/cpp_beginning | /mod08/ex01/main.cpp | UTF-8 | 2,090 | 3.203125 | 3 | [] | no_license |
#include "Span.hpp"
#include "print.hpp"
#include <list>
#include <vector>
#define INSERT_LEN 100000
int randNumberGenerator() { return rand() ; }
int main() {
srand(time(nullptr));
{
Span sp = Span(5);
try {
std::cout << GREEN BOLD "Sbj tests" STD << std::endl;
sp.addNumber(5);
sp.addNumber(3);... | true |
d3e1201e805dfaab00a826ebf4178c08a2859929 | C++ | ankitsumitg/mrnd-c | /Step_6_New/spec/getSubstringSpec.cpp | UTF-8 | 2,728 | 3.0625 | 3 | [] | no_license | #include "stdafx.h"
#include "../src/getSubstring.cpp"
using namespace System;
using namespace System::Text;
using namespace System::Collections::Generic;
using namespace Microsoft::VisualStudio::TestTools::UnitTesting;
namespace spec
{
[TestClass]
public ref class getSubstringSpec
{
private:
TestContext^ testC... | true |
6fe179182475bdac50f4554cea827d85b37e2165 | C++ | slerbalenkki/koulu_1 | /Binaarilaskuri_A/Binaarilaskuri_A.ino | UTF-8 | 1,669 | 2.734375 | 3 | [] | no_license | #define LED1 13
#define LED2 12
#define LED3 11
#define LED4 10
#define LEDON HIGH
#define LEDOFF LOW
#define viive 1000
void setup() {
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(LED4, OUTPUT);
Serial.begin(9600);
}
void turnOn(int led){
digitalWrite(led, LEDON);
}
vo... | true |
85295e620f2c383a4366a74cda019836726e6f05 | C++ | kurobaron/AtCoder | /cpp/practice/abc132c.cpp | UTF-8 | 246 | 2.75 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int n,i;
cin >> n;
vector<int> d(n);
for(i=0;i<n;++i) cin >> d.at(i);
sort(d.begin(),d.end());
cout << d.at(n/2)-d.at(n/2-1) << endl;
return 0;
}
| true |
056f3cecea10d74f47882fde6f5d66038b55a896 | C++ | xclusive43/c-pragramming | /pointer.cpp | UTF-8 | 191 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | #include<stdio.h>
int main()
{ int a=12;
int *s;
s=&a;
printf("s=%d\n",s);
s=s+1;
printf("s=%d\n", s);
float c=3.1;
float *b;
b=&c;
*b=3.10;
printf("c=%f\n", c);
}
| true |
424f771543008c7d144272788c02399a4d1c0d53 | C++ | HyunWoooo/Tiger | /호색전/The Golem/menu.cpp | UTF-8 | 1,378 | 2.53125 | 3 | [] | no_license | #include "stdafx.h"
#include "menu.h"
CMenu::CMenu()
{
SelectNum = 1;
WorldNum = 0;
}
void CMenu::Init(CTexture Texture, CTexture Texture2, D3DXVECTOR3 vPos, D3DXVECTOR3 vPos2)
{
m_DxSprite = new CSprite;
m_DxSprite->Create(CDevice::GetSprite());
m_Texture = Texture;
m_Texture2 = Texture2;
m_vPos = vPos;
... | true |
300b6b902b3cd85f6d2996b50d6a9f4f6985d315 | C++ | OndraSlama/Strategy_simlation-old | /StrategyGUI_Simulator/StrategyC.cpp | UTF-8 | 5,715 | 2.734375 | 3 | [] | no_license | #include "StrategyC.h"
StrategyC::StrategyC()
{
mode = defense;
cameraTolerance = 0.7;
kickAreaLength = 350;
kickAreaWidth = 200;
kickAreaStart = 300;
kickYSpeedLimit = 5;
kickXSpeedLimit = 20;
advanceFactor = 50;
}
StrategyC::~StrategyC()
{
}
void StrategyC::Process()
{
cyclesSinceLastCameraInput++;
if... | true |
7e156d7c5664367cb53721acc3235a97eb7e75e9 | C++ | bmegli/footprint-collision-checker | /examples/simple_example.cpp | UTF-8 | 1,913 | 2.859375 | 3 | [] | no_license | // Copyright (c) 2021 Bartosz Meglicki <meglickib@gmail.com>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by ... | true |
05cdc0f76fc5c8aac7b7dbe740f45a2e346de9ec | C++ | llyr-who/MassStiff | /Matrix.cpp | UTF-8 | 4,564 | 3.15625 | 3 | [] | no_license | #include<iostream>
#include "Vector.hpp"
#include"Matrix.hpp"
Matrix::Matrix(int rows, int cols)
{
mRows = rows;
mCols = cols;
mData = new double[rows*cols];
for(int i=0; i <mRows;i++)
{
for(int j=0;j<mCols;j++)
{
mData[j*mRows+i] = 0;
}
}
}
Matrix::Matrix(const Matrix&m1)
{
mRows... | true |
0831d4a5dac11ba2273f66d6780f62a462ac9fca | C++ | dineshkwal/DS-algo-codes | /DisjointSet.cpp | UTF-8 | 1,320 | 3.546875 | 4 | [
"MIT"
] | permissive | #include <unordered_map>
#include <vector>
class DisjointSet
{
public:
// nodes from 1 to N
DisjointSet(int N)
{
for (int i = 1; i <= N; ++i)
{
parent[i] = i;
rank[i] = 0;
size[i] = 1;
}
}
// nodes as given in vector
DisjointSet(const std::vector<int>& v)
{
for (auto i : v)
{
parent[i] =... | true |
9d0883b8945b8603902954df3b46b808c68d6c00 | C++ | MrFunBarn/Assignments | /Assignment11/Assignment11.cpp | UTF-8 | 2,093 | 3.5 | 4 | [] | no_license | /*
* Brandon Bell
* Assignment10
* Recitation: Th 1030am
* Guogui Ding
*/
#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include "Graph.h"
using namespace std;
// The basic structure of this main function was taken from my assignments 5.
int main(int argc, char *argv[]){
// ... | true |
c1d82d1a11c88053a3aa23608532304a8b038765 | C++ | NimishaGarg/competitive-programming | /algos/seg_tree(my variant).cpp | UTF-8 | 1,392 | 3.078125 | 3 | [] | no_license | // call build in main function with v = 1, l = 0, r = n - 1
const int N = 2e5 + 100;
struct data{
int val;
int lev;
};
data seg_tree[4*N];
int arr[N], n, q;
data combine(data l, data r){
data res;
if(l.lev == 0){
res.val = l.val|r.val;
res.lev = 1;
}
else{
res.val = ... | true |
ffc8418b70547748865e1f458f342eadd241ac2e | C++ | coin-or/Gravity | /thirdparty/mp/rstparser.h | UTF-8 | 2,941 | 2.59375 | 3 | [
"BSD-3-Clause"
] | permissive | /*
A reStructuredText parser written in C++.
Copyright (c) 2013, Victor Zverovich
All rights reserved.
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... | true |
cf27f591fe4fb1b47d675e51cb9e68a658554153 | C++ | PaytonWu/LeetCode | /Remove Duplicates from Sorted Array.cpp | UTF-8 | 1,390 | 3.078125 | 3 | [] | no_license | // Remove Duplicates from Sorted Array.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
class Solution {
public:
int removeDuplicates(int A[], int n) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
if (n <= 1)
{
... | true |
e7af4038074901defe657ed9e330b22f7c66a939 | C++ | phuduong85/yangsj | /code/cocos/Classes/app/astar/Astar.cpp | UTF-8 | 6,905 | 2.796875 | 3 | [] | no_license | //
// Astar.cpp
// snake222
//
// Created by yangsj on 14-3-26.
//
//
#include "Astar.h"
Astar::Astar()
{
}
Astar::~Astar()
{
VecAstarItemMap::iterator iter = mapAry.begin();
while (iter != mapAry.end())
{
VecAstarItem items = *iter;
VecAstarItem::iterator iter1 = items.begin();
... | true |
7e631575eb93286a9054ce5be75e9ec335865340 | C++ | KimJeaIn/KirbyGame | /KirbyProject/GameDev/Callable.hpp | UTF-8 | 534 | 3.15625 | 3 | [] | no_license | #pragma once
template<typename ReturnType, typename Cls, typename FunctionPointer>
struct Callable
{
typedef FunctionPointer action_type;
Callable(FunctionPointer fp):act(fp){}
template<typename Derived,
typename Arg1,
typename Arg2,
typename Arg3,
typename Arg4>
ReturnType operator ()(Derived* obj, Arg... | true |
3376128542c360324b61d82def62536839b8fc3b | C++ | kankanla/Cjiajia | /p220---stack_c/stack_e1.cpp | UTF-8 | 3,197 | 4.03125 | 4 | [] | no_license | /********************************************************
* Stack *
* A file implementing a simple stack class *
********************************************************/
#include <cstdlib>
#include <iostream>
#include <assert.h>
const int STACK_SIZE = 100; // Maximum size of a stack
/************************... | true |
99af7c687e0208fc74dd03e6bf075f46b2ace48a | C++ | stynosen/CHIBI-Engine | /CHIBI-Engine/Materials/PosColorMaterial.h | UTF-8 | 1,162 | 2.515625 | 3 | [] | no_license | #pragma once
#include "BaseMaterial.h"
//-----------------------------------------------------
// PosNormTexMaterial Class
//-----------------------------------------------------
//!A material that uses the flat color shader
class PosColorMaterial : public BaseMaterial
{
public:
PosColorMaterial(const D3DXCO... | true |
85c19b74c4086ae3df0233a9d28a66cfa9452d5f | C++ | solareenlo/cpp | /atcoder/05_AtCoder-Beginner-Contest/abc002/B/main.cpp | UTF-8 | 438 | 2.9375 | 3 | [] | no_license | #include <iostream>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;
void solve(std::string W){
REP(i, W.size()) {
if (W[i] == 'a' || W[i] == 'i' || W[i] == 'u' || W[i] == 'e' || W[i] == 'o')
continue ;
printf("%c", W[i]);
}
cout << '\n';
}
int main(){
/... | true |
7ceb1ef689b302fc231f47729433cd746bdf2a37 | C++ | Neverous/individual | /TIMUS/URSPC2011/i.cpp | UTF-8 | 539 | 2.9375 | 3 | [] | no_license | /* 2011
* Maciej Szeptuch
* II UWr
*/
#include<cstdio>
#include<cstring>
int linesPerPage,
width,
words,
wordLen,
actual,
lines = 1;
char word[128];
bool first = true;
int main(void)
{
scanf("%d %d %d", &linesPerPage, &width, &words);
for(int w = 0; w < words; ++ w)
{
scanf("%s", word);
wordLen = strle... | true |
fedf83923075274f9658dfee91711a20206d3397 | C++ | gizmomogwai/cpplib | /lang/WIN32SyncMutex.cpp | UTF-8 | 493 | 2.53125 | 3 | [
"MIT"
] | permissive | #include <lang/SyncMutex.h>
#include <assert.h>
#ifdef WIN32
SyncMutex::SyncMutex() : waiting(false) {
}
SyncMutex::~SyncMutex() {
}
void SyncMutex::lock() {
m.lock();
}
void SyncMutex::unlock() {
m.unlock();
}
void SyncMutex::wait() {
assert(waiting == false);
waiting = true; ... | true |
bb94d096a3a17e172d607d3fb7ad22ed845f75bf | C++ | wycissiily/BP | /readdata.h | UTF-8 | 1,380 | 2.703125 | 3 | [] | no_license | #include<algorithm>
#include<cstdio>
using namespace std;
const int BATCH_SIZE=20;
const int BATCH_COUNT=3000;
const int TRAIN_COUNT=60000;
const int TEST_COUNT=10000;
unsigned char tmp[784*TRAIN_COUNT];
FILE *traini,*trainl,*testi,*testl;
struct Data{
float image[784];
unsigned char label;
};
void _read(FILE *fi,FIL... | true |
5b3e2ceda7b5bfba3622f735ba2ea13c0744e1a7 | C++ | bbvch13531/algorithm | /Baekjoon/backtracking/2580-sudoku.cpp | UTF-8 | 902 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int map[10][10];
bool validate(void){
//check rows
int check[10]={0,}, flag;
for(int i=0; i<9; i++){
for(int j=0; j<9; j++) check[j] = 0;
for(int j=0; j<9; j++){
if(map[i][j]){
if(check[j]==0){
... | true |
d71e3d32aac90507dfe982d1b7cb385e897e49c8 | C++ | Asteip/KaboSolve | /src/solver/constraints/cSupOrEqual.cpp | UTF-8 | 2,783 | 2.890625 | 3 | [] | no_license | #include "cSupOrEqual.hpp"
#include <iostream>
using namespace std;
CSupOrEqual::CSupOrEqual(int *coefficients, int rightMember, Domain **domains, int size) : Constraint(domains, size){
_coefficients = coefficients;
_rightMember = rightMember;
}
CSupOrEqual::~CSupOrEqual(){}
bool CSupOrEqual::applyConstraint(int... | true |
f8d38743449a5119770f2be6e1ab943f96d5a611 | C++ | jackschu/Connect4Players | /src/board.h | UTF-8 | 1,233 | 3.046875 | 3 | [] | no_license | #pragma once
#include "tile.h"
#include <algorithm>
#include <bitset>
#include <iostream>
#include <unordered_set>
#include <vector>
#include <queue>
class Board {
public:
const static int BOARD_WIDTH = 7;
const static int WIN_LEN = 4;
const static int BOARD_HEIGHT = 6;
Board();
void print() const;
static... | true |
f75fe7737575b5338e1ccd3b9a2c6e27e5130f52 | C++ | mvwicky/Jack-of-all-Calculators | /CPP_CALC/OPERATION.h | UTF-8 | 676 | 3.203125 | 3 | [] | no_license | #ifndef OPERATION_H_INCLUDED
#define OPERATION_H_INCLUDED
class operation {
protected:
float *input1;
float *input2;
float *input3;
float *result;
public:
operation();
operation(float);
operation(float , float);
operation(float , float , float);
};
operation::operation()
{
}
operation::operation(float i1)
{... | true |
fa8170c447d0c40b883ce718ee9255762c12e58d | C++ | Carolusian/learn-prog-lang | /clang/03_conan_sample/src/main.cc | UTF-8 | 173 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include <fmt/format.h>
int main(int argc, char **argv)
{
std::string s = fmt::format("{:d}", 10);
std::cout << s << std::endl;
return 0;
}
| true |
3a9ba2a74da64ad8373d7a7158692b64dd8b20f5 | C++ | farnazkohankhaki/CPP-Codes-Archive | /USACO/Name That Number.cpp | UTF-8 | 1,148 | 2.578125 | 3 | [] | no_license | /*
ID: fkohank1
PROG: namenum
LANG: C++
*/
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin ("namenum.in");
ofstream fout ("namenum.out");
ifstream ifs ("dict.txt");
const int maxN = 5000 + 8;
string s[maxN];
int main()
{
bool k =
0;
string n, a[10];
... | true |
d0e6becd87639ba21c3083f21420247e1da4f3c1 | C++ | fcomuniz/my-lib | /source/structures/set/MySet.h | UTF-8 | 939 | 3.140625 | 3 | [] | no_license | #ifndef MY_LIB_MY_SET
#define MY_LIB_MY_SET
#include <functional>
#include <algorithm>
#include <list>
#include <array>
namespace my_lib{
template<class T, int m, class hashF = std::hash<T>>
class MySet{
public:
void insert(const T & value){
if(!hasValue(value)){
v[getPosition(value)].push_back(... | true |
96f2a81365ddabe3af6bd9ae42688e9dd6bab138 | C++ | WinstonMoh/LinuxShellProject | /shell.cpp | UTF-8 | 12,056 | 3.171875 | 3 | [] | no_license | /*
* CS 460 Assignment 2
* Winston Moh T.
* Linux shell program
* 3/29/2018
*/
#include <iostream> // I/O fcns like cout
#include <string> // for getline fcn
#include <stdexcept> // throw exceptions.
#include <vector> // for vector data structure.
#include <fstream> // for File I/O
#include <sstream> // for stri... | true |
99f2338dde94dd70b281305133f7c0a8ee36e30f | C++ | InvincibleSarthak/Competitive-Programming | /Trees/Remove Half Nodes.cpp | UTF-8 | 844 | 3.328125 | 3 | [] | no_license | // half node - node with only one child
void removeNodes(TreeNode* root){
if(!root) return;
if(root->left){
if(root->left->left && !root->left->right){
root->left = root->left->left;
}
if(!root->left->left && root->left->right){
root->left = root->left->right;... | true |
4039d8ce3d19db560b9c298d6b2ff5dae2332950 | C++ | LeeReeve/WaveSimulation | /WaveSim/main.cpp | UTF-8 | 8,615 | 2.59375 | 3 | [] | no_license | //OpenGL includes
#include <glad/glad.h>
#include <GLFW/glfw3.h>
//Shader class
#include "ShaderClass.h"
#include <iostream>
#include <math.h>
#include <chrono>
#include <thread>
//For handling changes in window size
void framebufferSizeCallback(GLFWwindow* window, int width, int height) {
glViewport(0, 0, width, h... | true |
891c28cf9feed04349e6fecd5c7e81c500208197 | C++ | leebohee/problem-solving | /leetcode/482.cpp | UTF-8 | 1,119 | 2.578125 | 3 | [] | no_license | class Solution {
public:
string licenseKeyFormatting(string S, int K) {
int len = S.length(), idx = 0;
char* new_str = new char [len+1];
for(int i=0; i<len; i++){
if(S.at(i) == '-'){
// skip
}
else if(S.at(i) >= 'a' && S.at(i) <= '... | true |
03352ef59f229177d9fd4b59f33d8d9e027b0c58 | C++ | mengarena/Leetcode | /com/leet_cpp/LongestUnivaluePath.cpp | UTF-8 | 1,833 | 3.65625 | 4 | [] | no_license | /*
687. Longest Univalue Path
Given a binary tree, find the length of the longest path where each node in the path has the same value.
This path may or may not pass through the root.
The length of path between two nodes is represented by the number of edges between them.
Example 1:
Input:
5
... | true |
c6ea44d0cede625e391b06597a076b762ed10f4d | C++ | chuckcranor/frontlevel | /src/include/frontlevel/backend.h | UTF-8 | 3,021 | 2.703125 | 3 | [
"BSD-3-Clause"
] | permissive | #ifndef STORAGE_FRONTLEVEL_INCLUDE_BACKEND_H_
#define STORAGE_FRONTLEVEL_INCLUDE_BACKEND_H_
#include <string>
namespace frontlevel {
class WriteBatch;
/*
* frontlevel users create their backing store using their favorite
* key/value system. then they wrap it up in a Backend object and
* pass that to frontlevel... | true |
2adcd34f804832f22c2831b6831c635380dc6f07 | C++ | Quentin-Anthony/5800_Holography | /SuperHolo/cube.cpp | UTF-8 | 4,462 | 2.828125 | 3 | [] | no_license | #include "cube.h"
#include <cmath>
#include <ruined_math/matrix.h>
#include <GLFW/glfw3.h>
#include "dmd.h"
#define CUBE_DEPTH 0.25f
#define CUBE_X (PATTERN_WIDTH * 0.5f)
#define CUBE_Y (PATTERN_HEIGHT * 0.5f)
#define TWO_PI 6.28318530718f
#define CUBE_EDGES 12
void fillPoints(Ruined:... | true |
08fd2310879c574eba26f7880c7f6e4c6e6d3f45 | C++ | Winterpuma/bmstu_OOP | /lab2/my_errors.h | UTF-8 | 2,343 | 3.171875 | 3 | [
"MIT"
] | permissive | #ifndef _errors_h
#define _errors_h
#include <exception>
#include <string.h>
class baseError : public std::exception
{
public:
baseError(std::string filename, std::string classname, int line, const char *time,
std::string info = "Error")
{
err_info = "\nFile name: " + filename + "\nClass... | true |
ea5524efffd52438a1e5125fd969e0bd702ff7db | C++ | MayankTripathi01/programs | /prime_recursion.cpp | UTF-8 | 448 | 2.703125 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
int rec(int,int);
int main()
{
int n;
printf("Enter a value: ");
scanf("%d",&n);
rec(n,2);
}
int rec(int x, int y){
int i;
if(x<y)
exit(0);
else{
if(x%y==0){
if(y+1>x&&y!=x)
printf(" %d",y);
else
printf(" %d x",y);
x=x/y;
rec(x,y);
}... | true |
949449b8cf666a9eac0adf6af85da54804b0df5f | C++ | HiQiang/CPP-Note | /引用/引用作为函数的返回值.cpp | UTF-8 | 559 | 3.640625 | 4 | [] | no_license | #include <iostream>
using namespace std;
//1.不要返回局部变量的引用
/*
int& test01() {
int a = 10;
return a;
}
*/
//2.函数的调用可以作为左值
int& test02()
{
static int a = 10;//静态变量,存放在全局区,全局区上的数据在程序结束后由系统释放
return a;
}
int main()
{
//引用做函数的返回值
int& ref2 = test02();
cout << ref2 << endl;
cout << ref2 <... | true |
5a37ca3e8e975c86c988e1aaaaa6a74c3fc6b795 | C++ | mpgarate/pedometer-shirt | /pedometer_shirt.ino | UTF-8 | 3,576 | 3.078125 | 3 | [] | no_license | #include <Adafruit_NeoPixel.h>
const int pedometerPin = 9;
const int neoPin = 6;
// number of LEDs in the strip
const int ledCount = 10;
// neopixel LED series
Adafruit_NeoPixel strip = Adafruit_NeoPixel(ledCount, neoPin, NEO_GRB + NEO_KHZ800);
// total number of steps counted today
int steps = 0;
// desired step... | true |
56874ffb5c1293c020c2521bd2732554a06af5ff | C++ | toberole/cdemo | /demo/TraceNew.h | UTF-8 | 1,909 | 3.296875 | 3 | [] | no_license | #ifndef PROJECT_TRACENEW_H
#define PROJECT_TRACENEW_H
// 通过重载 new/delete 来检测内存泄漏的简易实现
using namespace std;
class TraceNew {
public:
class TraceInfo {
private:
const char *file;
size_t line;
public:
TraceInfo();
TraceInfo(const char *File, size_t Line);
~TraceInfo(... | true |
bd52f70c8a86e8df4ba04ea335ca287fbe881cba | C++ | Daniel-M/BioTools | /muskin/include/numberStrings.hpp | UTF-8 | 298 | 2.84375 | 3 | [] | no_license | //#include "headers.hpp"
template <typename T>
std::string NumberToString ( T Number )
{
std::ostringstream ss;
ss << Number;
return ss.str();
}
template <typename T>
T StringToNumber ( const std::string &Text )
{
std::istringstream ss(Text);
T result;
return ss >> result ? result : 0;
}
| true |
030580814bf141639b2978d657980527bfa8e7bb | C++ | hdamron17/CSCE240 | /04hw/test/test_quad_rotor.cc | UTF-8 | 5,548 | 2.875 | 3 | [] | no_license | /* Copyright */
#include <cstdlib>
// using atoi
#include <iostream>
using std::cout;
using std::endl;
#include <string>
#include "quad_rotor.h" // NOLINT(build/include_subdir)
#include "point.h" // NOLINT(build/include_subdir)
bool TestCreateQuadRotor() {
std::cout << "\tTestCreateQuadRotor" << std::endl;
csc... | true |
4f9cef025829eb28b4b95462b8a7179a49dce3f9 | C++ | acton393/incubator-weex | /weex_core/Source/include/JavaScriptCore/bytecode/ExpressionRangeInfo.h | UTF-8 | 3,404 | 2.515625 | 3 | [
"Apache-2.0",
"MIT",
"BSD-3-Clause"
] | permissive | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | true |
97c8e39d584e48a3e10f5d62c10ddfb9d777f65b | C++ | alivcor/leetcode | /561. array-partition/main.cpp | UTF-8 | 1,093 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include "vector"
using namespace std;
class Solution {
public:
int arrayPairSum(vector<int>& nums) {
int maxSum = 0;
int holder = 0;
std::sort(nums.begin(), nums.end());
std::reverse(nums.begin(),nums.end());
std::vector<int> pairs;
bool insFlag ... | true |
49f0c1fb9963a6bec2db110fdcc15beb15c0fd75 | C++ | heftyy/simple-qt-chat | /src/chatlib/communication/MessageSerializer.h | UTF-8 | 578 | 2.9375 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <memory>
#include <string>
namespace SimpleChat {
class AbstractMessage;
/*!
* MessageSerializer holds the AbstractMessage interface.
* You can use serialize() method multiple times.
*/
class MessageSerializer {
public:
explicit MessageSerializer(std::unique_ptr<AbstractMessage> abstrac... | true |
322ddb105a599cae7d88c7bf1ac3035a85897ddb | C++ | jasong-ovo/JiShiShuaTi | /Sort/3_4OlympicSort.cpp | UTF-8 | 5,273 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
void dump(float*p, int N);
struct country
{
int goldenMedal, medal, rank, way, idx;
float population;
country(){
idx = 0;
goldenMedal = 0;
medal = 0;
population = 0;
rank = 100;
... | true |
08ddc482a4e2606c7aeef5afac357a508346c006 | C++ | Mooophy/159302 | /A2/nodes.cpp | UTF-8 | 1,652 | 2.984375 | 3 | [
"MIT"
] | permissive | #include "nodes.h"
#include <cmath>
using namespace std;
int Node::calcManhattanDistance(int xG, int yG){
return (abs(x-xG) + abs(y-yG));
}
void Node::updateHCost(heuristicFunction hFunction, int xG, int yG){
hCost = h(hFunction, xG, yG);
}
void Node::updateFCost(){
fCost = hCost + pathLength;
}
int Node::... | true |
15fb1d23b00070ee44e82b1c7bfaccab5a4d4fc4 | C++ | AsheeshKumar34/Hackerrank | /Data-Structures/Linked Lists/Insert a node at the tail of a Linked List.cpp | UTF-8 | 468 | 3.71875 | 4 | [] | no_license | /*
Insert Node at the end of a linked list
head pointer input could be NULL as well for empty list
Node is defined as
struct Node
{
int data;
struct Node *next;
}
*/
Node* Insert(Node *head,int data)
{
Node *ptr= new Node;
ptr->data=data;
ptr->next=NULL;
if (head==NULL)
hea... | true |
28a1007623793588d74f687cf506efd8e72b0507 | C++ | awasae/File-Sharing-System | /SharedCode/TextFile.cpp | UTF-8 | 1,124 | 2.828125 | 3 | [] | no_license | // Define the TextFile class here
#include "TextFile.h"
#include <algorithm>
#include <iostream>
#include <fstream>
#include <vector>
#include <deque>
#include <sstream>
#include <string>
#include "AbstractFileVisitor.h"
class AbstractFileVisitor;
using namespace std;
TextFile::TextFile(std::string fileName) {
this... | true |
4ba76bd65cd1f5b255fd26922fed4ae79375bade | C++ | jubeemer/iess_robotprogramming | /pid_control_drive/main.cpp | UTF-8 | 1,251 | 2.5625 | 3 | [] | no_license | #include "mbed.h"
#include "m3pi_ng.h"
#include "PIDLineFollower.h"
#include "RaceTracker.h"
m3pi robot;
Timer timer;
DigitalIn mypin(p21, PullUp);
const float dt = .008;
const int BLACK_TOLERANCE = 100;
const int WHITE_TOLERANCE = 400;
int main() {
robot.cls();
robot.sensor_auto_calibrate();
PIDLin... | true |
2a09e5a8e826ab00200b6ffcf92858ac9b73b96f | C++ | dave-msk/calculator-cpp | /third_party/fsm/state.h | UTF-8 | 1,717 | 3.515625 | 4 | [] | no_license | #ifndef FSM_CORE_STATE_H
#define FSM_CORE_STATE_H
#include <map>
#include <sstream>
#include "exceptions.h"
namespace fsm {
template <typename K, typename T>
class State {
private:
std::map<T, K> tr_map_;
K id_;
bool is_terminal_ = false;
public:
State() = default;
explicit State(const K &id) : id_(id) {}... | true |
e4572902fb7ef38a8e68394c7ba170674d2f4417 | C++ | thenohatcat/Angler | /Angler/DrawNode.cpp | UTF-8 | 1,343 | 2.6875 | 3 | [] | no_license | //Version: 0.1.12
//Author: Jakob Pipping
//Contributors:
#ifndef ANGLER_0_1_12
#error DrawNode.cpp: Wrong Version 0.1.12
#endif
#include "DrawNode.h"
using namespace Angler;
using namespace Angler::Nodes;
DrawNode::DrawNode(unsigned long id, Node *parent, int layer, float ox, float oy)
: Node(id, parent), mLayer(... | true |
9b24296d9203084bb6cf2f9c209d21e398f6d23b | C++ | allpasscool/leetcodes | /leetcode1177/leetcode1177_1.cpp | UTF-8 | 1,303 | 2.96875 | 3 | [] | no_license | class Solution {
public:
vector<bool> canMakePaliQueries(string s, vector<vector<int>>& queries) {
int n = queries.size();
vector<bool> output;
vector<vector<int>> alpha_count(s.size(), vector<int> (26, 0));
vector<int> tmp(26, 0);
for (int i = 0; i < s.size(); i++) ... | true |
8631237deb3d96eb5862b8f9446f3dc8a8caf163 | C++ | Ivanf1/learning-ATmega328P | /projects/blink-timer/main.cpp | UTF-8 | 434 | 2.53125 | 3 | [] | no_license | #include <Arduino.h>
// interrupt vector handler when timer overflows
ISR(TIMER1_OVF_vect) {
// toggle pin 2
PIND = (1 << PIND2);
}
void setup() {
// set pin 2 as output
DDRD = (1 << DDD2);
// not using anything from this register
TCCR1A = 0;
// count every 256 cycles
// roughly every 1 second
TCC... | true |
062ee4bccbd0b22554652be16bb567437d508690 | C++ | kitech/mwget | /ksocket.h | WINDOWS-1252 | 4,170 | 2.59375 | 3 | [] | no_license | #ifndef _KSOCKET_H_
#define _KSOCKET_H_
/**
* created by icephoton drswinghead@163.com 2005-8-5
*/
#include <iostream>
#include <sys/socket.h>
class KSocket{
public:
//=
// Constructor
//=
KSocket(int pFamily = PF_INET, int pType = SOCK_STREAM , int pProtocal = 0);
//=
// De... | true |
e2382ebdc97d9e7cadabc75fa6d55fc5ccf6dc2b | C++ | tkubicz/ngengine | /source/include/NGE/Geometry/Basic/Floor.hpp | UTF-8 | 2,443 | 3.015625 | 3 | [] | no_license | /*
* File: Floor.hpp
* Author: tku
*
* Created on 7 maj 2013, 16:19
*/
#ifndef FLOOR_HPP
#define FLOOR_HPP
#include "NGE/Geometry/Basic/Basic.hpp"
#include "NGE/Media/Shaders/GLSLProgram.hpp"
namespace NGE {
namespace Geometry {
namespace Basic {
class Floor : public Basic {
public:
Floor();
... | true |
dd0ab76072d9e4f290984997a91a24eb8e84d2ca | C++ | mrdaa/tugasakhirlagi | /cal.ino | UTF-8 | 5,224 | 2.609375 | 3 | [] | no_license | #include <DHT.h>
#include <ESP8266WiFi.h>
#include <SocketIoClient.h>
#include <EEPROM.h>
#include <GravityTDS.h>
SocketIoClient socket;
//Setup Global Variable
String id = "1471984882";
bool IsConnect = false;
//define your sensors here
#define DHTTYPE DHT11
#define dhtPin D2
#define relay1 D3
#define relay2 D4
... | true |
0d1aef8141e9043ed5d057332a27b0f815cd2e7c | C++ | inf-eth/i02-0491-projects | /example-code/examples/VLI/VLI.cpp | UTF-8 | 11,863 | 3.1875 | 3 | [] | no_license | #include "VLI.h"
#include <string>
using std::string;
CVLI::CVLI (): Sign(0)
{
}
CVLI::CVLI (bool pSign, vector<short> &pNumber): Sign(pSign), Number(pNumber)
{
Format ();
}
void CVLI::Format ()
{
// Remove any preceding zeros.
for (int i=Number.size()-1; i > 0; i--)
{
if (Number[i] == 0)
... | true |
b71d37736f19c509b55d0a621b36ac6fb67fa703 | C++ | MoriokaReimen/PreyPredator | /Test/test_Utility.cpp | UTF-8 | 2,561 | 2.96875 | 3 | [] | no_license | #include <gtest/gtest.h>
#include <eigen3/Eigen/Geometry>
#include "Utility.hpp"
TEST(Utility, test_calcAngle)
{
{
Eigen::Vector2d self{1.0, 1.0};
Eigen::Vector2d other(1.0, 2.0);
double angle = calcAngle(self, other);
EXPECT_NEAR(angle, 0.0, 1E-6);
}
{
Eigen::Vector... | true |
6eec619c56d6b2af3386588d676cb2d5b9e2c889 | C++ | wangshaohua/py2cpp | /lib/iter.hpp | UTF-8 | 131 | 2.546875 | 3 | [] | no_license | #ifndef _ITER_HPP_
#define _ITER_HPP_
template<class BaseType>
class Iter{
public:
virtual BaseType next() = 0;
};
#endif
| true |
f649527b7aa51009faa5cb376fefe72954caf2b8 | C++ | adityanjr/code-DS-ALGO | /CodeForces/Complete/1100-1199/1157E-MinimumArray.cpp | UTF-8 | 556 | 2.578125 | 3 | [
"MIT"
] | permissive | #include <cstdio>
#include <vector>
#include <set>
#include <algorithm>
int main(){
long n; scanf("%ld", &n);
std::vector<long> a(n); for(long p = 0; p < n; p++){scanf("%ld", &a[p]);}
std::multiset<long> s; for(long p = 0; p < n; p++){long x; scanf("%ld", &x); s.insert(x);}
for(long p = 0; p < n; p++... | true |
a6f9efecda72903d9814cff2b0c1b49d1fdc0fed | C++ | Seoui/Algorithm | /백준/1233_주사위.cpp | UTF-8 | 449 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
vector<int> sumSet(81);
int a, b, c;
cin >> a >> b >> c;
for (int i = 1; i <= a; ++i)
for (int j = 1; j <= b; ++j)
for (int k = 1; k <= c; ++k... | true |
8d610a2e99cc893af0f7f98140b7a3caaa1275d3 | C++ | FeiCoding/Coursera_Cpp | /C++ Programming Design/week10/part9.cpp | UTF-8 | 1,063 | 3.3125 | 3 | [] | no_license | #include <iostream>
#include <set>
#include <iterator>
#include <algorithm>
using namespace std;
// 在此处补充你的代码
class A{
public:
char type;
int age;
A(int a):age(a){
type = 'A';
}
};
class B: public A{
public:
B(int a):A(a){
type = 'B';
}
};
struct Comp{
bool operato... | true |
ed595ae0595733ec78c3dcd25d6971b879b78b65 | C++ | ZackBleus/ByondHook | /ByondHook/extools/socket/socket.h | UTF-8 | 2,198 | 2.625 | 3 | [
"MIT"
] | permissive | #pragma once
#include "../core.h"
#include "../../third_party/json.hpp"
#include <string>
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
#pragma comment (lib, "Ws2_32")
#else
#include <sys/socket.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <netdb.h> /* Needed for getaddr... | true |
8bbe5ffcb5d5c912c70ee1a71587d5092abbdf78 | C++ | birgersp/df-jobsounds | /src/Arg_parser.h | UTF-8 | 768 | 2.796875 | 3 | [] | no_license | /**
* @author birgersp
* https://github.com/birgersp
*/
#pragma once
#include <functional>
#include <cpputil/core.hpp>
#include <cpputil/Map.hpp>
using Command_callback = std::function<void() >;
using Setting_callback = std::function<void(String_ref) >;
class Arg_parser
{
public:
struct Command
{
Command_ca... | true |
0b4f66c84738f084a1c653c68a1d2b5e36a60f54 | C++ | ebinsaad/CS60_254 | /code/stacks/stacks_with_lists/stack.cpp | UTF-8 | 1,320 | 3.421875 | 3 | [] | no_license | //
// Created by ebinsaad on 20/09/17.
//
#include "stack.h"
#include <stdlib.h>
void InitiateStack(Stack *ptrStack){
ptrStack->top = nullptr;
}
void Push(StackElement e, Stack *ptrStack){
StackNode * node = (StackNode*)malloc(sizeof(StackNode));
node->element =e;
node->next = ptrStack->top;
... | true |
475f7754ffe928fe8a1ff6694a7271a6c5f6f680 | C++ | dongdong97/TIL | /C++ ESPRESSO/CH 05/CH 05/car3.cpp | UTF-8 | 1,109 | 3.296875 | 3 | [
"MIT"
] | permissive | ////
//// car3.cpp
//// CH 05
////
//// Created by 동균 on 2018. 5. 24..
//// Copyright © 2018년 동균. All rights reserved.
////
//
//#include <iostream>
//#include <string>
//using namespace std;
//
//class Car{
//private:
// int speed;
// int gear;
// string color;
//public:
// //접근자 선언
// int getSpeed(... | true |
2f943e764b74c5d8c7aa71e5f8c8df01ed5e6241 | C++ | lijianmin01/CplusplusStudy | /1~5单元/vectorClass/StackOfIntegers.h | UTF-8 | 191 | 3.046875 | 3 | [] | no_license | #pragma once
class StackOfIntegers {
private:
int elements[100];
int size{ 0 };
public:
StackOfIntegers();
bool empty();
int peek();
void push(int value);
int pop();
int getSize();
}; | true |
3dabd6f585713fb94a9129c38e5d17eac7801910 | C++ | khoihd/dcop_generator_pdcdcop | /include/Kernel/variable.hpp | UTF-8 | 1,602 | 3.328125 | 3 | [] | no_license | #ifndef DCOP_GENERATOR_KERNEL_VARIABLE_HPP
#define DCOP_GENERATOR_KERNEL_VARIABLE_HPP
#include <string>
#include <memory>
namespace dcop_generator {
class variable {
public:
typedef std::shared_ptr<variable> ptr;
variable(int id, std::string name, std::string domain, std::string agent)
... | true |
25279e0553855e24bc9a9abdbf8f822292553fc3 | C++ | zha0ming1e/3D_Point_Cloud_Processing | /ch1/src/voxelgridfilter.cpp | UTF-8 | 4,741 | 2.890625 | 3 | [] | no_license | #include "voxelgridfilter.h"
VoxelGridFilter::VoxelGridFilter(const PointCloud::Ptr &origin_pointcloud_ptr,
Vec3 voxel_grid_size,
VoxelGridFilter::ALGO algorithm)
: origin_pointcloud_ptr_(origin_pointcloud_ptr),
... | true |
12a11abf4f5b0607f53f9f3f700b129346ae7cf7 | C++ | onww1/Problem-Solving | /BOJ/Stack/boj1406_에디터.cpp | UTF-8 | 1,453 | 3.5 | 4 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
struct list {
char c;
list *prev, *next;
list(): c(0), prev(nullptr), next(nullptr){}
list(char _c): c(_c), prev(nullptr), next(nullptr){}
};
void printList(list *head) {
list *ptr = head;
while (ptr->c != 0) {
cout << ptr->c;
ptr = ptr->next;
}
... | true |
8be4af5cc028ac0f238a40edf35fd2b52b43b4dc | C++ | zerkaner/ALU | /Code/Agents/Agent.h | UTF-8 | 1,275 | 2.734375 | 3 | [] | no_license | #pragma once
class IAgentLogic;
class PerceptionUnit;
class World;
/** The abstract agent. This is the most generic agent form, it specifies the main execution
* cycle (SRA) and several extension points available for specialized agent implementations. */
class Agent {
private:
World* _world; // Execution ... | true |
90dbaf69827e6a33446c09d0885d9ff2509c2350 | C++ | sunshinenny/Data-structure-study | /数据结构/C++与C的区别/练习2.cpp | UTF-8 | 174 | 2.96875 | 3 | [] | no_license | #include<iostream>
using namespace std;
void Input(int &x)
{
cin>>x;
}
int main()
{
int x;
cout<<"Input x:";
Input(x);
cout<<"x="<<x<<endl;
return 0;
}
| true |
162c76e48169703fe2d9ad15f10d3167325c4ffe | C++ | BoyanHou/Threading-and-Work-Distribution-Strategies-Server-Performance-and-Scalability-Study | /Client/client_main.cpp | UTF-8 | 3,136 | 3.171875 | 3 | [] | no_license | #include <assert.h>
#include <string>
#include "../Tools/String_Tools_Exceptions.h"
#include "Client.h"
void run_client_single(Client & client) {
//Read request from cmd line
std::string request;
std::getline(std::cin, request);
// //Split the request
// std::vector<std::string> to_send = String_Tools::sp... | true |
40ef24b1f9ccbec07d57da1d0ae406aa609369f0 | C++ | hugues-vincent/uva | /893-Y3K_problem/main.cpp | UTF-8 | 993 | 2.875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int day[] = {31, -1, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int year_length(int y) { return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0) ? 366 : 365; }
int month_length(int m, int y) {
if (m == 1) return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0) ? 29 : 28;
return... | true |
4b01b4e2eea81aa784beb8d2e8540377e3f37446 | C++ | vastamat/BGE | /bge/include/events/Event.h | UTF-8 | 1,991 | 3.203125 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include "core/Common.h"
#include <functional>
namespace bge
{
/**
* All existing event types
*/
enum class EventType
{
None = 0,
WindowClose,
WindowResize,
WindowFocus,
WindowLostFocus,
WindowMoved,
KeyPressed,
KeyReleased,
KeyTyped,
MouseButtonPressed,
MouseButtonReleased,
M... | true |
47c4c2301cbe6c9cecce28559b27d70dc1209e9e | C++ | ro9n/lc | /162.find.peak.elem.cpp | UTF-8 | 456 | 3.09375 | 3 | [] | no_license | /**
* @file 162.find.peak.elem
* @author Touhid Alam <taz.touhid@gmail.com>
*
* @date Sunday September 06 CURRENT_YEAR
*
* @brief
*/
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int findPeakElement(vector<int>& v) {
int n = v.size(), l = 0, r = n - 1;
while(l < ... | true |
0a477e621c5690959b440c772eeb4690dac3ab9b | C++ | mguc/arts | /test/TestWallEstimator.cpp | UTF-8 | 1,926 | 2.59375 | 3 | [
"BSD-3-Clause"
] | permissive | #include "arts/estimator/LocationEstimator.hpp"
#include "arts/Path.hpp"
#include "arts/Simulation.hpp"
#include "catch2/catch.hpp"
#include <math.h>
using namespace arts;
using namespace std;
#define REFERENCE_ROOM "rsc/environment/4x5x3room.obj"
#define SIMULATION_TIME_S 0.1
#define DISTANCE_M 0.1
doub... | true |