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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
3a2dd47efe37655e32c5519bbc0715e86dcb64b4 | C++ | KushRohra/GFG_Codes | /Easy/Required Rooms.cpp | UTF-8 | 309 | 2.609375 | 3 | [] | no_license | #include<iostream>
int main()
{
int t;
cin>>t;
while(t--)
{
int a,b,c,f,g,q,hcf;
cin>>a>>b;
if(a<b)
{
c=a;
a=b;
b=c;
}
c=0;
f=a;
g=b;
while(c==0)
{
q=f%g;
if(q==0)
{
hcf=g;
c=1;
}
else
{
f=g;
g=q;
}
}
cout<<(a/hcf)+(b/hcf)<<endl;
}
}
| true |
fd4f64aa2c20260548048c679565fda945976159 | C++ | Matth3wThomson/Octree | /GamingSim Entities/MeshManager.h | UTF-8 | 561 | 2.546875 | 3 | [] | no_license | #pragma once
#include "singleton.h"
#include "Mesh.h"
#include <string>
#include <map>
#define MESH_PATH "Resources\\Meshes\\"
using std::map;
using std::string;
/**
* A singleton used to represent the loading and deletion of meshes.
*/
class MeshManager :
public Singleton<MeshManager>
{
friend class Singleton<Mes... | true |
20d2389e7d6e4c9802281a76f807ef93446e05c8 | C++ | rrikhy/CS161 | /Library.h | UTF-8 | 915 | 2.5625 | 3 | [
"MIT"
] | permissive | //
// Library.h
// examples
//
// Created by Tim Alcon on 11/25/14.
// Copyright (c) 2014 Tim Alcon. All rights reserved.
//
#ifndef __examples__Library__
#define __examples__Library__
#include <vector>
#include <stdio.h>
#include <string>
using namespace std;
class Patron;
class Book;
class Library
{
private... | true |
d9f434a199c1b39ad97afa417038fca0845546df | C++ | Sergio081096/Practica2-1 | /Practica2-1/main.cpp | ISO-8859-1 | 3,604 | 2.84375 | 3 | [] | no_license | //Semestre 2018-1
//************************************************************//
//************************************************************//
//************** Alumno (s): *********************************//
//************* Cano Olguin Luis Sergio ******//
//************* Version de trabajo Visual 2012 ******//
//... | true |
96c315bd50762730a101989bb81386ccce837403 | C++ | mrjvs/42-ft_containers | /tests/_includes/multiset_test.hpp | UTF-8 | 3,876 | 2.96875 | 3 | [] | no_license | //
// Created by jelle on 4/23/2021.
//
#include "main.hpp"
#include <map>
template <class T, class PairCIt>
class multiset_tests {
private:
int num;
void compareSet(const T &list, const std::string &result) {
std::stringstream ss;
int i = 0;
for (typename T::const_iterator it = list.begin(); it != list.end(... | true |
9865d32a4644fcdec7b93c417c5c7d4608a54cee | C++ | alashworth/leetcode | /src/leetcode/0002-add-two-numbers.cpp | UTF-8 | 1,665 | 3.5625 | 4 | [] | no_license | #include <doctest/doctest.h>
#include <vector>
using namespace std;
struct ListNode {
int val;
ListNode* next;
ListNode(int x)
: val(x)
, next(nullptr)
{
}
};
ListNode* add_aux(ListNode* l1, ListNode* l2, int c)
{
if (l1 == nullptr && l2 == nullptr) {
if (c > 0) {
auto v = new ListNode(c);
return ... | true |
046f8f8b7d22d648169b968742257f593739a31a | C++ | Ripley6811/EvoGyre-CPP | /Spaceship/Tactical.h | UTF-8 | 1,159 | 3.015625 | 3 | [] | no_license | #ifndef _TACTICAL
#define _TACTICAL
#include "../Engine/Vector3.h"
#include "../EvoGyre/Weapons.h"
#include "../EvoGyre/BulletManager.h"
#include <string>
using namespace std;
/**
* Tactical management class. Weapons and shields.
*/
class Tac
{
public:
Tac();
Tac(float _hull, float _shield);
~Tac() {}
void sh... | true |
2bb25787caed273baed239a9323edd05c7010422 | C++ | nachomonllor/Hackerearth | /Moriarty and the City.cpp | UTF-8 | 826 | 2.84375 | 3 | [] | no_license |
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
int n;
scanf("%d", &n);
//int[] arr = { 1, 1, 1, 1, 1 };
int arr[n];
for(int i =0; i<n; i++) {
scanf("%d", &arr[i]);
}
long unos = 0, max_unos = 0, ceros = 0, max_ceros = 0;
for (int i = 0; i < n; ... | true |
33cceac16b5b05920d3f05d56f1408ba9adf88e0 | C++ | ajpauwels/FingerprintScanner_GT511C1R | /FingerprintModule.h | UTF-8 | 6,997 | 2.53125 | 3 | [
"MIT"
] | permissive | #ifndef FINGERPRINT_MODULE_H
#define FINGERPRINT_MODULE_H
/* Includes */
#include <Arduino.h>
/* Symbolic constants */
// Symbolically define the serial interface to easily switch between Serial (HW or SW)
#define COMMS Serial1
// The maximum number of times to re-try for a response packet before failing
... | true |
c7e52ec27ce3edaa91a48b0a9ee9c47436fb026b | C++ | shadlyd15/CSiS | /Modern_Programming/Exercises/exercise_5.cpp | UTF-8 | 272 | 2.828125 | 3 | [
"MIT"
] | permissive | /* Exercise : 5
* ID : 1943290
* Name : Shadly Salahuddin
*/
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
for (int i = 1; i < 20; ++i) {
if(i&1) {
cout << setw(i) << setfill('*') << "" << endl;
}
}
return 0;
} | true |
0248027c2944c38bafde93c58427d3cd26d9068d | C++ | Jae-Hyun-Park/Tutorial_Test | /Data structure/Stack_Head.cpp | UTF-8 | 1,891 | 3.921875 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
struct Node {
int data;
struct Node *next;
};
struct Node *top = NULL;
struct Node *stack = NULL;
int Count = -1;
void Interval() {
printf("------------------------------------\n");
}
void Push(int x) {
struct Node* temp = (struct Node*)malloc(sizeof(struct Node));
temp->... | true |
2c2ba185cf3a56076c496f50d0c30cad56cd7f1b | C++ | lufovic77/AlgorithmStudy | /backtracking/2580.cpp | UHC | 1,371 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <vector>
#include <stdlib.h>
using namespace std;
typedef struct{
int x;
int y;
}POS;
int len;
vector <POS> q;
bool check(int x, int y, int num, int map[][10]){
//簢 üũ
int a = x/3;
int b = y/3;
a *=3;
b *=3;
for(int i=a;i<a+3;i++){
for(int j=b;j<b+3;j++){
if... | true |
b0a0bdee6db0db7e17cf6b3a1a9531af3b456e53 | C++ | mimseong/BaekJoon | /1100.cpp | UTF-8 | 343 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main()
{
int count = 0;
for(int i = 0; i < 8; i++){
string s;
cin >> s;
for(int j = 0; j < 8; j++){
if(s[j] == 'F' && (i+j) % 2 == 0)
count++;
}
}
printf("%d", ... | true |
0bb6a4f26fb2740f512a1890b42dbb8bb188c11b | C++ | tdwong/leetcode | /c++_434_number-of-segments-in-a-string.cpp | UTF-8 | 1,722 | 3.609375 | 4 | [] | no_license | /*
//https://leetcode.com/contest/leetcode-weekly-contest-11/problems/number-of-segments-in-a-string/
#
# 434. Number of Segments in a String
#
# Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters.
#
# Please note that the string does not con... | true |
83c6e312ad274e071738699ce536685cebe47130 | C++ | clhongooo/trading_engine | /src/main/unit_tests/UnitTest/ut-cdq.hpp | UTF-8 | 6,945 | 2.71875 | 3 | [] | no_license | #include "UTest.h"
#include "Math/RandomEngine.h"
#include "Math/CirDataQue.hpp"
#include <iostream>
using namespace std;
int TestCDQ()
{
UTest ut;
CirDataQue<double> cb1;
ut.AssertF(cb1.Ready(), __FILE__,__FUNCTION__,__LINE__);
for (int i = 0; i < 10; i++) cb1.Add(10);
ut.AssertF(cb1.Ready(), __FILE__,__FUNCT... | true |
eddc78b670f0cac4322b26d079559aea16ac2df0 | C++ | aseppmaulana/Matriks | /Matriks_penjumlahan.cpp | UTF-8 | 594 | 2.671875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main () {
int M[3][3];
int M1[3][3];
int M2[3][3];
for ( int i = 0 ; i < 3 ; i++){
for ( int j = 0; j < 3 ; j++){
cout << "masukkan data baris ke " << "[" <<i<< "]" << " kolom ke " << "[" <<j<<
cin >> M1[i][j];
cout << "masukkan data baris ke " << "[" <<i<< "]" ... | true |
a90a54fa19c62cf406d2071c6a80e534cd242d92 | C++ | trando46/Projects | /lab4/lab4.cpp | UTF-8 | 2,334 | 4.03125 | 4 | [] | no_license | // Bao Tran Do
// File: lab4.cpp
// October 12, 2020
// Purpose: The purpose for this is to reused the same code from the LinkList
// class but for different data types and to display the last negative
// value entered.
// INPUT: none
// OUTPUT: Display the LinkedList contents and the last negative nu... | true |
05e9dd9e6aa9cdee4e2bace02e7abfee13c6de3b | C++ | atafoa/oopSamples | /Homework 7/full_credit/aaa2575_Powered_Arm.h | UTF-8 | 481 | 2.703125 | 3 | [] | no_license | #ifndef POWERED_ARM_H
#define POWERED_ARM_H
#include "aaa2575_Arm_Robot.h"
using namespace std;
class Powered_Arm : public virtual Arm_Robot
{
public:
Powered_Arm(int mn, string n, int bl, int l, int wl, int ml, string t) : motor_limit(ml), motor_on(false), Robot(mn, n, bl, t), Arm_Robot(mn, n, bl, l, wl, t) {};
... | true |
36719723920e4e72f095a82a111908c649adaf52 | C++ | berdoezt/TOKI | /Training/kompetitif/matdis/bagi.cpp | UTF-8 | 381 | 2.8125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b)
{
if(b == 0)
return a;
else
return gcd(b, a % b);
}
int main()
{
long long int A, B, C, D;
long long int E, F;
long long int temp;
cin >> A >> B >> C >> D;
E = A * D + B * C;
F = B * D;
temp = gcd(E, F);
... | true |
5aeb707acb04bbaf27d45c6115a06d5a2cbc8110 | C++ | matsumoto0112/DXR | /Application/Application/Source/DX/Raytracing/DXRDevice.h | SHIFT_JIS | 1,229 | 2.671875 | 3 | [] | no_license | /**
* @file DXRDevice.h
* @brief DXRpfoCXǗ
*/
#pragma once
#include "DX/DeviceResource.h"
namespace Framework::DX {
/**
* @class DXRDevice
* @brief DXRpfoCX
*/
class DXRDevice {
public:
/**
* @brief RXgN^
*/
DXRDevice();
/**
* @brief fXg... | true |
6d3e4ac23bfd716bae37efecb8ceabf9d1ea0082 | C++ | sasaxopajic/OOP | /Preklapanje operatora 2/main/main/main.cpp | UTF-8 | 1,191 | 3.3125 | 3 | [] | no_license | #include "intarray.hpp"
int main() {
const int a1[] = { 1,2,3,4,5 };
const int a2[] = { 6,7,8 };
const int a3[] = { 0,1,2,3,4,5,6,7,8,9 };
const int a4[] = { 100,101,102,103 };
IntArray ia0, ia1(a1, 5), ia2(a2, 3), ia3(a3, 10), ia4(a4, 4);
cout << "ia0: " << ia0 << endl;
cout << "ia1: " << ia1 << endl;
cout <... | true |
560e2ea68d1f573ede251dd7719938aef92d7b56 | C++ | desperadoespoir/TP_INF1010 | /changeymindset_/ConsoleApplication1/Specialite.h | UTF-8 | 386 | 2.875 | 3 | [] | no_license |
#ifndef SPECIALITE_H
#define SPECIALITE_H
# include <string>
using namespace std;
class Specialite {
public:
Specialite();
Specialite(string domaine, int niveau);
~Specialite();
string getDomaine() const;
void setDomaine(string domaine);
int getNiveau() const ;
void setNiveau(int niveau);
... | true |
bb1cd65ba90dd5c47dc00caa17a6fe621b89bb80 | C++ | zuselegacy/leetcode | /recursion_backtracking/78-subsets-dfs.cpp | UTF-8 | 476 | 2.734375 | 3 | [] | no_license | class Solution {
public:
vector<vector<int>> soln;
void generate(vector<int>& nums,vector<int>& result,int pos) {
soln.push_back(result);
for(int i=pos;i<nums.size();i++) {
result.push_back(nums[i]);
generate(nums,result,i+1);
result.pop_back();
}
... | true |
9e5d71fee4b215489631f9ba83baf536126bf182 | C++ | Leo-Chen-CM/Completed-Games-and-Projects | /Cube Avoidance Sim 2k21/SFMLOpenGL/Player.cpp | UTF-8 | 891 | 2.953125 | 3 | [] | no_license | #include "Player.h"
Player::Player()
{
player_object = new GameObject;
player_object->setPosition(vec3(0.5f, 0.8f, 4.0f));
}
void Player::draw(GLint x_offsetID, GLint y_offsetID, GLint z_offsetID)
{
glUniform1f(x_offsetID, player_object->getPosition().x);
glUniform1f(y_offsetID, player_object->getPosition().y);
... | true |
35650419daca7c332d2932afd9a74eec870f48db | C++ | TaeYongHwang/HyHIT | /TaeWook/ch8. dynamic-programming/jumpgame_solution.cpp | UTF-8 | 716 | 2.96875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int n, board[100][100];
int cache[100][100];
int jump(int a, int b);
int main() {
int cases;
int i, j, k;
cin >> cases;
for(i = 0; i < cases; i++) {
cin >> n;
for(j = 0; j < n; j++) {
for(k = 0; k < n; k++) {
int temp;
cin >> temp;
board[j][k] = temp... | true |
b498ce800802b24df6499237cfc343242246a7d9 | C++ | JaeJang/COMP_3512_Lab3 | /Matrix/Matrix/Matrix.hpp | UTF-8 | 996 | 3.0625 | 3 | [] | no_license | #pragma once
#include <iostream>
class Matrix {
public:
Matrix();
explicit Matrix(int);
Matrix(int*, int);
Matrix(const Matrix&);
~Matrix();
void set_value(const int, const int, const int);
int get_value(const int, const int);
void clear();
int* identity();
friend std::ostream& operator<<(std::ostream&, con... | true |
41a93c53c72c3e06bf5694d6e64ce8d3a7fa4264 | C++ | ecosnail/ecosnail | /projects/argo/parser.cpp | UTF-8 | 4,204 | 2.59375 | 3 | [
"MIT"
] | permissive | #include <ecosnail/argo/parser.hpp>
#include <cassert>
#include <iomanip>
#include <sstream>
#include <utility>
namespace ecosnail::argo {
bool Parser::parse(int argc, char* argv[])
{
if (argc > 0) {
programName(argv[0]);
}
std::vector<std::string> args;
for (int i = 1; i < argc; i++) {
... | true |
47bd6ba51730a8e1637ca4f0ad9e45ee82ac917d | C++ | temporaryhub/AISD2 | /Audiophobia/main.cpp | UTF-8 | 3,448 | 2.53125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <queue>
#include "UnionFind.cpp"
using namespace std;
int comp (const void * a, const void * b)
{
const unsigned int *av = reinterpret_cast<const unsigned int*>(a);
const unsigned int *bv = reinterpret_cast<const unsigned int*>(b);
if(av[2] > bv[2])
{
... | true |
3c266eab1327058b30aa8a8ee31b808be339bb72 | C++ | diarodriguezva/uni_projects | /cognitive_systems/src/demo_cogsys_cpp_viz/src/main.cpp | UTF-8 | 6,076 | 2.90625 | 3 | [] | no_license | #include <tf/transform_listener.h>
#include <QApplication>
#include <stdexcept>
#include <exception>
#include <signal.h>
#include "main.h"
#include <robot_control_srvs/MoveToCS.h>
#include <opencv2/opencv.hpp>
using namespace std;
/*Declaring the clients and message containers for the connection to cambot*/
ros::Serv... | true |
af36435bb0080f318dc71c6ff93dfaa8b27f7421 | C++ | syoyo/lfwatch | /src/lfwatch_linux.cpp | UTF-8 | 2,505 | 2.859375 | 3 | [
"MIT"
] | permissive | #ifdef __linux
#include <iostream>
#include <string>
#include <map>
#include <algorithm>
#include <cassert>
#include <functional>
#include <sys/inotify.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include "lfwatch_linux.h"
namespace lfw {
WatchData::WatchData(int wd, const std::string &dir, uint32_t ... | true |
8c4a10f01abe70c367b364410a194afbe38e62ad | C++ | yish0000/leetcode_exercise | /LeetCode/AddOneRowToTree.cpp | UTF-8 | 1,783 | 3.34375 | 3 | [] | no_license | #include "TestCase.h"
#include "BinaryTreeCommon.h"
using namespace std;
class SolutionAddOneRowToTree : public BinaryTreeCommmon
{
public:
TreeNode* addOneRow(TreeNode* root, int v, int d) {
if (d == 1)
{
TreeNode* newRoot = new TreeNode(v);
newRoot->left = root;
return newRoot;
}
el... | true |
d74d908ffcfa5054a0e2c3936e90d86aa121212f | C++ | pat-laugh/websson-libraries | /parser/nameType.hpp | UTF-8 | 551 | 2.625 | 3 | [
"MIT"
] | permissive | //MIT License
//Copyright 2017 Patrick Laughrea
#pragma once
#include <string>
#include "entityManager.hpp"
#include "tagIterator.hpp"
#include "structures/entity.hpp"
#include "structures/keywords.hpp"
namespace webss
{
class NameType
{
public:
enum Type { NAME, KEYWORD, ENTITY_ABSTRACT, ENTITY_CONCRETE };
... | true |
560fb29f21ec09c696fca27732d4d1c81741a106 | C++ | xsusov/ICP | /src/game.h | UTF-8 | 1,466 | 2.90625 | 3 | [] | no_license | #ifndef GAME_H
#define GAME_H
#include <string>
#include "gameboard.h"
#include "player.h"
#include "gameitem.h"
#include "deck.h"
class Game
{
public:
Game();
Game(const std::size_t size, const int playerCount, const int itemCount );
~Game();
std::vector<Player*> &getPlayers() {return players;}
vo... | true |
bc685abb5517934e20289de91cfed7553bd70ae8 | C++ | paco89lol/CandCppReference | /Cpp/reference_variable/Reference/main.cpp | UTF-8 | 191 | 2.796875 | 3 | [] | no_license | #include <Windows.h>
#include <iostream>
using namespace std;
int main(int argc, char **argv)
{
int x;
int &ref = x;
ref = 10;
cout << x << endl; // output 10
Sleep(2000);
return 0;
} | true |
734686c944635f27921d4d116169365261917dff | C++ | Servicerobotics-Ulm/SmartDG | /src/Dependency.cpp | UTF-8 | 3,531 | 2.609375 | 3 | [
"BSD-3-Clause"
] | permissive | ////////////////////////////////////////////////////////////////////////////////
/// \file Dependency.cpp
/// \brief Source file for Dependency class
/// \author Vineet Nagrath
/// \date June 2, 2020
///
/// \copyright Service Robotics Research Center\n
/// University of Applied Sciences Ulm\n
/// Prittwitzstr. 10\n
//... | true |
a0d3e2efc81239f6493c042a5aaacd1e03af4247 | C++ | HRsniper/CPP | /c++ aulas extraa/aula__ template.cpp | UTF-8 | 1,218 | 3.671875 | 4 | [] | no_license | #include <iostream>
using namespace std;
template <typename T>
T funcao(T n) {
cout << typeid(n).name() << " - ";
// if (typeid(n).name() == typeid(int).name()) {
// cout << "inteiro - ";
// }
return n*2;
}
template <class T1>
class aula {
private:
public:
T1 nome;
T1 idade;
... | true |
1cb1563afec9f038dd5e33de0a4d154bb2ae8c06 | C++ | imos/nineserver | /nineserver/arena/arena_buffer.cc | UTF-8 | 1,642 | 2.78125 | 3 | [] | no_license | #include "nineserver/arena/arena_buffer.h"
#include "base/base.h"
DEFINE_int32(arena_buffer_size, 16 * 1024, "Initial arena buffer size.");
ArenaBuffer::ArenaBuffer() {
buffers_.emplace_back(FLAGS_arena_buffer_size);
}
void ArenaBuffer::DeleteAll() {
buffers_.erase(buffers_.begin() + 1, buffers_.end());
buffe... | true |
4b9faf4b4a528e478a330a3416c392c38ee9a799 | C++ | StevenSavold/SQLiteFictionEngine | /Engine/src/Database.h | UTF-8 | 5,970 | 2.90625 | 3 | [] | no_license | #pragma once
#include "Common.h"
#include "Parsing/ParseUtils.h"
#include "sqlite3/sqlite3.h"
#include <cstdarg>
#include <string>
#define OFFSCREEN_ID 0
#define PLAYER_ID 1
union Directions {
int dirs[6];
struct {
int North, South, East, West, Up, Down;
};
};
class Database {
private:
sqlite3* ... | true |
326d0db1efdc8fd66bf0748f4f03dfb932e57696 | C++ | hehesnail/algorithm_practice | /poj_2385/main.cc | UTF-8 | 1,246 | 3.359375 | 3 | [] | no_license | /*
dp
F[i][j]表示在第i次下落,移动了j次可以接到苹果的最大值
等于第i-1次下落,移动了j-1次(F[i-1][j-1])和第i-1次下落,移动了j次(F[i-1][j])两者的较大值
加上j次移动过后是否在对应的树下面,是则加上1否则为0
*/
#include <iostream>
using namespace std;
#define MAXT 1001
#define MAXW 31
int t[MAXT];
int F[MAXT][MAXW];
int main() {
int T, W;
cin >> T >> W;
for (int i = 1; i<= T; i++... | true |
173f96b2893896b0293ebb8b62db10362859ba28 | C++ | shifuxiang/NvrControl | /NvrControl/NvrControl/jobs/TMSSensor.h | GB18030 | 2,691 | 2.546875 | 3 | [] | no_license |
//@file:TMSSensor.h
//@brief:TMSز
//@author:luyan@oristartech.com
//date:2014-09-17
#ifndef _H_SOFTWARESTATE_
#define _H_SOFTWARESTATE_
#include <iostream>
#include <string>
#include "DataManager.h"
#include "../threadManage/C_CS.h"
#include "parser_xml.h"
struct stNotifySmsSwitchInfo
{
std::string strHallId;
s... | true |
ef923ba6c3553b401831995538e0804ad4ddb7da | C++ | flipperfipper/CPP | /Ej_5_05.cpp | UTF-8 | 1,054 | 3.453125 | 3 | [] | no_license | //5. Funcion que lea un vector e intercambie los datos que estan en posiciones pares por los que estan en posiciones impares adyacentes (Ej: 1.2, 3.4, ...).
#include<stdio.h>
#include<conio.h>
#define TAM 10
//DECLARACION
void EscribirVector (int v[ ]);
void desplazamiento_izq_Vector (int v[ ]);
//... | true |
dd9957d1bdd6cd93322096eefe32ee51bab1b71f | C++ | JeongJiAn/Hacker_Study_OOP | /Week_5/problems/프렌드와 연산자 중복/number_07.cpp | UTF-8 | 226 | 2.984375 | 3 | [] | no_license | #include"Matrix.h"
#include"number_07.h"
void solution_07() {
Matrix a(4, 3, 2, 1), b;
int x[4], y[4] = { 1, 2, 3, 4 };
a >> x;
b << y;
for (int i = 0; i < 4; i++) {
cout << x[i] << ' ';
}
cout << endl;
b.show();
} | true |
04d6a6d0db11d51276cffdbfd6333595b9a3de7e | C++ | CJunette/CPP_Learning | /009/实验/9_Experiment_004_Stack/9_Experiment_004_Stack/Stack.h | UTF-8 | 733 | 3.515625 | 4 | [] | no_license | #pragma once
#include <cassert>
#include "LinkedList.h"
#include "Node.h"
template<class T>
class Stack
{
public:
Stack();
void push(const T &item);
T pop();
void clear();
const T &peek() const;
bool isEmpty();
private:
int count;
LinkedList<T> list;
};
template<class T>
Stack<T>::Stack():
count(0)
{}
t... | true |
1da04ffc1b1b3ba70d7fa33d442c8847d44ccb37 | C++ | abraxaslee/ACM-ICPC | /489.cpp | UTF-8 | 834 | 2.734375 | 3 | [
"MIT"
] | permissive | //2012/01/19
//489.cpp
//Run time: 0.104
#include <stdio.h>
char buff[100000];
int wordcount, LIFE, round, c, z;
void solve(int ans[]){
int repeat[125] = {};
LIFE = 7;
for(z=0; buff[z] != '\0'; ++z){
if(!repeat[buff[z]]){
if(ans[buff[z]])
wordcount--;
else
LIFE--;
repeat[b... | true |
2fbf7ba35cb1ab13b438a5919578ab3f7e9fd172 | C++ | 1432849339/Trans_shm | /Trans_shm/Trans.cpp | UTF-8 | 11,488 | 2.6875 | 3 | [] | no_license | #include "Trans.h"
int64_t GetMsTime(int64_t ymd, int64_t hmsu)
{
struct tm timeinfo = { 0 };
time_t second;
int64_t usecond;
timeinfo.tm_year = ymd / 10000 - 1900;
timeinfo.tm_mon = (ymd % 10000) / 100 - 1;
timeinfo.tm_mday = ymd % 100;
second = mktime(&timeinfo);
//80000000
int hou = hmsu / 10000000;
i... | true |
56b679c655faa92a7897f267f2392c3c72564ddb | C++ | skyllar/Problem-Solving | /geeksForGeeks/dynamicProgramming/Optimal Strategy for a Game.cpp | UTF-8 | 3,295 | 2.90625 | 3 | [] | no_license | /*
* Optimal Strategy for a Game.cpp
*
* Created on: Nov 16, 2014
* Author: Apratim
*/
#include <cstdio>
#include <iostream>
using namespace std;
#define TRACE
#define DEBUG
#ifdef TRACE
#define trace1(x) cerr <<"\n"<< #x << ": " << x << endl;
#define trace2(x, y) ... | true |
7cefac465da7ed33957ae1b7cf859e08811acdc8 | C++ | ivanasen/suffix_automata | /tests/SuffixAutomataTests.cpp | UTF-8 | 1,605 | 3.125 | 3 | [] | no_license | #include <iostream>
#include <string.h>
#include "../src/SuffixAutomata.h"
using namespace std;
void testSingle(char *s, int states, int transitions, int finals)
{
SuffixAutomata a(s, strlen(s));
cout
<< (a.getStatesCount() == states)
<< (a.getTransitionsCount() == transitions)
<< (a.g... | true |
66323f1ccc21de8dde5456335150ef1f4feb9d5e | C++ | leyvae/C-GoFish | /deck.cpp | UTF-8 | 2,996 | 3.953125 | 4 | [
"MIT"
] | permissive | #include "deck.hpp"
/******************************************************************
* Function: Deck()
* Description: Default Deck constructor that initializes a dinamic
array of Cards and sets their rank and suit
* Parameters: None
* Pre-Conditions: None
* Post-Conditions: A full new ... | true |
b05a501bb76926ba9f625df87e7722a6095d633b | C++ | sudnya/sudnya-template-library | /test/test-type-list.cpp | UTF-8 | 2,295 | 3.265625 | 3 | [] | no_license |
#include <iostream>
class NullType;
template<typename Payload, typename Next>
class TypeList {
public:
typedef Payload payload_type;
typedef Next next_type;
};
// TODO : append_type
template<typename List, typename Value>
class append_type {
// value not nullType static_assert();
public:
typedef... | true |
182f6f16060042ec8b95de71e1b13d2dfb9254da | C++ | ZHOURUIH/GameEditor | /CodeGenerator_Normal/Frame/Utility/StringUtility.cpp | UTF-8 | 57,546 | 2.953125 | 3 | [] | no_license | #include "Utility.h"
const char StringUtility::BOM[4]{ (char)0xEF, (char)0xBB, (char)0xBF, 0 };
myVector<int> StringUtility::mTempIntList;
string StringUtility::removeStartString(const string& fileName, const string& startStr)
{
if (startWith(fileName, startStr.c_str()))
{
return fileName.substr(startStr.length(... | true |
415c94c39a5d026e72948643c233de155a43f946 | C++ | andrew-suh/Freefall_Engine | /the_engine/the_engine/src/window/text.cpp | UTF-8 | 6,260 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <sstream>
#include <fstream>
#include <glm/gtc/matrix_transform.hpp>
#include <ft2build.h>
#include FT_FREETYPE_H
#include "text.h"
std::map<std::string, Shader> Shaders;
Shader loadShaderFromFile(const GLchar *vShaderFile, const GLchar *fShaderFile, const GLchar *gShaderFile)
{
// 1.... | true |
3e57ece18c98aefbfb62132bba40e2c970520d5c | C++ | thegamer1907/Code_Analysis | /CodesNew/909.cpp | UTF-8 | 421 | 2.703125 | 3 | [] | no_license | #include<iostream>
#include<cstring>
#include <set>
#include <cmath>
#include <vector>
using namespace std;
set <string> c;
main()
{
int a,b;
cin >>a >>b;
string s;
for(int i=0;i<a+b;i++){
cin >>s;
c.insert(s);}
int x=0;
x=a+b-c.size();
if(x%2==0) {
if(a>b) cout <<"YES";
el... | true |
7e25864b96c3479faac231bd1c132388a2df5e41 | C++ | Lemutar/cucumber-cpp | /src/main.cpp | UTF-8 | 1,516 | 2.734375 | 3 | [
"MIT"
] | permissive | #include <cucumber-cpp/internal/CukeEngineImpl.hpp>
#include <cucumber-cpp/internal/connectors/wire/WireServer.hpp>
#include <cucumber-cpp/internal/connectors/wire/WireProtocol.hpp>
#include <iostream>
#include <boost/program_options.hpp>
using boost::program_options::value;
namespace {
void acceptWireProtocol(int po... | true |
f927913df4da713148df40644ecca0a13a05356d | C++ | kxjjuneau/KnightGame | /Rabbit.cpp | UTF-8 | 4,663 | 3.15625 | 3 | [] | no_license | /////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Project: project 2: Rabbit game
// Filename: rabbit.cpp
// Description: function definitions for the rabbit class
// Author: Joseph Juneau (juneau@etsu.edu)
// Created: Thursda... | true |
430f6957b7d0c1f2bb7bf20f49982149c195ada6 | C++ | acoustictime/CollegeCode | /Cal State San Bernardino (CSUSB)/CSE202 - Computer Science 2/lab10/Mlist.cpp | UTF-8 | 960 | 3.71875 | 4 | [] | no_license | #include <iostream>
#include "Mlist.h"
#include <vector>
template<class T> //creates the list with a firstinline entry
Mlist<T>::Mlist(T firstinline)
{
mlist.push_back(firstinline);
}
template<class T>//returns the front of the list and moves every entry up one position;
T Mlist<T>::next()
{
T x;
if (ml... | true |
8171f4fc4d21ccda40fe9d23f8f9ecf7589cedd2 | C++ | ZhdanovichTimofey/sem2 | /3/H.cpp | UTF-8 | 295 | 2.859375 | 3 | [] | no_license |
Cat* get_home_for_a_cats_pride(unsigned int n){
Cat* r = new Cat[n];
for (unsigned int i = 0; i < n; i++)
r[i].name = new char[10];
return r;
}
void clear_home_of_a_cats_pride(Cat *cats, unsigned int n){
for (unsigned int i = 0; i < n; i++)
delete[] cats[i].name;
delete[] cats;
}
| true |
131183f53175b2a68343a4ff0cced773f6e307cf | C++ | jin1xiao3long2/CompilerLearning | /Experience/Tiny/Tiny_Nodes.cpp | UTF-8 | 4,898 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | #include <Tiny_Nodes.hpp>
namespace tn {
void build_tree_version(int l, const std::string &info, std::deque<std::string> &Messages) {
std::string mes = "";
for (int i = 0; i < l; i++)
mes.append(" ");
mes.append(info);
Messages.push_back(mes);
}
node_base *node... | true |
abb7c07d5ad8a41b358793cbdf4b7f6481802ed5 | C++ | facebook/redex | /sparta/include/sparta/HashedSetAbstractDomain.h | UTF-8 | 5,611 | 2.703125 | 3 | [
"MIT"
] | permissive | /*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <cstddef>
#include <initializer_list>
#include <memory>
#include <unordered_set>
#include <sparta/Powerse... | true |
226cd1d34b178121eeda2c8ed502f76813137947 | C++ | dipprog/Data-Structure | /Queue/linkedListImplementation.cpp | UTF-8 | 1,782 | 4.40625 | 4 | [] | no_license | /*Queue - Linked List implementation*/
#include <iostream>
using namespace std;
struct Node
{
int data;
Node *next;
};
// Two glboal variables to store address of front and rear nodes.
Node *front = NULL;
Node *rear = NULL;
class Queue
{
public:
// To Enqueue an integer
void Enqueue(int x)
{
... | true |
4694cfd15ec06a91d8b94da90399d1bd4cf76a4d | C++ | RaduAlbastroiu/AdventOfCode | /2018/Day6.cpp | UTF-8 | 1,804 | 2.75 | 3 | [] | no_license | // ConsoleApplication1.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <iostream>
#include <fstream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <string>
#include <deque>
#include <set>
#include... | true |
7e46d57ef52c7d76e914c4e190879c0de5644790 | C++ | AbuHorairaTarif/UvaProject | /UVA/10005.cpp | UTF-8 | 1,985 | 3 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
#include <algorithm>
using namespace std;
const int maxn=105;
const double eps=1e-6;
struct Point
{
double x,y;
}p[maxn];
struct Line{Point a,b;};
int dbcmp(double n)
{
return n<-eps?-1:n>eps;
}
double dis(Point a,Point b)
{
return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y... | true |
47fb80b3dde5bc8eb84f4978450574c681dd86e6 | C++ | UNMECE231Sp2020/homework-2-jrhoades | /con_fun.cpp | UTF-8 | 2,992 | 3.3125 | 3 | [] | no_license | //con_fun.cpp
#include <iostream>
#include "declarations.h"
#include<cmath>
Complex::Complex() {
_real = 0;
_imag = 0;
}
Complex::Complex(double real,double imag) {
_real = real;
_imag = imag;
}
Complex::Complex(double real) {
_real = real;
_imag = 0;
}
void Complex::print() {
if(_imag>=0)
std::c... | true |
597bde3d36788e62b037104bcf9690fbaa47bc22 | C++ | Wulala1119/myLeetCode | /139_WordBreak/139_WordBreak.cpp | UTF-8 | 1,072 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <math.h>
#include <string>
#include <unordered_set>
using namespace std;
class Solution {
public:
bool wordBreak(string s, unordered_set<string>& wordDict)
{
if(s == "")
return false;
bool *isFind = new bool[s.size()];
memset(i... | true |
0ce8d6c8f71647019798f3ffdc262f5f979b3a81 | C++ | gembancud/CompetitiveProgramming | /codeforces/threematrices/a.cpp | UTF-8 | 942 | 2.90625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<vector<double>> v(n);
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
double x;
cin >> x;
v[i].push_back(x);
}
}
for (int i = 0; i < n;... | true |
61ec4c9949a16d69ff5d1678842b276ed49fbda0 | C++ | Anehta/AGE-lua | /src/render/age_node.cpp | UTF-8 | 726 | 2.875 | 3 | [] | no_license | #include <../include/age_matrix4x4.h>
#include <../include/age_node.h>
namespace AGE2D
{
ANode::~ANode()
{
}
ANode::ANode()
{
m_x = 0;
m_y = 0;
}
void ANode::setX(float x)
{
m_x = x;
}
void ANode::setY(float y)
{
m_y = y;
}
void ANode::setPos(AVector2D pos)
{
m_x=pos.x ();
m_y=pos.y ();
}
void ANo... | true |
ed3e0d5b7541c4dea75681dddbffd5e87ec645fb | C++ | emberian/cs142-proj1 | /browser.h | UTF-8 | 786 | 2.703125 | 3 | [] | no_license | #pragma once
#include <unordered_map>
#include <vector>
#include <string>
#include <tuple>
#include "option.h"
struct word {
unsigned int index, length;
bool is_link;
unsigned int linkidx;
};
struct link {
std::string destination;
std::string text;
};
// the contents of the file, the offsets of words in the f... | true |
fc4306a90f4cef4dd6aa97add87501dfa2fce7bf | C++ | GIBIS-UNIFESP/BIAL | /tst/src/Matrix-3DCompare.cpp | UTF-8 | 1,023 | 2.90625 | 3 | [] | no_license | /* Biomedical Image Analysis Library */
/* See README file in the root instalation directory for more information. */
/* Author: Fábio Augusto Menocci Cappabianco */
/* Date: 2012/Jun/29 */
/* Version: 1.0.00 */
/* Content: Test file. */
/* Description: Test with Matrix class. */
#include "Matrix.hpp"
using namespac... | true |
399a74baf34def302c50b5972f1d68d6ca183b39 | C++ | codgician/Competitive-Programming | /Codeforces-Gym/101620J/dp_tree.cpp | UTF-8 | 2,196 | 2.6875 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <iomanip>
#include <climits>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <functional>
#include <iterator>
using namespace std;
#define EDGE_SIZE 20000... | true |
b860f2bcc70bf878f314aef12ef8ad953bed669d | C++ | baozizhenmeixian/DoubleFaultDiagnosis | /GlpkDoubleDiagnosis/HierarchyNode.h | GB18030 | 1,341 | 3.296875 | 3 | [] | no_license | #pragma once
#include <string>
#include <vector>
using namespace std;
class HierarchyNode
{
public:
HierarchyNode(string);
HierarchyNode();
//~HierarchyNode(void);
void setValue(string v){ value = v; };
string getValue()const{ return value; };
void setNextCondition(vector<int> v){ nextConditon = v; };
vector<... | true |
85db5266a18d332a379fdf7c76552cf5490589fd | C++ | js2203/scheme_cpp | /scheme_builtInFunc.cpp | UTF-8 | 9,483 | 2.84375 | 3 | [] | no_license | #include "scheme_builtInFunc.h"
#include <iostream>
namespace scm::trampoline {
/**
*
* @return
*/
Continuation* addition() {
int nArgs{popArg<int>()};
auto arguments = popArgs<Object*>(nArgs);
if (std::any_of(arguments.begin(), arguments.end(), isFloat)) {
auto lambda = [](double a, Object* b) {
... | true |
a4448b9a1f069bc0f3e15ed83cfd77f5b55a5093 | C++ | stelro/Vulkan-GPU-Real-time-RayTracing-BS-Thesis- | /source/IOManager.cc | UTF-8 | 4,320 | 2.71875 | 3 | [] | no_license | /* =======================================================================
$File: IOManager.cc
$Date: 7/1/2019
$Revision:
$Creator: Rostislav Orestis Stelmach
$Notice: This file is a part of Thesis project ( stracer ) for
the Technical Educational Institute of Western Macedonia
... | true |
fcc0f0163ae22e0371f3b199fb71663f4671b047 | C++ | albicilla/- | /ant/Cable.cc | UTF-8 | 453 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;
int n;
int k;
double l[10010];
int f(double x){
int ans=0;
for(int i=0;i<n;i++){
ans+=(int)(l[i]/x);
}
return ans;
}
int main(){
cin>>n>>k;
for(int i=0;i<n;i++){
cin>>l[i];
}
double lb=0.0,rb=1e9;
for(int ... | true |
f5eaa5f8c335c8505f2c41ceb0f7c0e7b99c4635 | C++ | e3ntity/aithena | /test/test_alphazero.cc | UTF-8 | 2,092 | 2.5625 | 3 | [] | no_license | /**
* @Copyright 2020 All Rights Reserved
*/
#include <torch/torch.h>
#include <iostream>
#include "alphazero/alphazero.h"
#include "chess/game.h"
#include "chess/util.h"
#include "gtest/gtest.h"
using namespace aithena;
class AlphaZeroTest : public ::testing::Test {
protected:
void SetUp() {
chess::Game:... | true |
508b5eb1279c67d6180554c8e77d6f415060c1af | C++ | LaLlorona/Algorithms | /CodeForce/R634D3C.cpp | UTF-8 | 1,276 | 2.75 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
vector<int> input_arr;
int MaxTeamMatching () {
int num_keys = 0;
map<int, int> occurance;
map<int, int> :: iterator it;
for (int i = 0; i < input_arr.size(); i++) {
int count = 0;
it = occurance.find(input_arr[i]);
if (it == occurance.end()) {
num_keys++;
... | true |
33c461d7d7593dbdefc904d3e9bcad5daacf711a | C++ | Code-Diamond/AnonymousBeeper | /AnonymousBeeper.cpp | UTF-8 | 836 | 3.1875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int z=10, d=10, e=10, q = 10;
vector<int> BEEP = {z, d, e, q};
cout << "Tell me a number: ", cin >> z;
auto a = [&z](int x, int y)
{
z=100;
cout << "\n\079\tBEEP \bBOOP\a\007\t\rBEEPBOOP\007\008\069\n" << endl;
retu... | true |
1a73d69bb025ccec1b461962ad75df112b6e1f34 | C++ | jbjihwan/Innabus | /Engine/Interop/Vector3.cs.h | UTF-8 | 3,885 | 2.8125 | 3 | [] | no_license | #pragma once
using namespace System;
#include "ibVec3.h"
#include "Matrix3.cs.h"
namespace Innabus {
namespace Math
{
public ref class Vector3
{
public:
Vector3() { m_vector = new ibVec3; }; // No default init!
Vector3( const f32 _x, const f32 _y, const f32 _z ) { m_vector = new ibVec3(_x, _y, _z); }
... | true |
d59544cff24ee3b6433718fccb6234c6c9c31e92 | C++ | mmanley/Antares | /antares/src/tests/kits/storage/QueryTest.cpp | UTF-8 | 41,450 | 2.59375 | 3 | [] | no_license | // QueryTest.cpp
#include <ctype.h>
#include <fs_info.h>
#include <stdio.h>
#include <string>
#include <unistd.h>
#include "QueryTest.h"
#include <Application.h>
#include <Message.h>
#include <MessageQueue.h>
#include <Messenger.h>
#include <NodeMonitor.h>
#include <OS.h>
#include <Path.h>
#include <Query.h>
#includ... | true |
171befe80defecaf0665fde11fdc926f43b36a6e | C++ | golovniaanna/dz | /DZ1.cpp | UTF-8 | 191 | 2.84375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int a = 0, b = 0;
a = 15;
b = 20;
std::cout << a << " + " << b << " = " << a + b << endl;
return 0;
} | true |
87113ce80409f9f84bcc6840faca6d50724a784a | C++ | moffel/iptap | /nettool/nettool.cpp | UTF-8 | 1,770 | 2.65625 | 3 | [
"CC-BY-4.0"
] | permissive | #include <WinSock2.h>
#include <Windows.h>
#include <stdio.h>
#include <time.h>
#include <assert.h>
#pragma comment(lib, "WS2_32.lib")
struct get_header
{
unsigned long offset;
unsigned short size;
};
SOCKADDR_IN addr;
void put(unsigned long address, const void* data, unsigned long size)
{
SOCK... | true |
2f4419b1e1cf6338c04eec9290ed59b7e9ef0910 | C++ | Aplikacjacpp/Drzewo_genealogiczne | /Drzewo_genealogiczne/Data/Personaly/gender.h | UTF-8 | 1,417 | 2.6875 | 3 | [] | no_license | /***************************************************************************************************************
*"gender.h"
*
*
*
*
*
*CONTENTS:
* "Klasa dziecko po C_data"
*HISTORY:
*version Date Changes Author/Programmer
*1.0 26.04.2017 Orginal design Mateusz Marchelewicz
*1.1 ... | true |
8bfb9a29279925554c16bce2b43f83208c91dd20 | C++ | AntonioShi/dataStructure | /school/XXX.cpp | UTF-8 | 649 | 2.84375 | 3 | [] | no_license | //
// Created by niracler on 17-9-4.
//
/*
* 这个是关于矩阵转置的题目
* */
#include <iostream>
using namespace std;
int main9(void)
{
int n;
cin >> n;
int ** b = new int * [n];
for (int i = 0; i < n; ++i)
{
int * a = new int[n];
b[i] = a;
}
for (int j = 0; j < n; ++j)
{
... | true |
9e13bf4e301fefe2df4ea8de886d55b771b1bc7e | C++ | mugdhakapure/GeeksForGeeks-Practice-Solutions | /Snake_and_Ladder_Problem.cpp | UTF-8 | 2,308 | 3.796875 | 4 | [] | no_license | /*
Given a snake and ladder board of order 5x6, find the minimum number of dice throws required to reach the destination or last cell (30th cell) from source (1st cell) .
Example
For the above board output will be 3
For 1st throw get a 2
For 2nd throw get a 6
For 3rd throw get a 2
Input:
The first line of input... | true |
2f0eb1dbdb6a88f0a95af444bfc72fde881d6072 | C++ | mmalakhova/tasks | /treap_refactoring/treap_refactoring.cpp | UTF-8 | 841 | 2.625 | 3 | [] | no_license | #include "treap.h"
#include <stdio.h>
#define NumItems 12000
int main()
{
Treap T;
Position P;
int i;
int j = 0;
T = Initialize();
T = MakeEmpty(NullNode);
for (i = 0; i < NumItems; i++, j = (j + 7) % NumItems)
T = Insert(j, T);
for (i = 0; i < NumItems; i++)
if ((P = ... | true |
a893de3fe78cc8d9433e0dc3f7938167557a1a78 | C++ | bangiao/C_plus_plus | /[stl]容器的begin和end成员/[stl]容器的begin和end成员/删除容器.cpp | UTF-8 | 362 | 2.984375 | 3 | [] | no_license | #include <iostream>
#include <map>
#include <string>
using namespace std;
int main(void)
{
map<int, string> m_map;
map<int, string>::iterator it = m_map.begin();
for (int i = 0; i < 10; i++)
{
m_map.insert(make_pair(i, "zhazha"));
}
for (auto &c : m_map)
{
cout << "ID:" << c.first << " Val: " << c.second <... | true |
1ff6a5a67686e3c7af7e0e287cad222f1faf792e | C++ | zhangchenghgd/zeroballistics | /code/bluebeard/src/HudBar.cpp | UTF-8 | 3,634 | 2.75 | 3 | [] | no_license |
#include "HudBar.h"
#include "ParameterManager.h"
#include "Vector2d.h"
#include "SceneManager.h"
//------------------------------------------------------------------------------
HudBar::HudBar(const std::string & section) :
HudTextureElement(section),
value_(0.0f)
{
const std::string & fill_dir = s_pa... | true |
e23a282b04da1e39da5995167f021bf204c5424a | C++ | FelipeNascimentods/Estruturas-De-Dados | /Recursividade/questao 01 (SLIDE).cpp | ISO-8859-1 | 355 | 3.65625 | 4 | [] | no_license | // Escreva uma funo recursiva para computar o produto de dois nmeros inteiros positivos em termos da adio.
#include <stdio.h>
int funcao(int n1, int n2);
int main(){
printf("%d\n", funcao(3, 2));
return 0;
}
int funcao(int n1, int n2){
int result = n1;
if(n2==0){
result = 0;
}else{
result += funcao(n1, n2-... | true |
45de2cda03de21442509e906e620541200396571 | C++ | aiboatum/c-cpp | /Cpp实现Join函数/join.cpp | UTF-8 | 423 | 3.28125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
using namespace std;
string join(vector<string> &str,const string & delim = " "){
string ret;
for(auto iter=str.begin();iter!=str.end();++iter){
ret += *iter;
if(iter!=str.end()-1)ret += delim;
}
return ret;
}
int main() {
vec... | true |
c0065781764c1ce5c7fe06a98f2fa667c963742a | C++ | hmoevip/myprogram | /test/reverseCalcu.h | UTF-8 | 904 | 2.75 | 3 | [] | no_license | #include "stdio.h"
#include<iomanip>
#include<iostream>
#include<math.h>
#include <vector>
#include <list>
using namespace std;
//矩阵
class matrix
{
public:
double data[3][3];
int row;
int col;
};
class matrixly
{
public:
double dataly[3][1];
int rowly;
int colly;
};
class M... | true |
1ed39c75ad46982e675ffcaf5fb1c1e2b578044c | C++ | 3dapi/bs01_c | /strTrim2.cpp | UTF-8 | 1,324 | 3.625 | 4 | [] | no_license |
#include <stdio.h>
void LcStr_TrimLeft(char* sBuf, const char *sTrm)
{
char* D= (char*)sBuf;
char* L= (char*)sBuf;
char* T= NULL;
while( *L )
{
T= (char*)sTrm;
for(; *T && *T != *L; ++T);
if(!*T)
break;
++L;
}
while( *L )
*(D++) = *(L++);
*D = '\0';
}
void LcStr_TrimRight(char* sBuf, const... | true |
0d7dc3bf80f86742584fe45bdff341f6f1ac1d5f | C++ | yuyilei/Daily-Notes | /offer/圆圈中最后剩下的数.cpp | UTF-8 | 1,585 | 3.234375 | 3 | [] | no_license | /*
每年六一儿童节,牛客都会准备一些小礼物去看望孤儿院的小朋友,今年亦是如此。HF作为牛客的资深元老,自然也准备了一些小游戏。其中,有个游戏是这样的:首先,让小朋友们围成一个大圈。然后,他随机指定一个数m,让编号为0的小朋友开始报数。每次喊到m-1的那个小朋友要出列唱首歌,然后可以在礼品箱中任意的挑选礼物,并且不再回到圈中,从他的下一个小朋友开始,继续0...m-1报数....这样下去....直到剩下最后一个小朋友,可以不用表演,并且拿到牛客名贵的“名侦探柯南”典藏版(名额有限哦!!^_^)。请你试着想下,哪个小朋友会得到这份礼品呢?(注:小朋友的编号是从0到n-1)
*/
// 法一:用链表进行过程模拟
struct nod... | true |
ec60739067e9f00570ba42300717be2c109d1d2e | C++ | TGlad/FractalColour2D | /FractalColour2D/graph_quantifying.cpp | UTF-8 | 4,639 | 3.046875 | 3 | [] | no_license | // experiments with structural coloration of fractal curves, in particular Koch, Levy, Dragon and random curves.
#include "stdafx.h"
#include "bmp.h"
#include "spectrumToRGB.h"
#include <set>
static int width = 4000;
static int height = 1600;
static int gap = 50;
void setpixel(vector<BYTE> &out, const Vector2i &pos, ... | true |
9d0c3338ded625a7e49dd0febebd1a3b9f0b823a | C++ | richieyan/RapidJsonSerialization | /Main/Player.h | UTF-8 | 1,217 | 2.96875 | 3 | [] | no_license | #pragma once
#include <string>
#include <vector>
#include <map>
#include "Serializable.h"
#include "Hero.h"
#include "Preference.h"
class Player : public Serializable
{
protected:
virtual void __exSerialize(FastWriter& writer){
Serializable::put(writer, "ex1", preference);
Serializ... | true |
50a9b09c63315cb39c5a4edb9275304a2b3608ea | C++ | akashs2795/Learn-Cpp | /Sorting/Quick Sort.cpp | UTF-8 | 1,570 | 4.1875 | 4 | [] | no_license | #include <iostream>
using namespace std;
void SwapRef(int &a, int &b) //to swap using call by reference
{
int temp = a;
a = b;
b = temp;
}
void print(int A[],int n) //to print the array
{
cout<<"The array is ";
for (int i=0;i<n;i++)
{
cout<<A[i]<<" ";
}
cout<<endl;
}
int partitionEnd(int A[], ... | true |
09feeacb9a8bd79a053d5bcac3be04b85b1d3c18 | C++ | Myna65/RR | /src/objects/Mesh.h | UTF-8 | 714 | 2.71875 | 3 | [] | no_license | #ifndef _3D_MESH_H
#define _3D_MESH_H
#include <set>
#include "Point.h"
#include "Polygon.h"
#include "Surface.h"
namespace RR::Objects {
struct Mesh {
private:
std::string name;
std::set<std::shared_ptr<Point>> points;
std::set<std::shared_ptr<Polygon>> polygons;
std::set<... | true |
ae02b75c1a27d044bf90a56c82a97bc3283af83b | C++ | GabeOchieng/ggnn.tensorflow | /program_data/PKU_raw/5/53.c | UTF-8 | 577 | 2.765625 | 3 | [] | no_license |
int atgc(char a){
if(a=='A'||a=='G'||a=='C'||a=='T'){
return 1;
}else{
return 0;
}
}
int main(){
double m;
char xl1[500]={'\0'},xl2[500]={'\0'};
scanf("%lf %s %s",&m,xl1,xl2);
int len1,len2;
len1=strlen(xl1);
len2=strlen(xl2);
if(len1!=len2){
printf("error");
return 0;
}else{
in... | true |
748be9983ea9d9a120a3466df2c752b6c7cbf73f | C++ | Hyski/ParadiseCracked | /Common/Sound/sndcompiler.h | UTF-8 | 524 | 2.609375 | 3 | [] | no_license | #ifndef __SNDCOMPILER_H__
#define __SNDCOMPILER_H__
enum SND_ERRORS{
SUCCESSED,
FILE_OPEN_ERROR,
LEXER_ERROR,
PARSER_ERROR,
TOKEN_ERROR,
TOKEN_BUFFER_ERROR,
UNKNOWN_ERROR
};
class SndCompiler{
public:
SndCompiler() { m_line = 0; m_error = 0; };
~SndCompiler() {};
bool Compil... | true |
b750c8e7ffb339a60008ed6cf61b9cd5b6b20473 | C++ | kunhuicho/crawl-tools | /codecrawler/_code/hdu2181/16210004.cpp | UTF-8 | 1,105 | 2.59375 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<cstdio>
#include<cstring>
using namespace std;
vector<int > map[25];
bool vis[25];
int pre[25];
int m,num;
void print_ans(int cur){
if(cur!=m){
print_ans(pre[cur]);
printf(" %d",cur);
}
}
void dfs(int cur,int cnt){
if(cnt<20&&vis[m]) return;
... | true |
3da9319a28c4966d28b148bfd0852f0e89225aa7 | C++ | Jacajack/voxels | /include/lobor/shader.hpp | UTF-8 | 688 | 2.671875 | 3 | [] | no_license | #ifndef LOBOR_SHADER_HPP
#define LOBOR_SHADER_HPP
#include <initializer_list>
#include <vector>
#include <string>
#include <map>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
namespace lobor
{
//Struct used just by Shader constructor
struct ShaderSpec
{
std::string filename;
GLenum shader_type;
};
//Shader ... | true |
963437b4fc655a16add8dddcd50fecae7a70f341 | C++ | my-hoang-huu/My-hh | /1. Nhap mon lap trinh_chuong05_kieu cau truc/bai015.cpp | UTF-8 | 714 | 3.640625 | 4 | [] | no_license | #include<iostream>
#include<iomanip>
#include<string>
using namespace std;
struct HOCSINH
{
string HoTen;
int Toan;
int Van;
float TrungBinh;
};
void Nhap(HOCSINH&);
void Xuat(HOCSINH);
int main()
{
HOCSINH A;
Nhap(A);
Xuat(A);
return 1;
}
void Nhap(HOCSINH& a)
{
cout << "Nhap Ho va ten hoc sinh: ";
getline(c... | true |
9acfc2680a48980882c7e9005ce19903dd24a54b | C++ | cowtony/ACM | /LeetCode/2500-2599/2571. Minimum Operations to Reduce an Integer to 0.cpp | UTF-8 | 671 | 3.046875 | 3 | [] | no_license | class Solution {
public:
int minOperations(int n) {
int ops = 0;
int continious_one = 0;
while (n > 0) {
if (n % 2 == 1) {
continious_one++;
} else { // == 0
if (continious_one == 1) {
ops++;
cont... | true |