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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
31abcb80949ad5e187552c701810e4754035ffd3 | C++ | miro-balaz/tctl | /solutions/RotatingBot.cpp | UTF-8 | 4,114 | 2.828125 | 3 | [] | no_license | //{{{b
//}}}e
#line 5 "RotatingBot.cpp"
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <set>
#include <cctype>
#include <sstream>
#include <bitset>
#include <iostream>
using namespace std;
#define REP(i,n) for(int i=0;i<(int)n;++i)
class RotatingBot {
public:
/... | true |
9624c21b4c600be9234040805107cef4ba8205dd | C++ | volecilevo/Proje2_4.Proje | /Util.h | UTF-8 | 3,333 | 2.734375 | 3 | [] | no_license | //
// Util.h
// Ders 7
//
// Created by Gurel Erceis on 4/15/13.
// Copyright (c) 2013 Yogurt3D. All rights reserved.
//
#ifndef Ders_7_Util_h
#define Ders_7_Util_h
#ifdef _WIN32
#include <GL/glew.h>
#include <GL/gl.h>
#else if __APPLE__
#include <OpenGL/gl.h>
#endif
#include <fstream>
#define fmax(a,b) (a>b)?a:b... | true |
db952332da110b2f39fb3690816013aa1539c929 | C++ | jknight1725/yahtzee17 | /include/scoreSheet.h | UTF-8 | 916 | 3.15625 | 3 | [] | no_license | #include <array>
#include <iostream>
#pragma once
/// Array of 15 <int/bool> pairs corresponding to different yahtzee scores.
/// bool indicates if the score sheet has already recorded the respective score
/// sheet can read/write/tally/print its scores
class ScoreSheet final
{
public:
ScoreSheet() noexcept { ... | true |
b9c4f21938b6432b9568fae4015f1e45d0ad59e5 | C++ | sedihub/project_euler | /problems_001-050/euler_46.cpp | UTF-8 | 1,912 | 3.875 | 4 | [
"Apache-2.0"
] | permissive | /*
PROBLEM:
It was proposed by Christian Goldbach that every odd composite number can be written as the sum
of a prime and twice a square.
9 = 7 + 2×1^2
15 = 7 + 2×2^2
21 = 3 + 2×3^2
25 = 7 + 2×3^2
27 = 19 + 2×2^2
33 = 31 + 2×1^2
It turns out that the conject... | true |
ff3afa86d7d0df7a750e9ad188b78e234cf30483 | C++ | TanviSutar/ADS | /ADS-implememtation/graph1.cpp | UTF-8 | 2,882 | 3.421875 | 3 | [] | no_license | #include<bits/stdc++.h>
#define node1 first
#define nodelist second
#define node2 second.first
#define weight second.second
using namespace std;
template<typename T>
class Graph{
private:
map< T, vector<pair<T, int>> > edges;
public:
void addEdge(T n1, T n2, int wght, bool bidirec = 1){
... | true |
d33c5bc0fd5903c418575b0ab0dd8b4e2412e109 | C++ | ddc-iot/instructor_master | /L12_HelloParticle/L12_02_HelloNightLight/src/L12_02_HelloNightLight.cpp | UTF-8 | 1,117 | 2.59375 | 3 | [] | no_license | /******************************************************/
// THIS IS A GENERATED FILE - DO NOT EDIT //
/******************************************************/
#include "Particle.h"
#line 1 "c:/Users/IoT_Instructor/Documents/IoT/instructor_master/L12_HelloParticle/L12_02_HelloNightLight/src/L12_02_HelloNigh... | true |
f2065ce0face3a4cab2545144ddc981858607e68 | C++ | WaerjakSC/3DObligFebruary | /visualobject.cpp | UTF-8 | 875 | 3.03125 | 3 | [] | no_license | #include "visualobject.h"
#include <fstream>
VisualObject::VisualObject() {}
VisualObject::~VisualObject()
{
glDeleteVertexArrays(1, &mVAO);
glDeleteBuffers(1, &mVBO);
}
void VisualObject::readFile(std::string filnavn)
{
std::ifstream inn;
inn.open(filnavn.c_str());
if (inn.is_open())
{
... | true |
b7d2c91a86ff199a6847b1d608d3662aa265c702 | C++ | epled/planner | /plan.cpp | UTF-8 | 1,452 | 3.28125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <ctime>
#include <bits/stdc++.h>
using namespace std;
const string planfile = "plan.txt";
enum days {SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY};
string dayString[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday... | true |
d7cd025d091197736751cda49e4a56cd083d7087 | C++ | cwx5319019/demo1 | /C++/老师笔记/day1/6命名空间.cpp | UTF-8 | 323 | 2.5625 | 3 | [] | no_license | #include<iostream>
int main(int argc,char* argv[]){
//命名空间
{
using namespace std;
//cerr << "hello" << endl;
cout << "hello, world" << endl;
}
//都在std里面
//std::cerr << "hello" << std::endl;
std::cout << "hello ,iotek"<< std::endl;
return 0;
}
| true |
e4ea4b0b6723fc53f3b48333f1c576b052ce44c1 | C++ | ttyang/sandbox | /sandbox/SOC/2007/signals/libs/dataflow/example/signals/simple_example.cpp | UTF-8 | 1,617 | 2.796875 | 3 | [
"BSL-1.0"
] | permissive | // Copyright 2007 Stjepan Rajko.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//[ simple_example
#include <boost/dataflow/signals/component/storage.hpp>
#include <boost/dataflow/signals/component/timed_gener... | true |
f8162a3819c6662fece03a3783e1de43e11c54bb | C++ | AarneL/Chessgame | /src/headers/object.hpp | UTF-8 | 370 | 2.765625 | 3 | [] | no_license | #ifndef OBJECT_H
#define OBJECT_H
#include <SFML/Graphics.hpp>
enum ObjectState {
Normal = 0,
Highlighted = 1,
Selected = 2
};
class Object
{
public:
ObjectState getState() const;
bool isVisible() const;
virtual void setState(ObjectState state) = 0;
virtual void draw(sf::RenderWindow &window) = 0;
bool drawO... | true |
43bb05a5a1d8a2c8499b641b0419521e5a6a3106 | C++ | Synaxis/cppTrainning | /workFolder/problem1/main.cpp | UTF-8 | 708 | 3.609375 | 4 | [] | no_license | #include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <limits>
int main() {
std::string UserAge = "0"; // age is a string
std::cout << "Enter your age : \n"; // printf
getline(std::cin, UserAge); // console input and assign to UserAge
int intAge = std::... | true |
78c621e9c5f8d2d756ae11874412d25340444a39 | C++ | darren-moore/corruption | /src/src_Core/Core/math/Vector.h | UTF-8 | 4,343 | 3.65625 | 4 | [] | no_license | #pragma once
#include <array>
#include <cassert>
#include <string>
#include <sstream>
namespace math {
// <size, datatype>
template <size_t N, typename T>
class Vector {
public:
Vector() : data_{} {} // Initializes to default values, usually 0.
~Vector() = default; // Simply deletes our array of data.
Vec... | true |
55c6261883376340bffe1c3207714bcc79369be7 | C++ | Elsyrian/acmudec | /livearchive/2865.cpp | UTF-8 | 1,555 | 2.984375 | 3 | [] | no_license | #include<iostream>
/*************************************************************************************************************************
* 2865 - Bikers Trip Odometer
* http://livearchive.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=166&problem=866
*
* Classificat... | true |
b62c1e8c30e5a178d48b62ddb1ff78c36ac73f20 | C++ | xh286/leetcode | /366-Find-Leaves-of-Binary-Tree/solution.cpp | UTF-8 | 897 | 3.21875 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
private:
int processNode(TreeNode* p, vector<vector<int>>& r)
{
// return dist2leaf. For nu... | true |
5785eb54a6f3ba5515a2acfc7a89ee45b28a24c2 | C++ | accountos/LeetCodeLearning | /Array/zhanchengguo/0610-链表反转/main.cpp | UTF-8 | 2,090 | 4.3125 | 4 | [
"MIT"
] | permissive | #include <iostream>
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
ListNode *reverseList(ListNode *head);
ListNode *reverseList2(ListNode *head);
int main() {
// 双指针
ListNode *a = new ListNode(1);
ListNode *b = new ListNode(2);
ListNode *c = new Li... | true |
b5e82277d1aa712e6f195eab2bb8af783e719e9d | C++ | Givemeurcookies/Snow-drone | /processor.ino | UTF-8 | 2,237 | 3.21875 | 3 | [] | no_license | //Arduino Control
int incomingByte = 0; // for incoming serial data
int lastByte = 0;
const int pwmA = 3;
const int pwmB = 11;
const int brakeA = 9;
const int brakeB = 8;
const int dirA = 12;
const int dirB = 13;
void setup() {
// initialize the digital pin as an output:
Serial.begin(9600);
/... | true |
274e69597cbefa631f869256679eeb016cf6eb5e | C++ | p-adic/cpp | /Mathematics/Arithmetic/Mod/Function/Euler/a_Body.hpp | UTF-8 | 3,179 | 2.828125 | 3 | [
"MIT"
] | permissive | // c:/Users/user/Documents/Programming/Mathematics/Arithmetic/Mod/Function/Euler/a_Body.hpp
#pragma once
#include "a.hpp"
#include "../../../Prime/Constexpr/a_Body.hpp"
#include "../CRT/a_Body.hpp"
#include "../../../Prime/a_Body.hpp"
template <typename INT> inline INT EulerFunction( const INT& n ) { ve... | true |
f208634b28b03daf0e583e509fa3517f1f812f93 | C++ | williamliao28/SimToolbox | /MPI/MixPairInteraction.hpp | UTF-8 | 12,000 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | /**
* @file MixPairInteraction.hpp
* @author wenyan4work (wenyan4work@gmail.com)
* @brief interaction for two FDPS systems of different particle types
* @version 0.1
* @date 2019-01-10
*
* @copyright Copyright (c) 2019
*
*/
#ifndef MIXPAIRINTERACTION_HPP_
#define MIXPAIRINTERACTION_HPP_
#include "FDPS/particl... | true |
dcdfa1d370081acd4e2c325b2160515cd961a715 | C++ | RayYoh/CppPrimerPlus | /C++PrimerPlus/Ex8.5.cpp | UTF-8 | 981 | 3.796875 | 4 | [] | no_license | #include<iostream>
using namespace std;
template<typename T>
T maxn(T arr[], int n );
template<> char * maxn(char * arr[], int n);
int main()
{
int arr1[6] = { 1,2,3,4,5,6 };
double arr2[4] = { 2.1,3.2,5.4,6.5 };
int max_int = maxn(arr1,6);
double max_double = maxn(arr2,4);
cout << max_int << endl;
cout << max_d... | true |
cf9b95086e94210394d21a3124b431b131e42a4a | C++ | skyfeature/cautious-potato | /minimum Steps To One.cpp | UTF-8 | 432 | 2.984375 | 3 | [] | no_license | #include <iostream>
#include <cstring>
using namespace std;
int n, ar[100000];
int min_num_steps(int n){
ar[1] = 0;
for (int i = 2; i <= n; i++){
ar[i] = 1 + ar[i-1];
if (i%2 == 0){
ar[i] = min(ar[i], 1 + ar[i/2]);
}
if (i%3 == 0){
ar[i] = min(ar[i], 1 + ar[i/3]);
}
}
return ar[n]... | true |
4d1aec00ff7714b73b489af09b9355bc94eba099 | C++ | artintel/Learning_Project | /设计模式/designpattern/factory1.cpp | UTF-8 | 998 | 3.296875 | 3 | [] | no_license | #include <string>
// 实现导出数据的接口, 导出数据的格式包含 xml,json,文本格式txt 后面可能扩展excel格式csv
class IExport {
public:
virtual bool Export(const std::string &data) = 0;
virtual ~IExport(){}
};
class ExportXml : public IExport {
public:
virtual bool Export(const std::string &data) {
return true;
}
};
class Export... | true |
835ec9ae40ed8e37eba64e5f9a852ba92a594ded | C++ | logic-life/C-learning | /pointer/passapointertoafunction.cpp | UTF-8 | 385 | 3.375 | 3 | [] | no_license | #include <iostream>
void getSeconds(unsigned long *pair);
int main()
{
//无法使用空地址的指针变量由函数进行改变,空地址的指针指向内存空间不存在
unsigned long time_now;
getSeconds(&time_now);
std::cout << "输出当前时间:" << time_now << std::endl;
return 0;
}
void getSeconds(unsigned long *pair)
{
*pair = time(NULL);
} | true |
a7cb2a288f12079ea59238230979754fb98b71ba | C++ | gwanhyeon/algorithm_study | /beakjoon_algorithm/beakjoon_algorithm/CodingTestExam/Unix_Programming_hw1_kgh.cpp | UTF-8 | 11,702 | 3.390625 | 3 | [] | no_license | //
// Unix_Programming_hw1_kgh.cpp
// Created by kgh on 5/4/2019.
// Copyright © 2019 kgh. All rights reserved.
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <fstream>
#include <string>
#include <vector>
#include <sstream>
#include <istream>
#include <algorithm>
#include <stdlib.h> // malloc... | true |
9ccdec0af3daaf055e03d51359a44e8442db2e44 | C++ | krishna6431/Data-Structure-Algorithms-Implementation-Using_CPP | /09_Stack/17_Paranthesis_Matching.cpp | UTF-8 | 1,473 | 3.84375 | 4 | [
"Apache-2.0"
] | permissive | //Code is Written By Krishna
//first u need to include __stack_functions_array__.cpp file
#include "__stack_functions_array__.cpp"
//Example
// ((a+b) *(c-d))
//function for checking is parenthesis is balanced ort not
int is_Balance(string exp)
{
struct stack s;
s.size = exp.size();
s.top = -1... | true |
9e5e8acec43f93d1c05d706a991ea16a30678a2c | C++ | jasonjin34/Info2_Praktikum | /Aufgabenblock_3/AktivesVO.h | UTF-8 | 823 | 2.609375 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <string>
#include <iomanip>
#include <map>
using namespace std;
extern double dGlobaleZeit;
class AktivesVO
{
public:
/*constructor and destructor*/
AktivesVO();
AktivesVO(string);
AktivesVO(string, double);
virtual ~AktivesVO();
/*rein virtual function for ostream o... | true |
bc77dbbf42f1d0c4bef86ef9133cf67f0e1faa72 | C++ | zihao-zheng/C-plus-Learn | /输入输出和文件操作.cpp/文件读写实例.cpp | UTF-8 | 1,357 | 3.359375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
using namespace std;
//从键盘输入几个学生的姓名的成绩,并以二进制文件形式保存
struct Student{
char name[20];
int score;
};
int main(){
Student s;
//写入信息
// ofstream OutFile( "students.dat",ios::out|ios::binary);
// while( cin >> s.name >> s.score )
// OutFile.write( (ch... | true |
3b4d4138d9b9a0fbcb7447d4340c01d0cfb7d1be | C++ | Dawidsoni/programming-competitions | /OI/XV/pla/Plakatowanie.cpp | UTF-8 | 498 | 2.984375 | 3 | [] | no_license | #include<iostream>
#include<stack>
using namespace std;
stack<int> stos;
int ile, szer, wys, wynik;
void dodaj(int licz) {
while(stos.top() > licz) {
wynik++;
stos.pop();
}
if(stos.top() != licz) stos.push(licz);
}
int main() {
ios_base::sync_with_stdio(false);
... | true |
a7dd0e8f303962a73b740d482733e015f1bca5cc | C++ | kevmaltz/cgDNA | /cgDNA.cc | UTF-8 | 6,130 | 2.59375 | 3 | [] | no_license | #include "Main.h"
void helpExit() {
cout << "cgDNA -p [DNA PDB]" << endl;
exit(0);
}
void parsePDB(string *pdbFilename) {
string buffer, linebuffer;
int atomid = 0;
string name;
double mass, charge, radius;
vertex crd;
vector<vertex> coordinates;
int natoms = 0;
string atomtype;
int resid = 0... | true |
70423dbe6cc7eb40d260b69459a51a5cfe157ee2 | C++ | lkuwada/CSCI60 | /smatrix/entry.h | UTF-8 | 656 | 2.96875 | 3 | [] | no_license | #ifndef ENTRY_H
#define ENTRY_H
#include <cstdlib>
#include <iostream>
struct entry
{
entry(std::size_t init_r = -1,
std::size_t init_c = -1,
double init_v = 0.0)
{
r = init_r;
c = init_c;
v = init_v;
}
std::size_t r, c;
double v;
};
std::ostream & op... | true |
ca5184cdbc4da850c294783d0524d701cfe3825f | C++ | aeparks/Movie-Store | /list.h | UTF-8 | 1,603 | 3.140625 | 3 | [
"MIT"
] | permissive | /* Aaron Parks
* Prof. Carol Zander
* CSS 343 : Winter 2010
* Lab 4v4 - MOVIE Store */
/*-- List ----------------------------------------------------------------------
* List creates and maintains a linked list of ListNodes. List will search as
* a dynamically sized container that will resize as necessary... | true |
7f61a2f781876034406c32863326142d01248869 | C++ | jlstr/practice-cpp | /DynamicProgramming/coin_change_top_down.cpp | UTF-8 | 1,194 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include <limits>
#include <map>
using namespace std;
int minimumChange(int, int*, const int, map<int, int>);
void printArray(int*, const int);
int main() {
int coins[] = { 1, 2, 3 };
const int SIZE = sizeof(coins) / sizeof(int);
map<int, int> memo;
int money = 4;
int result = minimumCh... | true |
1b021b54ebd50ec5d550c7d604d77ddad1e3866f | C++ | AdamBilchouris/Cpp---Uni-Assignemnt-1 | /distance.cpp | UTF-8 | 4,359 | 3.65625 | 4 | [] | no_license | #include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
using std::cout;
using std::cin;
using std::string;
using std::endl;
int main()
{
string tempLine;
cout << "Enter file name >> ";
string fileName;
std::getline(cin, fileName);
int lineNumber {0};
double minimumDistance {0... | true |
c47f1ac50251742f1fa7976a2d7a7c2b2961dec1 | C++ | ir0nc0w/cross-compile_for_Windows | /VS2012/vc/include/xtgmath.h | UTF-8 | 3,759 | 2.625 | 3 | [] | no_license | /* xtgmath.h internal header */
#pragma once
#ifndef _XTGMATH
#define _XTGMATH
#ifndef RC_INVOKED
#if defined(__cplusplus)
#include <xtr1common>
#pragma pack(push,_CRT_PACKING)
#pragma warning(push,3)
#pragma push_macro("new")
#undef new
_STD_BEGIN
template<class _Ty>
struct _Promote_to_float
... | true |
29c5681bc95a192e33fbbf5539b7d86f6a52a1d9 | C++ | harveylabis/SamsTeachCplusplus | /Lesson21_FunctionObjects/L21_4_UnaryPredicateUsage_find.cpp | UTF-8 | 1,008 | 4.0625 | 4 | [] | no_license | #include <algorithm>
#include <vector>
#include <iostream>
template <typename numberType>
struct IsMultiple{
numberType Divisor;
IsMultiple(const numberType &divisor){
Divisor = divisor;
}
bool operator()(const numberType &element){
return ((element % Divisor) == 0);
}
};
int... | true |
49dd11b84ef1538a0ddeb64a5ec621d4001cdfd2 | C++ | chunnoo/viz | /include/vector.hpp | UTF-8 | 3,443 | 3.453125 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <cmath>
#include <array>
template<unsigned int N>
class Vector {
private:
std::array<float, N> m_values;
public:
Vector();
Vector(const std::array<float, N> &values);
Vector<N> copy() const;
void set(const unsigned int i, const float v);
float ... | true |
e838f35c35b37c8a4b4f7f3b19e25311a4afa47c | C++ | Masters-Akt/CS_codes | /leetcode_sol/221-Maximal_Square.cpp | UTF-8 | 511 | 2.59375 | 3 | [] | no_license | class Solution {
public:
int maximalSquare(vector<vector<char>>& matrix) {
int ans = 0;
vector<vector<int>> dp(matrix.size()+1, vector<int>(matrix[0].size()+1, 0));
for(int i=1;i<dp.size();i++){
for(int j=1;j<dp[i].size();j++){
if(matrix[i-1][j-1]=='1'){
... | true |
c9bf7922d9cceac1b4629b6501709e25391e9f12 | C++ | Cyvid7-Darus10/Algorithms | /Hanoi_Recursion.cpp | UTF-8 | 931 | 3.53125 | 4 | [] | no_license | #include <iostream>
#include <stack>
/* Classic Hanoi tower problem
Using stacks to represent each tower
*/
using st = std::stack<int>;
struct augmentedStack {
st stack;
std::string name;
};
using as = augmentedStack;
void transferDisk(as& from, as& to) {
to.stack.push(from.stack.top());
std::cout << "Movin... | true |
2738f725a7ba34161916e2de921b09fb9902a12b | C++ | Leo8D/Leo-Kroll | /Bonus 5/main.cpp | UTF-8 | 1,653 | 3.21875 | 3 | [] | no_license | #include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main() {
int tot, bet, en = 0, fem = 0, tio = 0, femtio = 0, hundra = 0, femhundra = 0, tusen = 0, vexel, tjugo = 0;
cout << "Totala konstaden" << endl;
cin >... | true |
e0fbd52b102ddc9546451cccce81e6268bf5e881 | C++ | tlahoda/Particles | /ConnectionModel.h | UTF-8 | 2,658 | 2.5625 | 3 | [
"MIT"
] | permissive | /**
* \file ConnectionModel.h, Contains the ConnectionModel class.
*
* Copyright (C) 2005 Thomas P. Lahoda
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, includ... | true |
7a27e65e7f15d4e26d1a821e30256104cebcea5f | C++ | melizalab/jill | /jill/dsp/triggered_data_writer.cc | UTF-8 | 5,819 | 2.578125 | 3 | [] | no_license | #include <boost/type_traits/make_signed.hpp>
#include "triggered_data_writer.hh"
#include "../types.hh"
#include "../logging.hh"
#include "../midi.hh"
#include "../dsp/block_ringbuffer.hh"
using namespace std;
using namespace jill;
using namespace jill::dsp;
/** A data type for comparing differences between frame co... | true |
311cf0a6d9fe7e99add2c127f67cfa7146b93b63 | C++ | adamelha/advanced-programming | /Battleship/Battleship/smartAlgo.cpp | UTF-8 | 2,520 | 3.0625 | 3 | [] | no_license | #include "smartAlgo.h"
#define isPointOnBoard(i , j) ( i < arrSize && i > -1 && j < arrSize && j > -1 )
//enum { up = 0, right = 1, buttom = 2, left = 3 };
Point smartAlgo::getNextPotentialPoint()
{
return Point();
}
Point * smartAlgo::potentialLegalMoves()
{
return nullptr;
}
int smartAlgo::getPotentialMovesSi... | true |
52f1cdfa74ea2e15a5959761df26c9515dd7d92f | C++ | cuongnh28/DSAFall2019 | /Test3/sxepStruct.cpp | UTF-8 | 349 | 2.828125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
struct Mau{
char c;
int dem;
};
bool cmp(Mau a, Mau b){
return (a.dem>b.dem);
}
int main(){
Mau m[100];
int n;
cin>>n;
for(int i=0;i<n;i++){
cin>>m[i].c>>m[i].dem;
}
sort(m,m+n,cmp);
for(int i=0;i<n;i++){
cout<<m[i].c<<... | true |
a24bef5c63dff9169e9a473272ef7f044bd78751 | C++ | nhatduong01/Assignment-2-semeter-201 | /treeLib.h | UTF-8 | 9,092 | 3.578125 | 4 | [] | no_license | #include <iostream>
#include <utility>
#include <functional>
template <typename T>
class BSTree
{
protected:
struct Node
{
T data;
Node *pLeft, *pRight;
Node(const T &a, Node *pL = nullptr, Node *pR = nullptr) : data(a), pLeft(pL), pRight(pR) {}
Node(const T &&a, Node *pL = nullp... | true |
070d3ff678fcd7253abf98bf8abcff54c017c8f9 | C++ | StevenRincon24/Library | /main.cpp | UTF-8 | 2,707 | 3.234375 | 3 | [] | no_license | //
// Created by Steven on 22/11/2020.
//
#include <iostream>
#include "Author.h"
#include "Book.h"
#include "ServiceLibrary.h"
using namespace std;
ServiceLibrary* library = new ServiceLibrary();
void addAuthor() {
string idAuthor , nationality;
string name;
cout<<"Author Id "<<endl;
cin>>idAuthor;
... | true |
3225fe13fed8de76094a90358fc13d391cf349b7 | C++ | liqiyang1908/LintCode | /610_Two_Sum_Difference_Equals_To_Target.cpp | UTF-8 | 1,672 | 3.328125 | 3 | [] | no_license | class Solution {
public:
/**
* @param nums: an array of Integer
* @param target: an integer
* @return: [num1, num2] (num1 < num2)
*/
vector<int> twoSum7(vector<int>& nums, int target) {
vector<int>res;
if (nums.size() < 2)
return res;
unordered_... | true |
1b197d552a273591168125bd39b5397de5d1142b | C++ | nikhilYadala/blurt | /blurt_cpp_80211/fft.cc | UTF-8 | 3,360 | 2.8125 | 3 | [
"MIT"
] | permissive | #include "fft.h"
#include <stdint.h>
#include <cmath>
#include <map>
#include <float.h>
typedef float real;
class FFT {
private:
size_t n;
bool forward;
int *rev_idx, *rev_idx_end;
complex *factors;
real scale;
inline void rev_in_place(complex *x);
public:
FFT(size_t n, bool forward);
... | true |
22675b3a72afd4fa50be513ded6ec04e4ebcc517 | C++ | chenrudan/leetcode | /WordPattern/debug.cpp | UTF-8 | 748 | 3.328125 | 3 | [] | no_license | #include<iostream>
#include<map>
#include<set>
#include<sstream>
using namespace std;
bool wordPattern(string pattern, string str){
map<char, string> pattern_str;
set<string> appeared_char;
stringstream ss(str);
string buf;
for(int i=0; i<pattern.length(); i++){
ss >> buf;
if(pattern_str.find(pattern[i]) ==... | true |
c68900cea355e967fcd664e0f36cd026b745ce08 | C++ | ishine/athena-1 | /runtime/server/x86/utils/thread_pool.h | UTF-8 | 4,453 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | // Copyright (C) 2022 ATHENA DECODER AUTHORS; Rui Yan
// All rights reserved.
//
// 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
//
// Un... | true |
f6944f49f494a2fa675a073e7e4ea2c2678b5dd2 | C++ | Ro6afF/hangman | /lib/User.cpp | UTF-8 | 6,011 | 3.25 | 3 | [
"MIT"
] | permissive | #include "User.hpp"
#include "bcrypt/BCrypt.hpp"
#include "exceptions.hpp"
#include <algorithm>
#include <cstring>
#include <fstream>
bool User::logedIn = false;
User User::user;
User::User() : User("", "", "") {}
User::User(const char *username, const char *email, const char *password) {
strcpy(this->username,... | true |
14d72bffb0360f8f98b7ad64f7fd95bf797a4707 | C++ | yanhongjuan/Algorithm | /bigNum_17.cpp | UTF-8 | 2,321 | 3.90625 | 4 | [] | no_license | /*@brief:打印1到最大的n位数,比如:输入3则打印出1,2,3......一直到999*/
/*题目没有给出n的限制,所以是大数问题,n可能无限大,采用字符串的加法求解*/
#include <iostream>
#include <string>
#include <string.h>
using namespace std;
bool Increment(char *number);
void PrintNumber(char *number);
void printToMax_1(int n)
{
if(n<=0) return;
char *number = new char[n+1];
me... | true |
9eea09f2d99500586efcc6015526eb648dc1741f | C++ | thiagofsr97/RT-Template | /perspective_camera.cpp | UTF-8 | 2,084 | 2.53125 | 3 | [
"MIT"
] | permissive | #include "perspective_camera.h"
const float PerspectiveCamera::kDegreesToRadians_ = static_cast< float >( M_PI ) / 180.0f;
PerspectiveCamera::PerspectiveCamera( void )
{ }
PerspectiveCamera::PerspectiveCamera(
const glm::ivec2 &resolution,
... | true |
4df57444a240250a4860b3665e03c9ec4375b5da | C++ | Shylie/shyll | /shyll/scanner.h | UTF-8 | 1,331 | 3.125 | 3 | [
"MIT"
] | permissive | #pragma once
#include <string>
class Token
{
public:
enum class Type
{
Long,
Double,
String,
True,
False,
Identifier,
AsLong,
AsDouble,
AsString,
Store,
Load,
Delete,
Create,
FunctionCall,
FunctionHeader,
Add,
Subtract,
Multiply,
Divide,
Exponent,
Negate,
LessThan,
L... | true |
d15446a861e796d78a50171a4a6e331fa70f1417 | C++ | amos42/TinyHan | /Lib/UTF8.cpp | UTF-8 | 1,138 | 3.09375 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include "UTF8.h"
/// <summary>
/// UTF8 문자열을 Unicode 문자열로 변환
/// </summary>
/// <param name="str">UTF8 입력 문자열</param>
/// <param name="output">Unicode 출력 문자열 버퍼</param>
/// <returns>결과 문자열 포인터</returns>
wchar_t* utf8_to_usc2(char* str, wchar_t *output)
{
unsigned char ch;
wchar_t* p = out... | true |
489f19bba47e1800daa687ec413591134faee1a8 | C++ | VolodymyrShkykavyi/cpp_piscine | /d04/ex03/Ice.cpp | UTF-8 | 700 | 3.1875 | 3 | [] | no_license | #include "Ice.hpp"
Ice::Ice(void): AMateria("ice") {
}
AMateria* Ice::clone() const {
AMateria *clone = new Ice();
return clone;
}
void Ice::use(ICharacter& target) {
AMateria::use(target);
std::cout << "* shoots an ice bolt at "<< target.getName() <<" *" << std::endl;
}
Ice& Ice::operator=(Ice const & rhs)... | true |
f37fe274cd08de5df37f903be509b198439eba7a | C++ | joemlevin/LevinJoseph_CSC17a_43950 | /Lab/AbstractBaseDerivedClass/main.cpp | UTF-8 | 649 | 3.484375 | 3 | [] | no_license | /*
* File: main.cpp
* Author: Joe
*
* Created on May 13, 2015, 12:53 PM
*/
//System Libraries
#include <iostream>
#include <cstdlib>
using namespace std;
//User Libraries
#include "BaseDeck.h"
#include "Card.h"
//Execution begins here!
int main(int argc, char** argv) {
//Declare our deck
BaseDeck de... | true |
7b1976c569ec41aa0a74b2040d7f868eab7bf0d3 | C++ | Harrypotterrrr/ShenJ-programming | /Chapter 3/3-2.cpp | GB18030 | 743 | 3.09375 | 3 | [] | no_license | /*1651574 1 */
#include <iostream>
#include <iomanip>
#include <cmath>
#define pai 2*asin(1)
using namespace std;
int main()
{
double r = 1.5, h = 3;
double roundCircum, roundSquare, sphereSquare, \
sphereVolume,cylinVolume;
roundCircum = 2 * pai*r;
roundSquare = pai * r * r;
sphereSquare = 4 * pai*r*r;
sphereV... | true |
99c2dc96c42577bad0e38d6540d96d57d0da188c | C++ | cyendra/ACM_Training_Chapter_One | /2123 An easy problem/main.cpp | UTF-8 | 594 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int n,c;
int a[10][10];
for (int i=0;i<=9;i++)
{
for (int j=0;j<=9;j++)
{
a[i][j]=i*j;
}
}
for (int i=1;i<=9;i++)
{
a[1][i]=i;
a[i][1]=i;
}
scanf("%d",&c);
... | true |
02ca8c7877ba0f9f3bf76fd7821e44f68ec3dd70 | C++ | VlShvets/Visualizer | /mainthread.cpp | UTF-8 | 5,464 | 2.75 | 3 | [] | no_license | #include "mainthread.h"
namespace Visualizer
{
/// Класс главного потока вычислений
MainThread::MainThread(Painter *_painter, Status *_status, const QString _deltaTime)
: painter(_painter), status(_status), sleepTime(_deltaTime.toInt()),
isCompleted(false), isPause(false)
{
imitation ... | true |
2a8e101131b1248a99937b75d8f9180b1fae0ee9 | C++ | andrewstevens59/HadoopSearchEngine | /DyableWebGraph/DyableClusterGraph/DyableCommand/SummaryLinks.h | UTF-8 | 11,526 | 2.6875 | 3 | [] | no_license | #include "./TestSubsumedSLinkBounds.h"
// In order to approximate the webgraph using a compressed graph,
// it's necessary to store a number of summary links for each merged
// node. A summary link is a link with high traversal probability.
// Due to the large number of links attatched to a node as a result
// of ... | true |
a172bce37306516a05ff91f83ef7f5d173297565 | C++ | IliaGodlevsky/Arena-v-2.0 | /Level/Level.h | UTF-8 | 944 | 2.90625 | 3 | [] | no_license | #ifndef LEVEL_H_
#define LEVEL_H_
#include "../Globals/Globals.h"
class Level;
using LevelPtr = std::unique_ptr<Level>;
class Level
{
public:
Level();
Level(Unit* unit);
Level(const Level&) = default;
virtual Level& operator++();
virtual void setOwner(Unit* unit)final;
virtual void setLevel(int level)final;
v... | true |
4a25c7401559cd73da8e2c2402a414f07efdfcc9 | C++ | RobotLocomotion/drake | /multibody/fem/fem_state.h | UTF-8 | 4,768 | 2.734375 | 3 | [
"BSD-3-Clause"
] | permissive | #pragma once
#include <memory>
#include <vector>
#include "drake/common/copyable_unique_ptr.h"
#include "drake/multibody/fem/fem_indexes.h"
#include "drake/multibody/fem/fem_state_system.h"
#include "drake/systems/framework/context.h"
namespace drake {
namespace multibody {
namespace fem {
/** %FemState provides ac... | true |
f63c9b1f7c655e05eb7b9c394133bb1b3ee4f150 | C++ | calumjiao/fondational-courses | /data structure/hashtable implementation/hashtable.h | UTF-8 | 3,968 | 3.515625 | 4 | [] | no_license | //----------------------------------------hashtable.h-------------------------------------
/*This file is a declearation part of the class template HashTable, which stored a hash table
by the chaining with separate list.
Programmed by: Chaolun Wang
at: 11/10/2015
*/
#ifndef HASHTABLE_H
#define HASHTA... | true |
4ba67b733314c3b146ae9c1dc92526553ed568b7 | C++ | mserafin/Excavator-Simulator | /Axis.cpp | UTF-8 | 1,090 | 2.703125 | 3 | [
"MIT"
] | permissive | #include "Axis.h"
Axis::Axis() {}
Axis::Axis(int rangeAxis, unsigned long responseDelay) {
this->rangeAxis = rangeAxis;
this->responseDelay = responseDelay;
}
void Axis::begin(int pin, void (*callback)(int value)) {
this->pin = pin;
this->onChange = callback;
pinMode(this->pin, INPUT);
}
void Axis::refres... | true |
04eca54960074ad77f69046d18a7f2b0afcc79be | C++ | FServais/SushiPP | /compiler/inference/Types.hpp | UTF-8 | 2,404 | 3.5625 | 4 | [] | no_license | #ifndef TYPES_HPP_DEFINED
#define TYPES_HPP_DEFINED
#include <string>
#include <vector>
namespace inference
{
/**
* @brief SPP types
*/
enum ShallowType
{
NO_TYPE = 0, // can be used for indicating that no type were specified
BOOL = 1,
INT = 2,
FLOAT = 4,
STRING = 8,
CHAR = 16,
ARRAY = 32,
LI... | true |
272f98ec5c450e128e2f0dfd93877f5e2b9b0c38 | C++ | faelribeiro22/BullCowGame | /Section_02/FBullCowGame.cpp | UTF-8 | 2,312 | 3.171875 | 3 | [] | no_license | #include "FBullCowGame.h"
#include <map>
#define TMap std::map
FBullCowGame::FBullCowGame()
{
Reset();
}
void FBullCowGame::Reset()
{
constexpr int32 MAX_TRIES = 8;
const FString HIDDEN_WORD = "ant";
MaxTries = MAX_TRIES;
MyHiddenWord = HIDDEN_WORD;
MyCurrentTry = 1;
setbWinGame(false);
return;
}
int32 FB... | true |
4bab08715ab54247c931e2caa3529bfa5b120529 | C++ | LuLuPan/lc1 | /spiralMatrix.cpp | UTF-8 | 1,043 | 3.046875 | 3 | [] | no_license | class Solution {
public:
vector<int> matrixOrder(vector<vector<int> > &matrix) {
vector<int> results;
if (matrix.empty()) results;
size_t beginX = 0, endX = matrix[0].size() - 1;
size_t beginY = 0, endY = matrix.size() - 1;
while (1) {
// -->
... | true |
f7404e93cb3a5f073dcfdfd87c31a26d5a7e1f64 | C++ | ridoo/IlwisCore | /ilwiscoreui/tableoperations/sortcolumn.cpp | UTF-8 | 3,437 | 2.65625 | 3 | [] | no_license | #include "kernel.h"
#include "ilwisdata.h"
#include "datadefinition.h"
#include "columndefinition.h"
#include "table.h"
#include "tablemodel.h"
#include "tableoperation.h"
#include "sortcolumn.h"
using namespace Ilwis;
using namespace Desktop;
SortColumn::SortColumn() : TableOperation("Column Sort", QUrl("SortColumn.... | true |
d0b4f66272f6a6a61f377704f5a95a344ab06ba8 | C++ | HaoYang0123/Kickstart | /Alphabet cake.cpp | UTF-8 | 2,993 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <fstream>
using namespace std;
void updateMap(char map[][27], int R, int C, int i, int j)
{
char cc[4] = {' ', ' ', ' ', ' '};
vector<pair<int, int>> pos;
pos.push_back(pair<int, int>(-1,-1));
pos.push_back(pair<int, int>(-1,-1));
pos.push_back(pair... | true |
8e995a8b8b01883129cde9cfeac55e5bb02c6b2c | C++ | rajonesiv/CS142 | /PI/piec.cpp | UTF-8 | 1,525 | 2.96875 | 3 | [] | no_license | //Andrew Jones
// This version uses broadcast and reduce (instead of send and receive)
//to compute pi. This program also uses striping.
#include<iostream>
#include<cmath>
#include "mpi.h"
using namespace std;
/*
thomas:$ module load openmpi-x86_64
thomas:$ mpicxx multihello.cpp
thomas:$ mpirun -np 5 a.out
... | true |
15eaeb8fa44bcdd3aab951fe06820172fffc8967 | C++ | dicentra13/doctpl | /doc_template/src/fields/fieldxmlconvertor.cpp | UTF-8 | 2,248 | 2.546875 | 3 | [] | no_license | #include "fieldxmlconvertor.h"
#include "field.h"
#include "../template/templatelayout.h"
#include "../xmlconvertor.h"
#include <QDomElement>
#include <QDomDocument>
#include <QDomNodeList>
#include <QString>
FieldXMLConvertor::FieldXMLConvertor(TemplateLayout *layout,
XMLConvertor *convertor)
: x_(0.0)... | true |
0bf695d8b37747c1c273697a8b2ad12b9f97dfe6 | C++ | LeeRainFish/blog_about_tech_maybe_plus_life | /cpp_skills/pointerpointer.cc | UTF-8 | 657 | 2.96875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
// const并未区分出编译期常量和运行期常量
// constexpr限定在了编译期常量
// it must be use pointer's pointer
// do not know how mush num of resutl it is
// so function arg trans a pointer which did not be allocate memory
int compute(int **ppResult,int &count){
// int *pResult;
... | true |
85e9d73d3c6aa30202d0fc158807d27021fcea79 | C++ | JayRx/Prog-Projeto2 | /BoardBuilder/ScrabbleJunior/player.h | UTF-8 | 622 | 2.96875 | 3 | [] | no_license |
#ifndef PLAYER_h
#define PLAYER_h
#include<iostream>
#include<vector>
using namespace std;
typedef unsigned long IdNum;
class Player{
public:
Player(const string &name);
void setName(const string &name);
void setScore(int score);
IdNum getId();
int getScore();
string getName();
vector<c... | true |
7e2fea99d1c0c549b2a10774f3d7f475f61f9fc8 | C++ | asritha13/crt-program | /7-12-19/largest amongst 3 numbers.cpp | UTF-8 | 324 | 3.484375 | 3 | [] | no_license | /* largest amongst three numbers*/
#include<stdio.h>
main()
{
int a,b,c;
printf("\n enter three numbers:");
scanf("%d%d%d",&a,&b,&c);
if(a==b && b==c)
printf("\n all are equal");
else if(a>b && a>c)
printf("\n a is big");
else if(b>c)
printf("\n b is big");
else
printf("\n c is big");
... | true |
c49c755c5dac47c989f12704c1b836301334d53c | C++ | yiZhuaMi/cPlusPlus | /LeetCode/DoublePointer/#763/src/main.cpp | UTF-8 | 1,507 | 3.796875 | 4 | [] | no_license | // #763. 划分字母区间
// 字符串 S 由小写字母组成。我们要把这个字符串划分为尽可能多的片段,同一个字母只
// 会出现在其中的一个片段。返回一个表示每个字符串片段的长度的列表。
// 示例 1:
// 输入:S = "ababcbacadefegdehijhklij"
// 输出:[9,7,8]
// 解释:
// 划分结果为 "ababcbaca", "defegde", "hijhklij"。
// 每个字母最多出现在一个片段中。
// 像 "ababcbacadefegde", "hijhklij" 的划分是错误的,因为划分的片段数较少。
#include <iostream>
#include <vector... | true |
d72cadd7b29a097057fb0310845db9e9bcfac5b2 | C++ | platypus999/GraphicManager | /GraphicManager.cpp | UTF-8 | 1,034 | 2.734375 | 3 | [] | no_license |
#include "GraphicManager.h"
using namespace graph_man;
GraphicManager& grm = GraphicManager::getInstance();
int GraphicManager::group()
{
return ++gr;
}
GraphicManager::GraphicManager() :gr(0),pass(""),extension(".png") {}
GraphicNode GraphicManager::load(std::string key, std::string filename)
{
int gh = LoadGr... | true |
46b82dd1062eb8e033aa0ee6dbd4c986e9d31a82 | C++ | hzqtc/zoj-solutions | /src/zoj3179.cpp | UTF-8 | 793 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
const int LineLength = 6;
int sum(int a, int b)
{
return (a + b) * (b - a + 1) / 2;
}
int main()
{
int cse;
cin >> cse;
while(cse--)
{
int x, y, n = 0;
string line;
cin >> x >> y;
for(int i = 0; i < 2; i++)
{
cin... | true |
805e7aed04e0d619c419008bd7416af2c5f64c5e | C++ | DoctorLai/ACM | /leetcode/532. K-diff Pairs in an Array/532-2.cpp | UTF-8 | 883 | 2.90625 | 3 | [] | no_license | // https://helloacm.com/how-to-find-the-k-diff-pairs-in-an-array-with-two-pointer-or-hash-map/
// https://leetcode.com/problems/k-diff-pairs-in-an-array/
class Solution {
public:
int findPairs(vector<int>& nums, int k) {
sort(begin(nums), end(nums));
int n = nums.size();
int res = 0;
... | true |
84a304e63b7d35e3bf416910a0aa2b94cbfc1acb | C++ | zjohnx3/zjohnx3 | /zj/d452.cpp | UTF-8 | 855 | 3.078125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int bubble_sort(int m,int a[]){
int tmp,a_len=m;
while (a_len>1){ //at least (m-1)times to bubble_sort
a_len--;
for (int i=1;i<=m;i++){
a[0]=a[1];
if (a[i]<a[i-1]){
tmp=a[i];
a[i]=a[i-1];
a[i-1]=tmp;
}
}
}
/*
for (int i=1;i<=m;i++){
cout<<a[i]<<... | true |
8cffe9604a868665a429114aa581b295a6bc24cd | C++ | Huy-coder/BaiTapKyThuatLapTrinh | /bai22.cpp | UTF-8 | 304 | 2.859375 | 3 | [] | no_license | #include<stdio.h>
int Tich(int n)
{
int nhan = 1;
for(int i = 1; i <= n; i++)
{
if(n % i == 0)
nhan *= i;
}
return nhan;
}
void nhap(int &n)
{
printf("nhap n : ");
scanf("%d",&n);
}
int main()
{
int n;
nhap(n);
printf("tich uoc cua n la : %d",Tich(n));
return 0;
}
| true |
15813b9952b8aa50547318c18c19708e06663b4b | C++ | lld2006/my-c---practice-project | /238/238.cpp | UTF-8 | 2,317 | 2.609375 | 3 | [] | no_license | #include <cstdio>
#include <cassert>
#include <numeric>
#include <vector>
#include <bitset>
#include "../lib/tools.h"
#include "../lib/typedef.h"
using namespace std;
vector<int> get_vector(int num)
{
vector<int> vr;
int sum = 0;
while(num){
sum = num%10;
vr.push_back(sum);
num/=10;... | true |
5fbecdcfcfc8566f643318f285233fa1c9a25239 | C++ | ChebbiL/barrier-and-look-back-options | /src/european_option.cpp | UTF-8 | 6,263 | 3.015625 | 3 | [
"Apache-2.0"
] | permissive | #include "european_option.hpp"
double european_option::stock_price_single(){
return stock_price_single(T,t);
}
double european_option::stock_price_single(double time_final, double time_inital){
return St * exp((r - 0.5*sigma*sigma) * (time_final - time_inital) + sigma * sqrt(time_final - time_inital) * get_Nr... | true |
df796215c5ec32f9fa493bd94c5cb8a6484412a6 | C++ | 15831944/arbi6 | /arbi5_runing/LogPriceStrategy.cpp | UTF-8 | 782 | 2.6875 | 3 | [] | no_license | // LogPriceStrategy.cpp: implementation of the LogPriceStrategy class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "LogPriceStrategy.h"
#include "Contract.h"
#include <iostream>
//////////////////////////////////////////////////////////////////////
// Constru... | true |
5e1d96aaf03aee07be91489f2a86a30fefb3e0a1 | C++ | MrGunerhanal/Algorithm-DataStrucure_Programming | /HackerEarth/I:O/array.cpp | UTF-8 | 663 | 3.578125 | 4 | [] | no_license | #include <iostream>
using namespace std;
// function declaration
int Insert(int* pList, int& listSize, int value);
int main () {
bool ret;
int listSize = 5;
int* pList [listSize];
ret = Insert(pList, &listSize, 1);
std::cout << ret << std::endl;
return 0;
}
bool Insert(... | true |
bf0d2fd46c648a26cd26df1a05025d44c202f4e3 | C++ | ReemHossain/Gesture-Control-Robot | /robot_code/robot_code.ino | UTF-8 | 1,559 | 3.140625 | 3 | [] | no_license | int rightMotorR = 23;
int rightMotorB = 22;
int leftMotorR = 24;
int leftMotorB = 25;
int rightMotorS = 45;
int leftMotorS = 44;
void setup() {
// put your setup code here, to run once:
pinMode(rightMotorR, OUTPUT);
pinMode(rightMotorB, OUTPUT);
pinMode(rightMotorS, OUTPUT);
pinMode(leftMotorR, O... | true |
6956d1cf37f6e1a9a4b1160c763f01d74757c6a3 | C++ | chienpm304/Data-Structure---Algorithm | /Projects/Dictionary-with-B-tree/ConsoleApplication1/ConsoleApplication1/Source.cpp | UTF-8 | 982 | 2.96875 | 3 | [] | no_license | #include <iostream>
using namespace std;
class MayLoc {
private:
float m_tgian;
protected:
virtual float congSuat();
void setTgian(float t);
public:
MayLoc();
virtual ~MayLoc(){ cout << "huy cha" << endl; };
float tinhLuongNuoc();
};
MayLoc::MayLoc() {
this->m_tgian = 0;
}
void MayLoc::setTgian(float t) {
this-... | true |
0340456403e2efad786647bcea1d7451ba93b163 | C++ | meganvanwelie/quick-imps | /comp_vision/active_contour_edge_based/characterization.cpp | UTF-8 | 3,343 | 2.78125 | 3 | [
"Unlicense"
] | permissive | #include "characterization.hpp"
vector<Point> foreground(Mat& src, int obj_id) {
vector<Point> foreground;
int row, col;
for ( row = 0; row < src.rows; ++row ) {
for ( col = 0; col < src.cols; ++col ) {
if (src.at<uchar>(row, col) == obj_id) {
Point p = Point(col, row);... | true |
84da4a0fb7931429ab990adb7ed54ba010cad2d5 | C++ | sang96qn/Node_MCU | /TimerBlynk.ino | UTF-8 | 2,075 | 2.578125 | 3 | [] | no_license | // Them chuc nang cap nhat Wifi
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
SimpleTimer timer;
const char *ssid = "viettel1234";
const char* pass = "1223334444";
char auth[] ="97adedf7831747ef8c971f8c6e5a3e6b";
#define LED 16 // GPIO 16
#define buttonPin 0
int buttonPushCounte... | true |
c1f64427c1b4c204e519a030935f384fadfb9703 | C++ | codypotter/CS300TermProject | /ServiceEntry.cpp | UTF-8 | 707 | 2.921875 | 3 | [] | no_license | //
// Created by enjoi on 11/26/2019.
//
#include "ServiceEntry.h"
/**
* Constructor for the ServiceEntry class
* @param serviceEntryRef - A reference to the json value in the directory
* @param key - the service code
*/
ServiceEntry::ServiceEntry(Json::Value &serviceEntryRef, std::string key){
name = se... | true |
e2bcae978e4e0a93b5a9597934624922445ede59 | C++ | LewisSean/SEU-compilers-project | /LR1.cpp | GB18030 | 10,900 | 2.6875 | 3 | [] | no_license | #include<vector>
#include<map>
#include<set>
#include<string>
#include<stack>
#include<vector>
#include<iostream>
#include<algorithm>
#include"LR1.h"
#include <chrono>
#include<queue>
using namespace std;
using namespace chrono;
bool Item::productionEqual(const Item& it)const {
if (it.pos == pos && ... | true |
14b0576fabb5123f8d57519409b86166b2e924ca | C++ | PapaDabrowski/-Studies-Project-Object-Orientated-Programing | /App.h | UTF-8 | 17,526 | 2.984375 | 3 | [] | no_license | //Created by PAPA Dąbrowski
#include "App.h"
#include "Handgun.h"
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <ostream>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
App_Singleton * App_Singleton::instance=0;
App_Singleton * App_Singleton::getInstance()
{
if(insta... | true |
1a757779171507f9746bcd84c6e135ea14878900 | C++ | Igincan/AUS-sem-2 | /Semestralka2/UzemnaJednotkaZucastneniVolici.cpp | UTF-8 | 664 | 2.59375 | 3 | [] | no_license | #include "KUzemnaJednotkaZucastneniVolici.h"
int KUzemnaJednotkaZucastneniVolici::operator()(UzemnaJednotka* objekt)
{
int pocetZucastnenych = 0;
zrataj(objekt, pocetZucastnenych);
return pocetZucastnenych;
}
void KUzemnaJednotkaZucastneniVolici::zrataj(UzemnaJednotka* UJ, int& pocetZucastnenych)
{
if (UJ->getTyp... | true |
ed25be4b950d8160033fe7941240722af4e7bd01 | C++ | simawn/comp345w19 | /Gas.h | UTF-8 | 352 | 3.03125 | 3 | [] | no_license | #ifndef GAS_H
#define GAS_H
#include "Resources.h"
/**Derived class from Resource to make gas resource*/
class Gas : public Resource
{
public:
/**Gas constructor calls the super to set the value.*/
Gas(int v) :Resource(v) {};
/**Sets the name of the resource to know which one it is.*/
std::string getName() { return... | true |
a77cad2f56344fe7c45e9c71ba568864b844dc20 | C++ | xtr01/spoj | /przyklad funkcji.cpp | UTF-8 | 635 | 3.203125 | 3 | [] | no_license | #include<iostream>
using namespace std;
float metry; //zmienna globalna
float ile_cali(float argument);
float ile_jardow(float argument);
int main()
{
cout << "podaj ile metrow chcesz przeliczyc na cale" << endl;
cin >> metry;
cout << "wartosc " << metry << " m po przeliczeniu na cale wynosi: " <<... | true |
a9795cdb0bfdb91890a72d47d3542c2c74d0c7e4 | C++ | gbrlas/AVSP | /CodeJamCrawler/dataset/14_7104_55.cpp | UTF-8 | 1,554 | 3.046875 | 3 | [] | no_license | import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
/**
* Created by pratyush.verma on 12/04/14.
*/
public class MagicTrick {
public static void main(String[] args) {
int T;
int index = 1;
Scanner cin = new Scanner(System.in);
T = cin.nextInt();
while... | true |
d2e3457b164ed709bbe4b70cf001b7ceb5b6e8f9 | C++ | HakureiAnna/UVA-OnlineJudge | /P755/p755.cpp | UTF-8 | 2,562 | 3.125 | 3 | [] | no_license | #include <iostream>
#include <map>
using namespace std;
string parsePhone(string phone);
int main() {
map<string, int> directory;
int n;
int numPhones;
string phone;
map<string, int>::iterator itor;
bool duplicate;
cin >> n;
cin.ignore();
getline(cin, phone);
for (int i =... | true |
734607948387a3da6516cba1dc526eeff4e2890d | C++ | HALO-04/HIT | /1004.cpp | GB18030 | 2,157 | 2.9375 | 3 | [] | no_license | #include <stdio.h>
#include <cmath>
using namespace std;
int callength(long int x){ //㳤
int count=1;
while( x=x/10 )
count++;
return count;
}
bool check(long int x){ //
for(long int i=2;i<=sqrt(x);i++)
if(x%i==0 || x==0)
return false;
return true;
}
int increase(int x[],int len){ //
int... | true |
d58b3439c4e41566529fe4bd55440fae27c17c94 | C++ | ShibaSouls/CS2 | /test files/test_ctor_charArray_in.cpp | UTF-8 | 248 | 2.9375 | 3 | [] | no_license | //test
#include "string.hpp"
#include <cassert>
#include <iostream>
int main()
{
{
String s1(10, "abc");
assert(s1.capacity() == 10);
assert(s1 == "abc");
}
std::cout << "Done testing char int ctor." << std::endl;
} | true |
869f7364aca5c6411f0c52f34e80a579e188c653 | C++ | Lordloss56/IntroToCpp | /2-variables/main.cpp | UTF-8 | 2,286 | 3.53125 | 4 | [] | no_license | #include <iostream>
int main()
{
std::cout << "its the second program!" << std::endl;
int age = 21; //my age
std::cout << "here is my age" << age << std::endl;
//prompt for users age
int userAge = -1;
std::cout << "what is your age?" << std::endl;
std::cin >> userAge;
std::cout << "Geez, your age is" << user... | true |
2dc9c7456f590ae29eb36fb5fc60226d9a767798 | C++ | gmarais/Cpp | /Pool/D03/ex00/FragTrap.cpp | UTF-8 | 8,913 | 2.578125 | 3 | [] | no_license | // ************************************************************************** //
// //
// ::: :::::::: //
// FragTrap.cpp :+: :+: :+: ... | true |