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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
01df02a28104630b2da5c3aab94e0e7dc8e0e986 | C++ | chengzeyi/whu-acm-oj | /archive/167_Oil-Detecting.cpp | UTF-8 | 1,388 | 3 | 3 | [] | no_license | #include <bits/stdc++.h>
void block(size_t i, size_t j, std::vector<std::string> &graph) {
if (i >= graph.size() || j >= graph.front().size()) {
return;
}
if (graph[i][j] == 'X') {
return;
}
graph[i][j] = 'X';
block(i - 1, j, graph);
block(i - 1, j - 1, graph);
block(i -... | true |
131c165f5e60c66a0b805d2a4db19f4c236fb9e9 | C++ | DataManagementLab/DBx1000 | /system/utils/mem_alloc.cpp | UTF-8 | 4,700 | 2.6875 | 3 | [
"ISC"
] | permissive | #include "mem_alloc.h"
#include "helper.h"
#include "global.h"
// Assume the data is strided across the L2 slices, stride granularity
// is the size of a page
void mem_alloc::init(uint64_t part_cnt, uint64_t bytes_per_part) {
//set bucket_cnt to: max(g_thread_cnt,g_init_parallelism)*4+1
if (g_thread_cnt < g_init_p... | true |
39a978db5a2b98759a7bba502310ddfc4865479c | C++ | google-code/7559-saleconfritas | /codigo/Persona/src/main.cpp | UTF-8 | 584 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <unistd.h>
#include <stdio.h>
#include "Persona.h"
int main(int argc, char **argv) {
/* Control de parametros
* 1 - cantidad de pisos del edificio
* 2 - cantidad de ascensores
* 3 - capacidad del ascensor
* 4 - velocidad del ascensor
* 5 - modo debug
* 6 - modo log
* 7 - mo... | true |
4c1a7d08a623b2133b05257ff702a33ee0dca4db | C++ | ljeongseok/Arduino | /door_lock/Doorlock.cpp | UTF-8 | 2,986 | 2.859375 | 3 | [] | no_license | #include "Doorlock.h"
Doorlock::Doorlock(int serial_bps, int lcd_addr)
: MiniCom(serial_bps,lcd_addr){
}
void Doorlock::init(int led_pin, int servo_pin)
{
MiniCom::init();
this->led_pin = led_pin;
pinMode(led_pin,OUTPUT);
lock.attach(servo_pin);
print(0,"[[Door Lock]]");
lock.write(0)... | true |
68aab2d69dc845b7c0f2c79e8e900bac3b636685 | C++ | amrithabastin/CS141 | /lab10_q1.cpp | UTF-8 | 854 | 3.53125 | 4 | [] | no_license | #include<iostream>
using namespace std;
//declaring class
class box{
//acess
public:
//properties
int height;
int breadth;
int length;
};
int main(){
//declaing objects
box box1;
box box2;
//and needed vaiables
float volume= 0.0;
//assinging values tproperties of bjects in class , inputs
cout<< "... | true |
6fb50f96eae839c3239b6389f72e428089045899 | C++ | CallumCarmicheal/CubedWorld | /Source/CubedWorld.Server/Console.cpp | UTF-8 | 2,938 | 2.984375 | 3 | [] | no_license | #include "Console.h"
#include <conio.h>
/*
* Create the console
*/
void Console::Create() {
int hConHandle = 0;
HANDLE lStdHandle = 0;
FILE *fp = 0;
// Allocate a console
AllocConsole();
// redirect unbuffered STDOUT to the console
lStdHandle = GetStdHandle(STD_OUTPUT_HANDLE... | true |
844c1ad4d2a6fe94de4518785187a19df6e96a03 | C++ | benmandrew/Andleite | /header/input.h | UTF-8 | 679 | 2.71875 | 3 | [
"MIT"
] | permissive | #ifndef __INPUT_H_INCLUDED__
#define __INPUT_H_INCLUDED__
#pragma once
#include <map>
#include <SDL2/SDL.h>
#include "observer.h"
enum InputEvent {
KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT
};
typedef std::map<SDL_Keycode, InputEvent> keyMap;
class Input : public Subject {
private:
bool quit = false;
stati... | true |
19a160baef73b42a14a6b547fc9261fbf45d3417 | C++ | wxx17395/Leetcode | /c++ project/Question bank/Q700-Q799/Q785.cpp | UTF-8 | 933 | 3.375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
class Solution {
vector<int> color;
bool valid;
public:
bool isBipartite(vector<vector<int>>& graph) {
int n = graph.size();
valid = true;
color.assign(n, 0);
for (int i = 0; i < n && valid; ++i){
if (color[i] == 0){
... | true |
accb5fcbccccdc509dde2528dad66e36ba23ed96 | C++ | J-dog22/Windows-Recon-Deceptor | /Deceptive_whoami/Source.cpp | UTF-8 | 3,717 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(int argc, char* argv[]) {
ifstream infile;
string user = "\\User1";
string tmp;
if (argc == 1) {
infile.open("..\\..\\..\\Results_files\\computerName.txt");
if (infile.is_open()) {
if (getline(infile... | true |
375134cc85fc95a21d6ab8a1a44607ed6b824c00 | C++ | Verssae/TypingTrainer | /TypingTrainer/Utill.cpp | UHC | 6,243 | 2.71875 | 3 | [] | no_license | #include "Utill.h"
#include <Windows.h>
#include <conio.h>
#include <iomanip>
#include <sstream>
using namespace std;
FileManager::FileManager() : mRankings() {
cout << "!\n";
}
FileManager::~FileManager() {
}
void FileManager::RoadRanking()
{
// txt Ͽ ŷ mRankings
ifstream fin;
fin.open("Ranking.txt" ... | true |
3910daf8cdbd53537e2b53027c95aa691a913de9 | C++ | Jiltseb/Leetcode-Solutions | /solutions/715.range-module.246936325.ac.cpp | UTF-8 | 1,605 | 3.375 | 3 | [
"MIT"
] | permissive |
map<int, int>::iterator lower_bound2(map<int, int> &mp, int key) {
if (mp.empty())
return mp.end();
auto it = mp.lower_bound(key);
if (it->first == key)
return it;
if (it == mp.begin())
return mp.end();
it--;
return it;
}
class RangeModule {
map<int, int> mp;
public:
RangeModule() {}
... | true |
1cae3cec96f2e89dee249d25b79121904d7807ae | C++ | pzdksnb/Basic_oop | /Basic/program.cpp | UTF-8 | 3,239 | 3.03125 | 3 | [] | no_license | /*
* File: program.cpp
* -----------------
* This file is a stub implementation of the program.h interface
* in which none of the methods do anything beyond returning a
* value of the correct type. Your job is to fill in the bodies
* of each of these methods with an implementation that satisfies
* the performan... | true |
c16031feb447e4caa591470b786ad6d0ae8a9ce3 | C++ | stefanpantic/pascalina | /include/ast/iteration.hpp | UTF-8 | 871 | 3.140625 | 3 | [] | no_license | #pragma once
#include <memory> // unique_ptr
#include "expression.hpp"
#include "statement.hpp"
namespace pascalina
{
/*
* @brief AST node for iteration statement.
*/
class iteration : public statement
{
public:
explicit iteration(expression *condition, statement *body)
: m_condition(std::move(condit... | true |
20a0634191ecf2815cf217c0cd9fdce6388662e7 | C++ | rlodina99/Learn_cpp | /Olimpiada/2015/9_enunturi/rlodina_arc.cpp | UTF-8 | 2,636 | 2.75 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <fstream>
using namespace std;
ifstream f("arc.in");
//ifstream f ("C:\\Eval_OJI_2014_IX\\probleme\\arc\\teste\\5-arc.in");
ofstream g ("arc.out");
int main()
{
int v; //nr cerintei
int n; //nr de bile
f>>v;
f>>n;
int arr[n]; ... | true |
6bbeeb77c93c70be55bc7d0032b345a43f222703 | C++ | ZyrianCode/Library | /pExpressionFormatter.h | UTF-8 | 3,039 | 3.15625 | 3 | [] | no_license | #pragma once
#include <string>
#include <vector>
#include <stack>
#include <utility>
#include "Validator.h"
using std::string;
using std::to_string;
using std::stack;
using std::vector;
using std::pair;
class ExpressionFormatter
{
string _expression;
public:
ExpressionFormatter();
~ExpressionFormatter();
... | true |
54b31b3da1ef978ec6945963376b60025e02de4c | C++ | PriyaPilla4/Cplusplus | /Maze Game/room.hpp | UTF-8 | 818 | 2.984375 | 3 | [] | no_license | //
// room.hpp
// projectnumber2
//
// Created by Priya Pilla on 2/24/20.
// Copyright © 2020 Priya Pilla. All rights reserved.
//
#ifndef room_hpp
#define room_hpp
#include <stdio.h>
#include <iostream>
#include <vector>
#include "passage.hpp"
class Room{
private:
std::string name = "no name";
std:... | true |
1e6bba22992f485e295bff77f65fcdfaebb49aa2 | C++ | thalium/icebox | /third_party/retdec-3.2/src/fileformat/types/resource_table/resource_table.cpp | UTF-8 | 7,708 | 2.90625 | 3 | [
"MIT",
"GPL-1.0-or-later",
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference",
"OpenSSL",
"WTFPL",
"LGPL-2.1-only",
"LicenseRef-scancode-openssl",
"LicenseRef-scancode-ssleay-windows",
"LGPL-2.0-or-later",
"JSON",
"Zlib",
"NCSA",
"LicenseRef-scancode-proprietary-license",
"G... | permissive | /**
* @file src/fileformat/types/resource_table/resource_table.cpp
* @brief Class for resource table.
* @copyright (c) 2017 Avast Software, licensed under the MIT license
*/
#include <sstream>
#include "retdec/utils/conversion.h"
#include "retdec/fileformat/types/resource_table/resource_table.h"
using namespace ... | true |
9258071f4d1f69c263ae02a6fce04d2dcecc0b70 | C++ | ji12345ba/CS225-UIUC | /mp7/DirectedEdge.h | UTF-8 | 264 | 3 | 3 | [] | no_license | #pragma once
#include "Vertex.h"
#include "Edge.h"
class DirectedEdge : public Edge {
public:
DirectedEdge(const Vertex & source, const Vertex & dest, double weight = 1) :
Edge(source, dest, weight) { };
bool directed() const { return true; }
}; | true |
38c397b2a70a47b41385ff1797341741b8326ce9 | C++ | anshumanvarshney/CODE | /Basic Implementation/linkedlist/no need/concatll.cpp | UTF-8 | 1,602 | 3.9375 | 4 | [] | no_license | #include<iostream>
using namespace std;
class list
{
private:
struct node
{
int data;
node *link;
}*p; //p always points to first element;
public:
list();
void append(int);
void display();
void count();
void concat(list &l);
~list();
};
list::list()
{
p=NULL;
}
void li... | true |
8a71b6397b79c0946d4a27f31a2077cbc50fcecb | C++ | Koura/sibot | /SIBot/StateMastermind.h | UTF-8 | 861 | 2.59375 | 3 | [] | no_license | #pragma once
#include <BWAPI.h>
#include <vector>
#include <sstream>
#include <limits>
class StateMastermind
{
public:
StateMastermind();
~StateMastermind();
void create(int enemyCount);
void destroy();
int observe(BWAPI::Unit* hero, std::set<BWAPI::Unit*> enemies);
void setPrevious(int value);
int getPrevious(... | true |
4a801d8e7da9c9da3f0cce8619391987cc23b090 | C++ | mathiasuy/p4-lab2 | /src/logica/Sala.cpp | UTF-8 | 1,920 | 2.953125 | 3 | [] | no_license | #include "../../include/logica/Sala.h"
#include "../../include/logica/Cine.h"
#include <iostream>
int Sala::getID(){
return this->id;
};
void Sala::setID(int id){
this->id = id;
};
int Sala::getCapacidad(){
return capacidad;
};
void Sala::setCapacidad(int capacidad){
this->capacidad = capacidad;
... | true |
7044d2247e8227b29ff3e27896f7db385a06f029 | C++ | DHaythem/Competitive-Programming-Solutions | /Codeforces/800/A. Anton and Danik.cpp | UTF-8 | 439 | 2.5625 | 3 | [] | no_license | //https://codeforces.com/problemset/problem/734/A
#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout.precision(30);
using namespace std;
int main()
{
IOS;
int a=0,d=0,n;
string s;
cin>>n>>s;
for(int i=0;i<s.size();i++){
if(s[i]=='A') a++;
els... | true |
5c96a245324f4ffc80730c15a1b1db8cec697b30 | C++ | jjzhang166/WinNT5_src_20201004 | /NT/inetsrv/iis/admin/snapin/svc.cpp | UTF-8 | 10,543 | 2.65625 | 3 | [] | no_license | #include "stdafx.h"
#include "common.h"
#include "svc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//----------------------------------------------------------------------------------------
//Routine Description:
// This routine allocates a buffer f... | true |
f75ddc7489856032ed1b9d33fe426376b526f482 | C++ | talott/DijkstrasAlgorithm | /main.cpp | UTF-8 | 4,656 | 2.984375 | 3 | [] | no_license | #include "graph.h"
#include "util.h"
#include "main.h"
#include "stdlib.h"
#include "string.h"
VERTEX *V;
int main(int argc, char *argv[]) {
FILE *ifile;
pNODE *A;
pNODE node;
char word[256];
char word2[256];
int n,m, directed_graph,i;
int s, s_new, t, t_new, source, sourc... | true |
edd3a3b9a8283d81061521b1c077f5b5cb646bec | C++ | lazyrun/kenay | /src/common/DirectMap/src/DirectMap.h | WINDOWS-1251 | 11,218 | 2.9375 | 3 | [] | no_license | /*! \file DirectMap.h
\date 15.05.2009
\brief "" QMap,
\author Kiselev Kirill
*/
#ifndef DIRECTMAP_H
#define DIRECTMAP_H
/*! \class DirectMapIterator
\brief DirectMapIterator
*/
class DirectMapIterator;
#define Q_DECLARE_METATYPE_COMMA(...) \
QT_BEGIN_N... | true |
21f525d9634ff49551f5edc5d6aef09b0a755b0b | C++ | jtlai0921/AEL000500 | /AEL000500_code (1)/ch11/ex11_3/ex11_3.cpp | UTF-8 | 722 | 3.859375 | 4 | [] | no_license | // Program 11.3 Making use of a Person
#include <iostream>
using namespace std;
#include "person.h"
int main()
{
Person her = {
{ "Letitia", "Gruntfuttock" }, // Initializes Name member
{1, 4, 1965 }, // Initializes Date member
{212, 5551234 ... | true |
d8ac947c806a19a806ad4d9948c3e9b7b93a1911 | C++ | santolucito/CCache | /LZOTester.cc | UTF-8 | 3,772 | 2.84375 | 3 | [] | no_license | // LZOTester.cc
// Scott F. Kaplan -- sfkaplan@cs.utexas.edu
// August 1997
// A tester designed to work on the Lempel-Ziv-Oberhumer
// compression/decompression algorithm. Note that we've chosen to use
// the LZO1f variant--according to the results provided by Oberhumer,
// that variant does best with short compress... | true |
fcaed18a05913fae66cbe89951b4b2babb1f9188 | C++ | chromium/chromium | /third_party/abseil-cpp/absl/functional/function_ref_test.cc | UTF-8 | 8,329 | 2.515625 | 3 | [
"BSD-3-Clause",
"GPL-1.0-or-later",
"MIT",
"LGPL-2.0-or-later",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Copyright 2019 The Abseil Authors.
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agr... | true |
a4d47dad18741d3059e14be22bef18098dddbcce | C++ | lintcoder/leetcode | /src/1114.cpp | UTF-8 | 740 | 3.015625 | 3 | [] | no_license | class Foo {
public:
Foo() {
flag1 = 0;
flag2 = 0;
}
void first(function<void()> printFirst) {
// printFirst() outputs "first". Do not change or remove this line.
printFirst();
flag1 = 1;
}
void second(function<void()> printSecond) {
... | true |
4b30aaaf4dfd26f9d1f716309631fb068c412d8f | C++ | wtmitchell/challenge_problems | /include/project_euler/0001-0050/Problem7.h | UTF-8 | 1,196 | 2.734375 | 3 | [
"MIT"
] | permissive | //===-- project_euler/Problem7.h --------------------------------*- C++ -*-===//
//
// Challenge Problem solutions by Will Mitchell
//
// This file is distributed under the MIT License. See LICENSE for details.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// \brief ... | true |
5123796ebeaa8f4acc8c239cd6b0582da2d2399c | C++ | JustinLiu1998/ECNU-Online-Judge | /2853/main.cpp | UTF-8 | 1,218 | 2.78125 | 3 | [] | no_license | //
// main.cpp
// 2853
//
// Created by 刘靖迪 on 2017/11/29.
// Copyright © 2017年 刘靖迪. All rights reserved.
//
#include <iostream>
#include <set>
#include <vector>
using namespace std;
set<int> a, b;
vector<int> U, I, D;
void print (vector<int> &x) {
printf("{");
auto iter = x.begin();
printf("%d", *iter... | true |
dc936a1e1b8fc33c1d2b06939f85915ba75b5e98 | C++ | meganfeichtel/ray-tracer-1 | /RayTracer/Tracers/Tracer.cpp | UTF-8 | 483 | 2.6875 | 3 | [] | no_license | //
// Tracer.cpp
// RayTracer
//
// Created by Megan Feichtel on 11/24/14.
// Copyright (c) 2014 Megan Feichtel. All rights reserved.
//
#include "Tracer.h"
Tracer::Tracer(void)
: world_ptr(NULL)
{}
Tracer::Tracer(World* _worldPtr)
: world_ptr(_worldPtr)
{}
Tracer::~Tracer(void) {
if (world_ptr)
... | true |
f94ffa690b13e2327d3f0936b110317b5e7169bf | C++ | Shreyansh0001/codes | /fibonacci_series.cpp | UTF-8 | 245 | 2.671875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int a=1,b=1,c;
cout<<a<<"\t"<<b <<"\t";
while(n>2)
{
c = a+b;
a=b;
b=c;
cout<<c<<"\t";
n--;
}
return 0;
} | true |
5e2f8586c570d3f01960816ceb1e8347993d3a84 | C++ | abhishekreddy/Prac | /src/prac.cpp | UTF-8 | 1,376 | 2.859375 | 3 | [] | no_license | /*
* prac.cpp
*
* Prac file
*
* Copyright (C) 2016 Abhishek Reddy kondaveeti
*
* Contributor: Abhishek Reddy Kondaveeti <abhishek.kondaveeti@gmail.com>
*
*
* This file is licensed under the terms of the GNU General Public License
* version 2. This program is licensed "as is" without any warranty of any
* ki... | true |
bb1448838cb4a728d3dfc1a515e8c065c88cee3e | C++ | crpeter/Coms352_OperatingSystems | /Cody_Peter_Project2/alloc.cpp | UTF-8 | 3,546 | 2.859375 | 3 | [] | no_license | /*
* created by Cody Peter
* for the purpose of allocating resources from the available map.
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <assert.h>
#include <iostream>
#include <errno.h>
#include <sys/i... | true |
494eb61081331164c24b34d345951f168631a8ec | C++ | Nur47-blip/Random | /DSU dan DFS.cpp | UTF-8 | 1,358 | 2.59375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define pii pair<int, int>
#define fi first
#define se second
#define trace(x) cout << '>' << #x << ':' << x << "\n"
#define trace2(x,y) cout<< '>' << #x << ':' << x << " | " << #y << ':' << y << "\n"
#define trace3(a,b,c) cout<<... | true |
f172f5e4de26943e01a94f4a3e1d614ec6ddac3b | C++ | mgh3326/Major_Deeped_Lab1_hw3_Huffman | /Major_Deeped_Lab1_hw3_Huffman/HuffmanCodes.h | UTF-8 | 2,814 | 3.640625 | 4 | [] | no_license | #pragma once
// C++ program for Huffman Coding
// This constant can be avoided by explicitly
// calculating height of Huffman Tree
// A Huffman tree node
struct MinHeapNode {
// One of the input characters
unsigned char data;
// Frequency of the character
unsigned freq;
// Left and right child of this n... | true |
edcc3aae516558e0dd62a2042addb64fc459601e | C++ | zivl/Crush-Around | /src/Core/MyContactListener.cpp | UTF-8 | 1,562 | 2.59375 | 3 | [] | no_license | #include "MyContactListener.h"
MyContactListener::MyContactListener(void) : m_contacts()
{
}
MyContactListener::~MyContactListener(void)
{
}
// Handle begin contact event.
// The data from contact is copied because b2Contact passed in is reused
void MyContactListener::BeginContact(b2Contact* contact) {
i... | true |
8dd5c338f5b8b1bdf9b00a2b3b4fc04564c61ddd | C++ | solariums/Roc_proj | /study_src/toupper.cpp | UTF-8 | 613 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <cctype>
using std::cout;
using std::cin;
using std::endl;
using std::string;
using std::vector;
int main()
{
vector<string> vecStr;
string strTemp;
while(cin>>strTemp){
vecStr.push_back(strTemp);
//cin.clear();
//cin.sync();
}
for(vector<... | true |
1a7a000571546e416f2ba1f1f4b642b9e35dc737 | C++ | albertnez/uva-online-judge | /problems/452.cc | UTF-8 | 1,343 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <sstream>
using namespace std;
typedef vector<int> Vi;
typedef vector<Vi> Mi;
const int n = 27;
Vi topo;
Mi g;
vector<bool> vis;
void dfs(int u) {
vis[u] = true;
for (int i = 0; i < g[u].size(); ++i) {
if (!vis[g[u][i]])
dfs(g[u][i]);
}
topo.push... | true |
b78e28952f2ffbf6fa6cdaca562033924d7f6557 | C++ | Cell-veto/postlhc | /tools.cpp | UTF-8 | 7,497 | 2.6875 | 3 | [] | no_license | // (c) 2015-2018 Sebastian Kapfer <sebastian.kapfer@fau.de>, FAU Erlangen
// various utilities.
#include "tools.hpp"
#include <cstdlib>
#include <signal.h>
#include <fstream>
#include <stdexcept>
#include <iomanip>
#include <sstream>
#include <sys/time.h>
#include <sys/stat.h>
#include <unistd.h>
#include <boost/algori... | true |
9a380780b6d92de045a173b891beb5351ad52787 | C++ | ok-google/praktikum | /Praktikum/modul1.cpp | UTF-8 | 469 | 3.09375 | 3 | [] | no_license | #include <iostream>
using namespace std;
void modul1()
{
float uangsila;
float uangdidi;
cout<<"Jumlah Uang Sila dan uang Didi adalah Rp 56.000 \n";
cout<<"Uang Sila lebih banyak Rp 600 dari uang Didi \n";
uangsila=(56000+600)/2;
uangdidi=(56000-600)/2;
cout<<"\nUang Sila = Rp "<<uan... | true |
552cc3bd9f3ba060823e2c87f90687e323602820 | C++ | usnistgov/OOF1 | /XOOF/elementfunction.h | UTF-8 | 4,018 | 2.828125 | 3 | [] | no_license | // -*- C++ -*-
// $RCSfile: elementfunction.h,v $
// $Revision: 1.5 $
// $Author: langer $
// $Date: 2000-12-05 21:30:32 $
/* This software was produced by NIST, an agency of the U.S. government,
* and by statute is not subject to copyright in the United States.
* Recipients of this software assume all responsibili... | true |
4cb5946592fff3fdac324a46cfe48928f111bba4 | C++ | o-h-w-o-w/practice | /February 19, 2018 - [C++] Test Scores (structures)/TestScoreAndStructuresLab/src/TestScoreAndStructuresLab.cpp | UTF-8 | 3,060 | 3.859375 | 4 | [] | no_license | /* Julian Mayugba
* Professor A
* February 19, 2018
* Test Scores [structures no functions]
*/
#include <iostream>
#include <iomanip>
#include <string>
// Date Structure
struct Date{
int Month, Day, Year;
};
// Student Information Structure
struct StudentInfo{
Date Grad;
int Id;
std::string FirstName, MiddleNam... | true |
bccf2463b099e396866d99a3b07e4e7241e7eb7e | C++ | Shuaibahmed1/shuaib.github.io | /Website.cpp | UTF-8 | 196 | 3.28125 | 3 | [] | no_license | #include <iostream>
using namespace std;
void swap (int a, int b){
int temp = b;
b=a;
a = b;
}
int main () {
cout << endl;
int a = 5, b = 10;
swap(a,b)
cout << a <<" " << b << endl;
return 0;
}
| true |
dfce56b97cdd6e8814a147d38a4f9b7068f2a8bb | C++ | MatWiecz/AGH-C- | /lab-4/figure.h | UTF-8 | 445 | 2.71875 | 3 | [] | no_license | //
// Created by matthew on 11.04.19.
//
#ifndef LAB_4_FIGURE_H
#define LAB_4_FIGURE_H
#include "point.h"
namespace lab4 {
class Figure {
protected:
Point middle;
string label;
public:
string description;
double area;
Figure ( const Point &, const string & );
virtual ~Figure ( );
void move ( co... | true |
72a60cce8138f8457b5392ac96a33510a52c5ecf | C++ | dditota-esu/getThisBread | /CardAreaViewTest/RowOfStacks.h | UTF-8 | 1,064 | 2.859375 | 3 | [] | no_license | //RowOfStacks header file
#if !defined ROWOFSTACKS_H
#define ROWOFSTACKS_H
#include "IListOfLists.h"
#include <vector>
class Stack;
class RowOfStacks : public IListOfLists
{
private:
std::vector<Stack*> stackList;
int currentList;
public:
RowOfStacks();
~RowOfStacks();
// must implement all the... | true |
4cb66901c59b1d9ab6805784155137f56594a721 | C++ | Tinwrks/TaiLeeCSC5 | /Lab/TernaryOperator_With_A_Paycheck/main.cpp | UTF-8 | 965 | 3.203125 | 3 | [] | no_license | /*
* File: main.cpp
* Author: Tai Lee
* Purpose: Paycheck calculations with ternary operation
* Created on June 23, 2016, 1:37 PM
*/
#include <iostream>
#include <cstdlib>
#include <iomanip>
using namespace std;
/*
*
*/
int main(int argc, char** argv) {
//declared variables
float hrsWrkd=50;//Hou... | true |
523d797da2ea6278ce4f46150578d9321160f6b1 | C++ | VasiPeycheva/Introduction-to-Programming--2017-2020 | /04_scopes_nested_loops/practice/task_04.cpp | UTF-8 | 793 | 3.21875 | 3 | [] | no_license | /****************************************************************************
* This file is part of the "Introduction to programming" course. FMI 2019/20
*****************************************************************************/
/**
* @file task_04.cpp
* @author Ivan Filipov
* @author Kristian Krastev
... | true |
80b7aae057d842f22c7ac697fefc0d386fa0156f | C++ | Felpat0/Matrix-Decomposition-AnalisiNumerica2 | /householder.cpp | UTF-8 | 2,390 | 3.234375 | 3 | [] | no_license | #include "algebra.h"
int main(){
int n;
cout<<"Insert the dimension of the matrix: ";
cin>>n;
Matrix m = Matrix(n);
//Set the values of the matrix
m.setMatrix();
int i = 0;
for(int i = 0; i != m.dimension -1; i++){
myVector app = myVector(m.dimension);
myVector temp = my... | true |
1cdccd02cf6e92b9ee824629b864cde45b058218 | C++ | alonso804/POO-I-Asesorias | /Semana-5/unsolved/e3.cpp | UTF-8 | 963 | 3.84375 | 4 | [] | no_license | #include <iostream>
using namespace std;
void print(int*, int);
void insertionSort(int*&, int);
int main(int argc, char *argv[]) {
int tamano = 0;
cout << "Ingrese tamaño: ";
cin >> tamano;
int* mi_array = new int[tamano];
for(int i = 0; i < tamano; i++) {
cin >> *(mi_array + i);
}
cout << "Original: "... | true |
5df38ebbe0a923464ed4666dc50e6c0871a773fa | C++ | Teddytws/111-Demos | /sets/demo.cpp | UTF-8 | 523 | 3.484375 | 3 | [] | no_license | #include <set>
#include <iostream>
//insert
//iterator - begin - end
//empty
//find
//count
using namespace std;
int main() {
set<int> myset;
set<int>::iterator it;
myset.insert(20);
myset.insert(30);
myset.insert(40);
myset.insert(50);
myset.insert(60);
it = myset.find(50);
if (it != myset.end())
... | true |
a430fc5fd35ce6d6aa66f7846e6fb0f3e1d8c261 | C++ | Swire42/EasySDL | /EasySDL-key2char.cpp | UTF-8 | 14,864 | 2.640625 | 3 | [
"MIT"
] | permissive | #include "EasySDL.hpp"
#include "EasySDL-key2char.hpp"
/// LETTERS --------------------------------------------------------------------------------------
void key2char::write_a()
{
bool upper=false;
if (SDL_GetModState() & KMOD_SHIFT) upper=true;
if (SDL_GetModState() & KMOD_CAPS) upper=1-upper;
if (!upper)
{
... | true |
a3f563ebcb2aa14e2fc68c59c1e9595943ef9c17 | C++ | echowsy/opengl_songho | /glWinSimple/src/ModelGL.h | UTF-8 | 1,293 | 2.828125 | 3 | [] | no_license | ///////////////////////////////////////////////////////////////////////////////
// ModelGL.h
// =========
// Model component of OpenGL
//
// AUTHOR: Song Ho Ahn (song.ahn@gmail.com)
// CREATED: 2006-07-10
// UPDATED: 2006-07-10
///////////////////////////////////////////////////////////////////////////////
#ifndef M... | true |
4fdea9c7b1f28f08a17c1b6d6de6f2e87cf76db5 | C++ | zlpetersen/asteroids | /Asteroids/Bullet.cpp | UTF-8 | 1,254 | 3.109375 | 3 | [] | no_license | #include "Bullet.h"
#include <iostream>
Bullet::Bullet(double rotation, sf::Vector2f pos)
{
rot = rotation; // assign instance rotation
// create bullet texture //
t = new sf::Texture;
t->loadFromFile("Bullet.png");
t->setSmooth(true);
// assign bullet texture and set origin, position, rotation /... | true |
8a1698aea0783a90b9ea2bef491d9300fdb89a3c | C++ | bajajtushar094/Competitive-Programming | /cp/prefix.cpp | UTF-8 | 784 | 2.65625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
vector<ll> numbers;
ll sum_suffix=0;
for(int i=0;i<n;i++)
{
ll c;
cin>>c;
numbers.push_back(... | true |
f0ef4394031e908bf6f0fbf89b6876821323f387 | C++ | adityeah8969/projects_cpp | /primsMST.cpp | UTF-8 | 2,224 | 3.125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
list<pair<int,int>> Adj[105];
int N;
int key[105];
int parent[105];
bool mst[105];
priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>> pq;
void addEdge(int u,int v,int w){
Adj[u].push_back(make_pair(v,w));
Adj[v].push_back(make_... | true |
20a9056cdf2f75d4ab567871806839de3b5cf8d6 | C++ | 2020wmarvil/top-down-platformer | /include/tile.h | UTF-8 | 165 | 2.890625 | 3 | [
"MIT"
] | permissive | #pragma once
class Tile {
private:
int tile_id;
public:
Tile(int tile_id) { this->tile_id = tile_id; }
~Tile() {}
int getTileID() const { return tile_id; }
};
| true |
d06df89633cba66b9e2c243d7d3309ffbe0e9011 | C++ | genie97/ALGORITHM | /BOJ_ALGORITHM/1867_돌맹이 제거.cpp | UTF-8 | 608 | 2.515625 | 3 | [] | no_license | #include<cstdio>
#include<vector>
#include<string.h>
using namespace std;
int n, k, bm[502];
bool visit[502];
vector <vector<int>> vt;
bool dfs(int v){
if (visit[v])
return false;
visit[v] = true;
for (int next : vt[v]) {
if (!bm[next] || dfs(bm[next])) {
bm[next] = v;
return true;
}
}
return false;
}
... | true |
23a36a9756db0866351b7432c3cf1bed5af5c600 | C++ | gatlinfarrington/summer21 | /c++ work/assignment1.cpp | UTF-8 | 687 | 3.59375 | 4 | [] | no_license |
#include <iostream>
#include "assignment1.hpp"
#include <string>
#include <cstring>
class Movie{
private:
std::string name;
std::string Director;
std::string releaseDate;
std::string Rating;
public:
Movie(std::string n="", std::string d="", std::string r="", std::string rd=""){
name=n;
... | true |
fafc9431013eccc0a7ece99c70b4d43f13423277 | C++ | namehao465/Essential-Cplusplus | /Essential C++/04 Object-Based Programming/main.cpp | UTF-8 | 1,075 | 3.40625 | 3 | [] | no_license | #include<iostream>
#include<istream>
#include"Stack.h"
#include"Triangular.h"
#include"Matrix.h"
#include<string>
using namespace std;
void fill_stack(Stack &stack,ostream &os = cout, istream &is = cin);
void test_Stack();
void test_Triangular();
void test_Matrix();
int sum(Triangular &trian);
int main() {
//test_Stac... | true |
5a8d2fe04593722f1a041e12447b63cf1a098802 | C++ | Ketan-Suthar/Algorithms | /Greedy Algorithms/LargestPalindromicNumberPermutingDigits/GFG.cpp | UTF-8 | 895 | 3.609375 | 4 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
bool isPalindrome(int arr[])
{
int odds=0;
for(int i=0; i<9; ++i)
{
if(arr[i] != 0 && (arr[i] & 1))
++odds;
if(odds > 1)
return false;
}
return true;
}
void largestPalindrome(string s)
{
int nums[10] = {0};
for(char x: s)
nums[x - '0']++;
if(!isPal... | true |
addc6306fc3343206d75cd6698846150767f6ba6 | C++ | erich-gatejen/Arduino | /sketch_oct08b/sketch_oct08b.ino | UTF-8 | 358 | 2.625 | 3 | [] | no_license | void setup() {
// put your setup code here, to run once:
pinMode(15, OUTPUT);
pinMode(16, OUTPUT);
pinMode(17, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
analogWrite(15, 200);
analogWrite(16, 200);
analogWrite(17, 200);
delay(2000);
analogWrite(15, 0);
analogW... | true |
8a7ebaed80d24849ef50d21a4e9595ce84bb7d20 | C++ | mikechen66/CPP-Programming | /CPP-Programming-Principles/chapter23-text/ex06_dates.cpp | UTF-8 | 1,266 | 3.609375 | 4 | [] | no_license | //
// Stroustrup - Programming Principles & Practice
//
// Chapter 23 Exercise 6 - Date Finder
//
// Write a program that finds dates in a text file. Write out each line that
// contains at least one date.
//
#include <iostream>
#include <stdexcept>
#include <string>
#include <regex>
#include <fstream>
bool has_date(... | true |
de5dfe58caea41ce40eb04944fadb02ee2155038 | C++ | abivlqz/Algoritmos | /Algoritmos/Tar01/tar01.cpp | UTF-8 | 1,904 | 3.875 | 4 | [] | no_license | //
// tar01.cpp
// Algoritmos
//
// Abigail Guadalupe Velazquez Sanchez A01566592 Grupo1
// Creado el 13/02/2021
/* Este programa solicita al usuario un tipo de dato string que contenga varios caracteres duplicados y continuos con excepcion de un caracter, el programa encuentra y devuelve este caracter unico dentr... | true |
b7f0bf57eb8a1b07f5f293358a7740c25570ac52 | C++ | MartinMueller-StudioMood/PFMCPP_Project3 | /main.cpp | UTF-8 | 9,374 | 3.125 | 3 | [] | no_license | /*
Project 3 - Part 3 / 5
video: Chapter 2 - Part 8
Constructors tasks
Create a branch named Part3
On this new branch:
1) Add a constructor for each User-Defined-Type.
2) amend some of your UDT's member functions to print out something interesting via std::cout
3) Instantiate 1 or 2 instances of each of ... | true |
915bfb9240f82730242ec79b93901cef00b2dd54 | C++ | FabioVL/Treinamento---Maratona | /2015-2016 ACM-ICPC Pacific Northwest Regional Contest (Div. 2)/m.cpp | UTF-8 | 526 | 2.671875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
string op;
int v,n,a[105],cont=0,p[105];
scanf("%d",&n);
for(int i=1;i<=100;i++) a[i]=i, p[i]=0;
for(int i=0;i<n;i++)
{
cin >> op >> v;
for(int j=1;j<=100;j++)
{
if(op == "ADD") a[j] += v;
else if(op == "SUBTRACT")
{
a[j] -= v;
i... | true |
0262bb98378b8946dfe37fbcad8eee6b4ce3498f | C++ | ctrlMarcio/feup-cal-proj | /test/model/company_client/company_client_test.cpp | UTF-8 | 1,836 | 3.171875 | 3 | [
"MIT"
] | permissive | #include <gtest/gtest.h>
#include <model/company_client/company_client.h>
using testing::Eq;
CompanyClient createCompanyClient() {
CompanyRepresentative companyRepresentative("nome", "email@email.com");
Location location(1, "a", 1, 1);
CompanyClient companyClient("company", companyRepresentative, location... | true |
feddc4fe34d194dee8cb31e2c5ba75e3adad5a3f | C++ | a-ewais/Image-sharing-app | /profile.cpp | UTF-8 | 2,100 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | #include "profile.h"
#include "ui_profile.h"
#include <QString>
#include <QMessageBox>
#include <QFileDialog>
#include <opencv2/core.hpp>
Profile::Profile(QWidget *parent, User* _user) :
QMainWindow(parent),
ui(new Ui::Profile)
{
ui->setupUi(this);
user = _user;
fillList();
}
Profile::~Profile()
{... | true |
8323d42f672baf48dd09d2783911bb8115d1fc63 | C++ | WHO-A-U/Programmers | /C++/리틀프렌즈사천성.cpp | UTF-8 | 2,785 | 2.859375 | 3 | [] | no_license | #include <string>
#include <vector>
#include <cstring>
#include <algorithm>
#include <queue>
#include <iostream>
using namespace std;
char map[101][101];
int rs,cs;
int dx[]={1,-1,0,0};
int dy[]={0,0,1,-1};
// 전역 변수를 정의할 경우 함수 내에 초기화 코드를 꼭 작성해주세요.
bool isPossible(pair<int,int> cur){
int r = cur.first;
int c =... | true |
9bfaf106202253c83f6c319e0889a90ccd19d95b | C++ | iomeone/CSGOCheat | /Trace.h | UTF-8 | 1,019 | 2.59375 | 3 | [] | no_license | #pragma once
#include "EngineTrace.h"
#include "RandomStuff.h"
class ITraceEngine
{
public:
int GetPointContents(const Vector &vecAbsPosition, int contentsMask = MASK_ALL, entity** ppEntity = NULL)
{
typedef int(__thiscall* original)(void*, const Vector&, int, entity**);
return vfunction<original>(this, 0)(this... | true |
4c860905515b3f8cc8c7323cf458ac3b3a062781 | C++ | imsong52/Q.solution | /leetcode/122.best-time-to-buy-and-sell-stock-ii.cpp | UTF-8 | 1,065 | 3.3125 | 3 | [] | no_license | /*
* [122] Best Time to Buy and Sell Stock II
*
* https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii
*
* Easy (45.87%)
* Total Accepted: 127430
* Total Submissions: 277759
* Testcase Example: '[]'
*
* Say you have an array for which the ith element is the price of a given
* stock on day i.
... | true |
2ad78cacb446cc9ab379b3387c24fbcce7d17be6 | C++ | YoungWoo93/BOJ | /BOJ/cpp/15650 N과 M(2)/15650.cpp | UTF-8 | 881 | 2.953125 | 3 | [] | no_license | #include <problem.h>
#ifdef _15650_
///
/// problem
/// https://www.acmicpc.net/problem/15650
///
/// solution
///
///
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
using namespace std;
void process(int maxIndex, int curIndex, int targetSize, vector<int>& curArr... | true |
27a5e65fd1c9be30a34fbc17c5413e61e3c4f171 | C++ | 477918269/C-cpp | /3.28/3.28/template.h | WINDOWS-1252 | 226 | 2.71875 | 3 | [] | no_license | #pragma once
template<class T>
T Add(const T& a, const T& b);//ʾʵ
int add(int a, int b);
template
int Add<int>(const int& a, const int&b);
template<class T>
T Add(const T&a, const T&b)
{
return a + b;
}
| true |
15f8949201887adb5545db5356dceb18c64008d0 | C++ | sahib-pratap-singh/Placement-Series | /SDE Problems/Day6/IntersectionofTwoLinkedLists.cpp | UTF-8 | 299 | 3 | 3 | [] | no_license | class Solution {
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
ListNode * d1 =headA;
ListNode * d2 =headB;
while(d1!=d2){
d1 = d1==NULL?headB:d1->next;
d2 = d2==NULL?headA:d2->next;
}
return d1;
}
}; | true |
832d79bfefd1a32d7ef5e8d171b68dbc104d6a2f | C++ | coding-blocks-archives/Launchpad-LIVE-June-2017 | /Lecture-20 BSTs and Heaps/bsts.cpp | UTF-8 | 6,002 | 3.703125 | 4 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
class node{
public:
int data;
node*left;
node*right;
node(int d){
data = d;
left = NULL;
right = NULL;
}
};
///Print the tree level by level
void levelOrderPrint2(node*root){
queue<node*> q;
q.push(root);
q.push(NU... | true |
b485ad778f52130298c9a0c30b08692d07ca4abf | C++ | pluto16/leetcode | /102 Binary Tree Level Order Traversal.cpp | UTF-8 | 1,242 | 2.984375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <math>
#include <string>
typedef struct TreeNode{
TreeNode* left;
TreeNode* right;
int value;
TreeNode(int x, ){}
}TreeNode;
class soluton{
public:
vector<vector<int> > levelOrder(TreeNode* pRoot){
vector<vector<int> > res;... | true |
9c9405b20cdc1e4b6f57bf5369b21b58b68a7703 | C++ | andreasfertig/notebookcpp-tips-and-tricks-with-templates | /21.03-codeBloat1/main.cpp | UTF-8 | 551 | 3.234375 | 3 | [
"MIT"
] | permissive | // Copyright (c) Andreas Fertig.
// SPDX-License-Identifier: MIT
#include <cstdio>
int Open()
{
return 1;
}
void Close(int) {}
void write(int, const char*, size_t) {}
namespace details {
void Write(const char* data, const size_t size)
{
const int fd = Open();
// do some additional things
write(f... | true |
933ed012d5e5db14995ecc6b69e0dfd728a77d21 | C++ | adarsh1github1/Competetive-codeforces-codechef- | /solving sudoku (backtracking).cpp | UTF-8 | 2,515 | 3.28125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
#define n 9
#define unassigned 0
// this function check if any cell left is unsassigned or not.... if unassigned left then row and col values are assigned
bool finsunassigned(int sudoku[n][n],int& row, int& col){
for(row =0;row<n;row++){
for(col=0;col<n;co... | true |
30b717c7d830c7df8e100e0988b0af8c496a46de | C++ | lanChe-4869/acm-templateCode | /费用流.cpp | UTF-8 | 1,129 | 2.78125 | 3 | [] | no_license |
const int N
const int M
const int inf=0x3f3f3f3f;
int head[N],cnt;
struct edge{
int to,cap,cost,next;
edge(){}
edge(int to,int cap,int cost,int next):to(to),cap(cap),cost(cost),next(next){}
}e[M];
void add(int u,int v,int cap,int w){
e[cnt]=edge(v,cap,w,head[u]);
head[u]=cnt++;
e[cnt]=edge(u,0,-w,head[v]);
he... | true |
0eb4f45e86a74ba26fde29946e1a7b3c36fcf5eb | C++ | mochang2/cpp-practice | /Kutzner_c++_ta10.cpp | UTF-8 | 1,433 | 3.1875 | 3 | [] | no_license | #include <iostream>
#include <cstring>
//#define _CRT_SECURE_NO_WARNINGS
using namespace std;
//template<typename T>
//T add(T a, T b)
//{
// return a + b;
//}
//template<typename T, typename U>
//T add(T a, U b)
////U add(T a, U b)
//{
// return a + b;
//}
//template<typename T>
//T add(T a, T ... | true |
da22820ee79c826c876e28cea5a46bde6c8e0530 | C++ | walkccc/LeetCode | /solutions/0359. Logger Rate Limiter/0359-2.cpp | UTF-8 | 274 | 2.609375 | 3 | [
"MIT"
] | permissive | class Logger {
public:
bool shouldPrintMessage(int timestamp, string message) {
if (timestamp < okTime[message])
return false;
okTime[message] = timestamp + 10;
return true;
}
private:
unordered_map<string, int> okTime; // {message: ok time}
};
| true |
07d07d1964f306696719fb754b45f070d2b64b5e | C++ | tomaz-cvetko/game-of-life | /src/window.h | UTF-8 | 590 | 2.78125 | 3 | [] | no_license | #ifndef WINDOW_HANDLER_H
#define WINDOW_HANDLER_H
class WindowHandler{
public:
//Starts up SDL and creates window
bool init();
//Loads media
bool loadMedia();
//Frees media and shuts down SDL
void close();
//Loads individual image as texture
SDL_Texture* loadTexture( std::string ... | true |
95717a837361d74e4ac66387b76922932c896377 | C++ | HafizMuhammad-Farooq786/Data-Structure-Algorithms-PUCIT | /UB/HW6/HW6/Source.cpp | MacCentralEurope | 2,673 | 3.390625 | 3 | [] | no_license | #include<iostream>
#include<fstream>
using namespace std;
struct AccountRecord{
int recNum; //Record number
int acctID; //Student identifier
char firstName[10]; //First name
char lastName[10]; //Last name
char program[10]; //degree program of a student
double cgpa; //Students CGPA
};
struct IndexEntry{
int acc... | true |
dd47246b3a3e445afd080b35d19ab6df1f60254b | C++ | lumt/cpp_intro | /exam/sonnet/sonnet.cpp | UTF-8 | 5,201 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include <cstring>
#include <cctype>
#include <cassert>
#include <map>
#include <string>
#include <fstream>
using namespace std;
#include "sonnet.h"
/* PRE-SUPPLIED HELPER FUNCTIONS START HERE */
/* NOTE: It is much more important to understand the interface to and
the "black-box" operation of... | true |
615c7908d56944f315af29fb512f3df1ea23eb46 | C++ | jeremimucha/Project-Stubs | /C++/large_test/src/toplevel.cpp | UTF-8 | 297 | 2.78125 | 3 | [] | no_license | #include <iostream>
#include "toplevel.hpp"
auto toplevel_function( gsl::span<int> ints ) noexcept -> void
{
auto first = true;
for( auto i : ints ){
if( !first ){
std::cout << ", ";
first = false;
}
std::cout << i;
}
}
| true |
e3f630a883aab29fc806937b5e0e54a2d529c282 | C++ | webturing/ACM-1 | /按 OJ 分类/出处遗忘/f-乐视2017实习-兵临城下/f-乐视2017实习-兵临城下/main.cpp | UTF-8 | 872 | 2.546875 | 3 | [] | no_license | //
// main.cpp
// f-乐视2017实习-兵临城下
//
// Created by ZYJ on 2018/3/23.
// Copyright © 2018年 ZYJ. All rights reserved.
//
#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
const int MAXN = 6;
int n, ans;
string s[MAXN];
int vis[MAXN];
void dfs(int p)
{
if (p == n)
{
ans... | true |
d485acac333d3d3076cc48152e391965b6f1d3e9 | C++ | odeded/acRemoteControl | /src/Electra-AC-Remote-Encoder/electraAcRemoteEncoder.cpp | UTF-8 | 4,354 | 2.65625 | 3 | [] | no_license | #include "electraAcRemoteEncoder.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
void initializeStruct (struct airCon* newAcPointer)
{
int i = 0;
newAcPointer->fullState = FULL_STATE_MASK;
newAcPointer->fan = FAN_MASK;
newAcPointer->mode = MODE_MASK;
newAcPoint... | true |
d00f8c40290ca07c5c5aad544ab8714411d6d4d7 | C++ | osdbms/vanakkam | /execsyscall.cpp | UTF-8 | 785 | 3.140625 | 3 | [] | no_license | #include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>
void main()
{
int choice;
do
{
printf("select the option\n");
printf("1.Execute ls command \n");
printf("2.Execute pwd command \n");
printf("3.Execute whoami command \n");
printf("4.Sleep\n");
printf("... | true |
f0dcf60ce26defb9ccd81f74e6cc045ed7e9832a | C++ | nannancy/hyrise | /src/lib/operators/join_hash/join_hash_steps.hpp | UTF-8 | 43,432 | 2.578125 | 3 | [
"MIT"
] | permissive | #pragma once
#include <boost/container/small_vector.hpp>
#include <boost/lexical_cast.hpp>
#include <uninitialized_vector.hpp>
#include "bytell_hash_map.hpp"
#include "hyrise.hpp"
#include "operators/multi_predicate_join/multi_predicate_join_evaluator.hpp"
#include "resolve_type.hpp"
#include "scheduler/abstract_task... | true |
2172395b9227036eb17a80f35067801f7d884c76 | C++ | 375187588/DesignPatterns | /BehaviorPattern/Observer/Observer.h | UTF-8 | 7,073 | 2.609375 | 3 | [] | no_license | #pragma once
/*////////////////////////////////////////////////////
//说明:观察者模式类实例
//文件:Observer.h
//日期:2020/6/30
//作者:coder
//QQ:375187588
//修改:
//版本:
*//////////////////////////////////////////////////////
//观察者
class CObserver;
using LLObservers = std::list<CObserver*>;
//主题对象
class CSubject
{
public:
virtual ~C... | true |
e2855f2217979cd63f56ee883ddf0b033345c103 | C++ | huxiao1/algorithm | /bfs/Sequence Reconstruction/test.cpp | UTF-8 | 552 | 3.1875 | 3 | [] | no_license | #include<iostream>
#include<unordered_map>
using namespace std;
int main()
{
unordered_map<int, int> pos = {{1,3},{2,4},{3,5}};
unordered_map<int,int>::const_iterator got = pos.find(1);
cout<<got->first << "is" << got->second<<endl;
for ( auto it = pos.begin(); it != pos.end(); ++it )
... | true |
5e53ea3fd25e95b193d31a849fae0faec19085de | C++ | npo6ka/LedMatrix | /src/effect_list/libs/lib_led.cpp | UTF-8 | 3,972 | 2.59375 | 3 | [] | no_license | #include "lib_led.h"
// ************* НАСТРОЙКА МАТРИЦЫ **************
//hooks for old vertion
#if (STRIP_DIRECTION == 2)
# define STRIP_DIRECTION 0
#elif (STRIP_DIRECTION == 3)
# define STRIP_DIRECTION 1
#endif
#if (STRIP_DIRECTION == 0)
# define _WIDTH WIDTH
#elif (STRIP_DIRECTION == 1)
# define _WIDTH HEIG... | true |
4f82703422970205020813d1f54dc0a86d1e5a67 | C++ | utkar-sh/Competitive-Programming | /code-cpp/longestIncreasingPath.cpp | UTF-8 | 1,525 | 3.3125 | 3 | [] | no_license | #include <bits/stdc++.h>
int inBounds(int i, int j, int n, int m) {
return i >= 0 && i < n && j >= 0 && j < m;
}
int dir_x[4] = {1, -1, 0, 0};
int dir_y[4] = {0, 0, 1, -1};
//to avoid redundant dfs from every node,
//store the max best path that is achievable at a node..
//next time we land on a node, if previou... | true |
807d94cee2626e2355397e41ab5a1f3d69a48027 | C++ | lhy1229/lhy | /数据结构/串/串的基本运算.cpp | UTF-8 | 2,198 | 3.1875 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#define MaxSize 100
typedef struct{
char data[MaxSize];
int length;
}SqString;
void StrAssign(SqString &s,char cstr[]){
int i;
for(i=0;cstr[i]!='\0';i++){
s.data[i]=cstr[i];
}
s.length=i;
}
void DestroyStr(SqString &s){
}
bool StrEqual(SqString s,SqString t){... | true |
8812230e5e64275fa8789d31e3ed5b5c3fa1be60 | C++ | A-suozhang/NUEDC-Code | /ESP32/I2SDACESP32.h | UTF-8 | 2,001 | 2.765625 | 3 | [] | no_license | #pragma once // 预处理指令,能够保证cpp只会被编译一次
#include "./driver/ledc.h"
#include "./driver/i2s.h"
#include "./freertos/portmacro.h"
#ifndef _I2SDACESP32_
#define _I2SDACESP32_
static i2s_config_t i2s_config_dac;
static i2s_port_t i2s_num_dac=(i2s_port_t)0;
// --------- Make A CLass ----------
class I2SDAC{
// Public Vari... | true |
63fd3f2c25366f9be80049e11d3bf802fcb6f6f9 | C++ | windy32/em-ray-tracing | /src/Engine/Sphere.h | UTF-8 | 505 | 2.703125 | 3 | [] | no_license | #ifndef SPHERE_H
#define SPHERE_H
#include "Geometry.h"
class Sphere : public Geometry
{
public:
Point center;
double radius;
public:
Sphere(const Point ¢er, double radius);
virtual Point getCenter() const;
virtual void getBoundingBox(Point &min, Point &max);
virtual Inters... | true |
60ca52db72f02336eccc5e4a2f04e62b56b65a5f | C++ | Ruthietta/Infinite-coders-competition | /Task 2/Solution 2/printVector.hpp | UTF-8 | 234 | 2.890625 | 3 | [] | no_license | #pragma once
#include <algorithm>
#include <iostream>
#include <iterator>
#include <vector>
int printVector(std::vector<int> vec) {
std::copy(vec.begin(), vec.end(), std::ostream_iterator<int>(std::cout, ", "));
return 0;
}
| true |
b2b2761c8eb0866dddd7ea77ae06a3f97e2825e5 | C++ | tangjz/acm-icpc | /hackerrank/stone-piles.cpp | UTF-8 | 670 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | #include <stdio.h>
#include <cstring>
const int maxn = 51, maxv = 101;
int lim, sg[maxn];
bool vis[maxv];
void dfs(int rem, int last, int Xor)
{
if(!rem)
{
vis[Xor] = 1;
return;
}
for(int i = last + 1; i <= rem && i < lim; ++i)
dfs(rem - i, i, Xor ^ sg[i]);
}
int main()
{
memset(sg, -1, sizeof sg);
sg[1] = ... | true |
aee50786ef925b9212448066d584997a6fcf8da4 | C++ | Max850709/Leetcode_C | /reverseint/reverseint/main.cpp | UTF-8 | 769 | 3.78125 | 4 | [] | no_license | /*
Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0.
*/
#include <iostream>
using namespace std;
class solution{
public:
int reverse(int x) {
int ans=0;
for(;x!=... | true |