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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
b3e091928ed543a07962debeea56e9eccdbd1dc4 | C++ | jinseongbe/cpp_study | /CPP_62(참조변수_ReferenceVariable)/CPP_62/main.cpp | UTF-8 | 3,130 | 3.859375 | 4 | [] | no_license | #include <iostream>
using namespace std;
void doSomething1(int n);
void doSomething2(int &m);
void doSomething3(const int &m);
void printElements(int (&arr)[5]);
struct A_0
{
int v1;
float v2;
};
struct a_0
{
A_0 st;
};
int main()
{
int value = 5;
int *ptr1 = nullptr;
ptr1 = &value;
cout... | true |
586e6422a3d74fc675b8f7438380833d12aee739 | C++ | suyashphatak/solved_code | /Longest Substring Without Repeating Characters.cpp | UTF-8 | 917 | 2.9375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
string str;
getline(cin,str);
int max = 0;
string temp="";
for (int i = 0; i < str.length(); i++)
{
temp = str[i];
int count = 1;
for (int j = i+1; j < str.length(); j++)
{
int flag = 1;
for (int k ... | true |
de48a7cd59ec6ecff6f750791c5c7fdde721be63 | C++ | AdrianBZG/RAM-Machine-Simulator | /src/headers/UI.hpp | UTF-8 | 576 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | /*
Author: Adrián Rodríguez Bazaga
Contact: arodriba@ull.edu.es / alu0100826456@ull.edu.es
Date: 14/02/2016
*/
#ifndef _UI_HPP_
#define _UI_HPP_
#include "RAMmachine.hpp"
#include <string>
#include <iostream>
using namespace std;
class UI
{
private:
bool state_; //True = Active. False = Fin... | true |
971faf40e868b3c2c36f619941fbc8cd120f52eb | C++ | mistickpulse/LifeIsBorneAlpha | /src/Dungeon/Cell.cpp | UTF-8 | 1,508 | 2.828125 | 3 | [] | no_license | //
// Created by zouz on 05/02/18.
//
#include "Cell.hpp"
gen::Cell::Cell(unsigned int size_x, unsigned int size_y, Position pos) :
_SizeX(size_x), _SizeY(size_y), _pos(pos)
{
for (auto &i : _childs) {
i = nullptr;
}
}
void gen::Cell::generateRooms(int iteration)
{
if (iteration <= 0) {
... | true |
5c9d3a6a42fa27b0f168283d28e4dd3ee7caefc9 | C++ | gConwh7/Examples_cpp | /Examples/foo.cpp | UTF-8 | 737 | 3.109375 | 3 | [] | no_license | #include "pch.h"
#include "foo.h"
#include <iostream>
namespace test { //Our headers are in the test namespace, so this is necessary.
foo::foo()
{
std::cout << "FROM test::foo constructing foo" << std::endl;
}
foo::~foo()
{
std::cout << "FROM test::foo destroying foo" << std::endl;
}
void foo::print()
{
... | true |
6b451920e17e9de7d367656f0415afa337179364 | C++ | dcauz/opus | /statement.h | UTF-8 | 13,392 | 2.5625 | 3 | [] | no_license | #pragma once
#include <vector>
#include <memory>
#include <string>
#include "opus.h"
#include "enum.h"
#include "symtbl.h"
class Expr;
class Type;
class GenCodeContext;
class SemCheckContext;
class Statement
{
public:
Statement( int s, int e ):startLine_(s), endLine_(e) {}
virtual ~Statement() {}
virtual bool ... | true |
1200eff14fabca9db9ef0dfb1276eaf105ad11bd | C++ | marselaminov/CPP | /Day04/ex03/Ice.cpp | UTF-8 | 438 | 3.09375 | 3 | [] | no_license | #include "Ice.hpp"
Ice::Ice() : AMateria("ice") {}
Ice::Ice(const Ice &src) : AMateria("ice") {
*this = src;
}
Ice & Ice::operator=(const Ice &src) {
if (this == &src)
return (*this);
this->type = src.type;
return (*this);
}
Ice::~Ice() {}
Ice* Ice::clone() const {
Ice *a = new Ice(*this);
return (a);
}
v... | true |
9cb3b8ddb04c83635bea43fcb50a3fdf23fd1141 | C++ | omelkonian/lambda-calculus-interpreter | /error_handler/AutoCorrector.cpp | UTF-8 | 2,635 | 3.265625 | 3 | [] | no_license | /*
* AutoCorrector.cpp
*
* Created on: Feb 1, 2015
* Author: Orestis Melkonian
*/
#include "AutoCorrector.h"
#include "../scanner/Scanner.h"
#include <stdlib.h>
#include <string>
#include <vector>
#include <assert.h>
#include <iostream>
using namespace std;
AutoCorrector::AutoCorrector() {
}
AutoCorrect... | true |
817ac38c95017edda2c945d02f4786566f0d24d2 | C++ | unknown442/Demo-Exploit | /src/DemSploit.cpp | UTF-8 | 5,108 | 2.59375 | 3 | [] | no_license | #include <Windows.h>
#include <iostream>
#include <time.h>
#include "Common/Types.h"
#include "Utils/File.h"
#include "Utils/InlineCode.h"
void shellcode()
{
//
// Go to the bottom of the stack to get ability to
// allocate arguments in shellcode function.
//
__asm
{
sub esp, 0x8000;
}
//
// Allocating s... | true |
1f5d30f81b56d4665f8c44ccff21a158c948e231 | C++ | johnjaes/leetcode | /687_LongestUnivaluePath.cpp | UTF-8 | 842 | 3.375 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
int path_go(TreeNode* node , int &res)
{
if(node == NULL) { return 0; }
int... | true |
589688d6213f0084b9bb44403f8b0522fc4a0293 | C++ | a624762529/http- | /HttpII/spellhtml.cpp | UTF-8 | 1,286 | 2.890625 | 3 | [] | no_license | #include "spellhtml.h"
SpellHtml::SpellHtml()
{
}
string SpellHtml::getTitle(string path)
{
string head_title=string("<html><head><title>目录名: ")+path+
"</title></head>\n";
string body_title=string("<body><h1>当前目录: ")+path+
"</h1><table>\n";
return head_title+body_title;
}
string ... | true |
e58c51f51c4fbfdbc81a978f6af49ef62a9c0d83 | C++ | binzhikuwen/Algorithm-contest-entry-classic | /6/层次遍历.cpp | GB18030 | 2,950 | 3.59375 | 4 | [] | no_license | /**********************************************************************************
* α
*
* һöǰϵ£ҵ˳ֵÿ㶼
* մӸڵ㵽ƶи(LʾRʾ)Уÿź
* ֮ûпոڽ֮һոÿһԿ()
*
* ע⣬ӸijҶ·еĽûи߸˳һΣ
* Ӧ-1256.
* :(11,LL) (7,LLL) (8,R) (5,) (4,L) (13,RL) (2,LLR) (1,RRR) (4,RR) ()
* (3,L) (4,R) ()
*
* :5 4 8 11 13 4 7 2 11
* -1
**************... | true |
6b86cc1aaf033c08bbd917b8e2355130c6e2608b | C++ | SayaUrobuchi/uvachan | /TNFSH_OJ/273.cpp | UTF-8 | 573 | 2.875 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int count, n, i, j, k;
scanf("%d", &count);
while (count--)
{
scanf("%d", &n);
for (i='A'+n-1, j=n-1; i>='A'; i--, j--)
{
for (k=0; k<j; k++)
{
putchar(' ');
}
for (k='A'+n-1; k>i; k--)
{
putchar(k);
}
for (; k<='A'+n-1; k++)
{
putchar(k);
... | true |
0cc11a813dbc25c3923047a4768fc8b0d9500e92 | C++ | saphina/SWDT_2017 | /lib_core/src/Freq_Amp.cpp | WINDOWS-1251 | 2,916 | 2.984375 | 3 | [
"Apache-2.0"
] | permissive | #include <math.h>
#include "fft.h"
#define nSamplesPerSec 44100.0
/*
.
, ,
(samples). */
bool Get_Freq_Amp(ShortComplex *arr, double *freq, double *amp, int N)
{
// ,
//ShortComplex - : double re, im;
// arr
int i = N - 1;
//
//double nSamplesPerSec =... | true |
29d88a8d3d55efebff0434fc8e876183eccbd8a8 | C++ | WuCoding/C- | /C++/20190620/HeapStudent.cc | UTF-8 | 2,225 | 4.21875 | 4 | [] | no_license | #include <string.h>
#include <stdlib.h>
#include <iostream>
using std::cout;
using std::endl;
//要求:只生成堆对象,不能生成栈对象 Student * pstu=new Student();可以 Student stu;不可以
//解决方案:
//将析构函数放入private区域,这样栈对象销毁时,自动调用析构函数会导致失败,而可以为堆对象构造一个destroy方法销毁函数,在destroy方法中去执行delete表达式,delete表达式执行之前会先调用析构来回收对象数据资源
class Student
{
public:
... | true |
83d90828cee3c15258db3580d99ac87b524d3beb | C++ | j-mathes/Ivor-Horton-VS2013 | /Sketcher/Sketcher/Ellipse.h | UTF-8 | 608 | 2.734375 | 3 | [] | no_license | #pragma once
#include "Element.h"
class CEllipse :
public CElement
{
public:
virtual ~CEllipse();
virtual void Draw(CDC* pDC, std::shared_ptr <CElement> pElement = nullptr) override; // Function to display an ellipse
virtual void Move(const CSize& aSize) override; // Function to move an element
// Con... | true |
609ee59ac939d5d3dc829bbde3bd2b319b3636df | C++ | seising99/CQ9k-Prototype | /bossDemos/Toast.cpp | UTF-8 | 1,400 | 2.609375 | 3 | [] | no_license | #include "Toast.h"
#include "TextureMap.h"
#include "Game.h"
#include "VectorMath.h"
#include "EntityManager.h"
Toast::Toast() : Enemy(TEXTURES("toaster"))
{
frame = 0;
sf::Vector2f pos(0.0f, 0.0f);
getSprite()->setTextureRect(sf::IntRect(0, 0, 128, 128));
getSprite()->setOrigin(64, 64);
int edge = rand() % ... | true |
a25a332b1bc7131e7d3d01a21ef43977c9d2d468 | C++ | shivanksagar/Cricket-Virtual-game | /src/game.cpp | UTF-8 | 12,524 | 3.078125 | 3 | [] | no_license | # include "game.h"
#include <stdlib.h>
#include <time.h>
using namespace std;
Game:: Game() {
playersPerTeam = 4;
maxBalls=6;
totalPlayers=11;
firstInningsRuns=0;
secondInningsRuns=0;
players[0]="virat";
players[1]="ponting";
players[2]="sehwag";
players[3]="sachin";
players[4]="dravid";
players[5]="dho... | true |
4e3d35b8bbf1ea30baed0177619d2c8f1db68298 | C++ | huiyugan/NANIM_PNNL | /DWN_cryst.h | UTF-8 | 11,312 | 2.796875 | 3 | [] | no_license |
#ifndef CRYSTAL_JOSH
#define CRYSTAL_JOSH
//Crystal system class used for handling ordering of atoms when
//constructing systems such as nanoparticles and nanosurfaces---
#include <cmath>
#include <vector>
using namespace std;
#include "DWN_atom.h"
#include "DWN_atomcoll.h"
#include "DWN_utility.h"
#include "RandN... | true |
64c1a53ed59960d9610454e28119fb9f402a47ee | C++ | AvaN0x/IUT-UMLDesigner | /models/Argument.cpp | UTF-8 | 3,192 | 2.859375 | 3 | [
"MIT"
] | permissive | #include <cstdlib>
#include <ostream>
#include <iostream>
#include "Utils.hpp"
#include "Argument.hpp"
#include "types.h"
namespace iut_cpp
{
Argument::Argument() : _javaWrapper(nullptr),
_name(""),
_type(""),
_isConst(false),
... | true |
4b0bcd0a1fe889ba0786c483a483e14e5b282666 | C++ | Im-Rudra/LightOJ-Solutions | /1051-Good-Or-Bad.cpp | UTF-8 | 2,442 | 2.640625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string.h>
#include <stdio.h>
using namespace std;
int ab;
int ok;
bool ans[55][1000];
vector <int> x;
string a;
int check(int n)
{
int acount = 0;
int bcount = 0;
int qcount = 0;
int i;
for ( i = 0; i < a.length(); i++) {
if(a[i] == 'A' or a[i] == 'E' or ... | true |
12b5863fff73228fe492fad214304532b26494c6 | C++ | sir-rasel/Online_Judge_Problem_Solve | /Uva/uva_440.cpp | UTF-8 | 615 | 2.546875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int Calu(int n, int k) {
static int link[151], head, prev, last;
for(int i = 2; i < n; i++) link[i] = i+1;
link[n] = 2, head = 2, prev = n;
for(int i = 1; i < n; i++) {
for(int j = 1; j < k; j++)
prev = head, head = link[head];
last = head;
link[prev] = link[he... | true |
4b14154b2866691e2e57621976804dd8abadd489 | C++ | alexandraback/datacollection | /solutions_5686275109552128_0/C++/diogoholanda/pancakes.cpp | UTF-8 | 443 | 2.65625 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
int T, u, N, resp, aux;
int v[1010];
int main(){
scanf(" %d", &T);
u=0;
while(u<T){
u++;
scanf(" %d", &N);
for(int i=0; i<N; i++){
scanf(" %d", &v[i]);
}
resp = 1000000000;
for(int k=1; k<=1000; k++){
aux = k;
for(int i=0; i<N; i++){
... | true |
fec0c7873c3ce1c3868510029fbbf066af3e0fda | C++ | proqk/Algorithm | /BruteForce/1182 부분수열의 합_다시.cpp | UTF-8 | 496 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int res = 0;
int n, s;
vector<int> v;
void go(int now, int sum) {
if (now >= n) return; //범위 초과
if (sum + v[now] == s) res++; //(현재 수를 더해서)찾음
go(now + 1, sum + v[now]); //현재 수를 더하는 경우
go(now + 1, sum); //현재 수를 더하지 않는 경우
}
int main() {
... | true |
b134144deca1de9f6fbaf71870770f22496e80f0 | C++ | audxo14/Network | /arp_spoof/arp_main.cpp | UTF-8 | 2,807 | 2.703125 | 3 | [] | no_license | // arp_main.cpp
#include <stdio.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <pcap.h>
#include <libnet.h>
#include <string.h>
#include "arp_spoof.h"
void arp_main(u_char *s_mac, u_char *d_mac, u_char *r_mac, u_char *f_mac,
struct in_addr s_ip, struct in_addr d_ip, struct in_addr r_ip)
{
struct libnet... | true |
449564fc8e0e0000149e6bebba338da55a8913d1 | C++ | face4/AOJ | /Volume01/0154.cpp | UTF-8 | 1,381 | 2.953125 | 3 | [] | no_license | /*
// 枝狩り無し全探索だと流石にきついか? -> 普通に0.43secで通った
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
vector<pair<int,int>> v;
int m, ans;
void dfs(int pos, int res){
if(res == 0){
ans++;
return;
}
if(pos == m) return;
for(int j = min(v[pos].second, res/v[pos].firs... | true |
e625b82180745b5d0d92e149aca5c00f8c54f155 | C++ | mycmessia/Advanced-Graphics-for-Games-CSC8502-2016-17 | /nclgl/OGLRenderer.h | UTF-8 | 4,125 | 2.578125 | 3 | [] | no_license | #pragma once
/*
Class:OGLRenderer
Author:Rich Davison <richard.davison4@newcastle.ac.uk>
Description:Abstract base class for the graphics tutorials. Creates an OpenGL
3.2 CORE PROFILE rendering context. Each lesson will create a renderer that
inherits from this class - so all context creation is handled automatically,
... | true |
5a67bf4b4c73b05f857ea34e3f9ad2ead5e8aee5 | C++ | mflagel/asdf_multiplat | /gurps_track/src/ui/character/skill_list.cpp | UTF-8 | 2,227 | 2.578125 | 3 | [
"MIT"
] | permissive | #include "stdafx.h"
#include "skill_list.h"
#include "data/character.h"
using namespace std;
using namespace mk;
namespace gurps_track
{
using namespace data;
namespace ui
{
namespace character
{
skill_list_entry_t::skill_list_entry_t(skill_list_t& _parent, size_t _index)
: Expandbox(" ", true)
, description(e... | true |
179c0e0b3562c2ac98c06ee1e119c1ac1d145045 | C++ | KanColleTool/kclib | /src/LKStreamTranslator.h | UTF-8 | 2,646 | 2.875 | 3 | [] | no_license | #ifndef LKSTREAMTRANSLATOR_H
#define LKSTREAMTRANSLATOR_H
#include "LKTranslator.h"
#include <yajl_parse.h>
#include <yajl_gen.h>
#include <string>
#include <vector>
#include <sstream>
/**
* In-stream translator for JSON streams, built on top of
* [YAJL](https://lloyd.github.io/yajl/).
*
* \warning A Stream Tran... | true |
4cbb53d9a73b5ca0f334120a1180fad11a39da61 | C++ | munraito/made-algo | /solutions/W11_graphs-2 (BFS)/B_dijkstra.cpp | UTF-8 | 1,281 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <climits>
#include <set>
#include <vector>
using namespace std;
void dijkstra_shortest_path(const vector <vector<pair<int,int>> >& g, int n) {
int start = 0;
vector<unsigned long long> dist(n, ULONG_LONG_MAX);
set<pair<int,int> > q;
dist[start] = 0;
q.insert(make_pair(... | true |
2851612a79be52701a995bab65fb18ab8a33da87 | C++ | SaberQ/leetcode | /src/ReverseNodesInKGroup.cpp | UTF-8 | 880 | 3.1875 | 3 | [] | no_license | #include "ReverseNodesInKGroup.hpp"
ListNode* ReverseNodesInKGroup::reverseKGroup(ListNode* head, int k)
{
if (head == nullptr || k == 1) return head;
ListNode* prev = nullptr;
ListNode* a = head;
ListNode* b = a;
for (int i = 1; i < k; i++) {
b = b->next;
if (b == nullptr) return head;
}
ListNo... | true |
d9d30aa523b70381a5f7c78f34c9aa311733707f | C++ | ohio813/MyTerminateProcess | /MyTerminateProcess/src/MyTerminateProcess.cpp | UTF-8 | 3,888 | 2.640625 | 3 | [] | no_license | #include <windows.h>
#include <stdio.h>
#define NT_SUCCESS(x) ((x) >= 0)
#define SystemHandleInformation 16
#define STATUS_INFO_LENGTH_MISMATCH 0xc0000004
typedef NTSTATUS (NTAPI *NTQUERYSYSTEMINFORMATION)(ULONG SystemInformationClass, PVOID SystemInformation, ULONG SystemInformationLength, PULONG ReturnLength);
/*... | true |
eefc2f20440b72136ec619ef638b9dcbdfa48b11 | C++ | xiaoweix/myCode | /009数组的输入输出.cpp | GB18030 | 378 | 3.140625 | 3 | [] | no_license | /*10 10ַת
0 1 2 3 4 5 6 7 8 9
9 8 7 6 5 4 3 2 1 0
*/
#include<stdio.h>
int main()
{
int shuz[10]; //Ҫ
// [鳤]
int i;
for(i=0;i<10;i++)//
scanf("%d",&shuz[i]);
for(i=9;i>=0;i--)//
printf("%d ",shuz[i]);
return 0;
}
| true |
9e85d093a295bbb9b3cefc1903ea1bb5a941fdee | C++ | luckywolf/LCode | /c3_regularExpressMatching.h | UTF-8 | 1,967 | 3.703125 | 4 | [] | no_license | /*
https://oj.leetcode.com/problems/regular-expression-matching/
Implement regular expression matching with support for '.' and '*'.
'.' Matches any single character.
'*' Matches zero or more of the preceding element.
The matching should cover the entire input string (not partial).
The function prototype should be:... | true |
ae96612f7c4191d5c2f2dbce75e193ee22bc6d9a | C++ | akshayMore2018/SFML-Project | /sfmlproject/sfmlproject/TextureManager.cpp | UTF-8 | 698 | 2.953125 | 3 | [] | no_license | #include "TextureManager.h"
TextureManager* TextureManager::instance = 0;
TextureManager::TextureManager()
{
}
TextureManager * TextureManager::getInstance()
{
if (!instance) {
instance = new TextureManager();
}
return instance;
}
void TextureManager::loadTexture(const std::string& ID,const std::string & file)
{... | true |
195b4fa8503ca7768221583d71ca5b9a8f5784c5 | C++ | leurekay/Projects | /sort/sort/aa.cpp | UTF-8 | 451 | 3.234375 | 3 | [] | no_license | #include<iostream>
using namespace std;
void swap(int &x, int &y)
{
int temp;
temp = x;
x = y;
y = temp;
}
int main()
{
int i, j;
cin >> i >> j;
cout << i << " "<<j << endl;
swap(i, j);
cout << i << " " << j << endl;
int a[][2]= { 0,1,2,3,4,5};
for (i = 0; i < 3; i++)
{
for (j = 0; j < 2; j++)... | true |
f25599b321a9b8983c07ca8584433a374aa1678d | C++ | apurvjain9999/Computer-Graphics-Lab | /lab5/3d_reflection.cpp | UTF-8 | 614 | 3.15625 | 3 | [
"Apache-2.0"
] | permissive | #include<iostream>
using namespace std;
int main()
{
int pts[3];
cout<<"Enter the co-ordinate point: ";
cin>>pts[0]>>pts[1]>>pts[2];
int plane;
cout<<"Enter the plane about which the point is to be reflected(0 for y-z, 1 for z-x, 2 for x-y): "<<endl;
cin>>plane;
int pr[3];
i... | true |
f1606eaa9688ef587e775d29f23fbd9cce41353b | C++ | saneto/c- | /cour merlet/TP19_Liaison_RS232/Partie_5E.cpp | UTF-8 | 3,483 | 2.78125 | 3 | [] | no_license | #include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main()
{
/*
1 ouvrir le fichier associé au port série virtuel
2 configurer la voie de communication entre le système et le port série conformément aux
informations indiqué... | true |
dd2f6ce966c1777b44dec218da0d96416ef768fc | C++ | nhazekam/cse_20232 | /lectures/lecture_14/main.cpp | UTF-8 | 329 | 2.609375 | 3 | [] | no_license |
#include <iostream>
#include <string>
#include "complex.hpp"
using namespace std;
int main() {
Complex c1();
c1.showComplexValues();
Complex c2(2.0, 0.0);
c2.showComplexValues();
c2.assignNewValues(4.0, 2.0);
c1.showComplexValues();
c2.showComplexValues();
Complex c3(c2);
c3.showComplexValues();
return ... | true |
d2269576a5f88e3b2ac19fed8ed5e23399f54e85 | C++ | SIRUGUE/cppcourse-brunel | /src/neuron.cpp | UTF-8 | 6,536 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <cmath>
#include <random>
#include <cassert>
#include "neuron.hpp"
using namespace std;
///CONSTRUCTOR
/** @param n :neuron number
* @param MP : membrane potential
* @param NS : number of spikes
* @param TS : time spikes
* @param TR : time refractory
* @param ... | true |
30d045050d0fa0cb4223b5e0ffdbffa0131314a8 | C++ | singlasymbol/Hackerrank | /Strings/making-anagrams.cpp | UTF-8 | 707 | 2.953125 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
string s1, s2;
cin >>s1;
cin >>s2;
int len1 = s1.length();
int len2 = s2.length... | true |
eaadcce575f5b9692c2457f0ca41980423a825ce | C++ | bashir-abdelwahed/TFC-NXP-Lebanon | /Final/encoder.cpp | UTF-8 | 1,881 | 3.125 | 3 | [] | no_license | #include "encoder.h"
Encoder::Encoder(PinName int_a) : pin_a(int_a)
{
pin_a.mode(PullNone);
EncoderTimer.start();
pin_a.fall(this,&Encoder::encoderFalling);
pin_a.rise(this,&Encoder::encoderRising);
zero_speed = false;
}
void Encoder::encoderFalling(void)
{
//... | true |
bdb1bc7e58f8b5c884fe4cd2edd5f00d425eebaa | C++ | kiwixz/pathtracer | /pathtrace/shape.h | UTF-8 | 1,456 | 2.734375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <pathtrace/aabb.h>
#include <pathtrace/image.h>
#include <pathtrace/ray.h>
#include <glm/vec3.hpp>
#include <optional>
namespace pathtrace {
struct Shape;
struct Material {
enum class Reflection {
diffuse, // default
specular, // mirror
... | true |
3e82835b11ab4f8e8207cd6734787d9783b22c2d | C++ | Dev-will-work/Cpp-course | /3_Lab.Circle,Datetime_ClassesWithTasks/src/main3.cpp | UTF-8 | 385 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include "DateTime.h"
int main() {
DateTime today;
DateTime date(30,11,2019);
std::cout << date.getToday() << std::endl;
std::cout << date.getTomorrow() << std::endl;
std::cout << date.getYesterday() << std::endl;
std::cout << date.getFuture(5) << std::endl;
std::cout << date.getPast(5) << s... | true |
1f56912a508cc9cacf6308e376b4d98049c05a12 | C++ | aedelgado19/CS162-Palindromes | /Palindromes.cpp | UTF-8 | 1,549 | 4.28125 | 4 | [] | no_license | /* Author: Allison Delgado
* Last updated 9/22/20
* Palindromes is a program that reads in a character array
* and determines whether or not this is a palindrome.
*/
#include <iostream>
#include <cstring>
using namespace std;
int isValid(char ch);
int main() {
char str[80];//original str
char str2[80]; //... | true |
813f15687b466d16d5431ec112b41a2e8df35aa7 | C++ | NocturnalShadow/3DEditor | /Source/entity.cpp | UTF-8 | 930 | 3.09375 | 3 | [] | no_license | #include "entity.h"
IEntity::IEntity(const IEntity& entity)
{
if(entity.id != 0) {
entity.manager->AddItem(this);
}
}
IEntity::IEntity(IEntity&& entity)
{
if(entity.id != 0) {
entity.manager->ReplaceItem(&entity, this);
}
}
uint EntityManager::AddItem(IEntity* item)
{
if((item->i... | true |
d2831880e8687397c358acf15339847721801408 | C++ | RecursiveG/Ryu | /src/common/bencode_test.cpp | UTF-8 | 3,089 | 2.65625 | 3 | [
"MIT"
] | permissive | #include "bencode.h"
#include <gtest/gtest.h>
using namespace ryu::bencode;
using std::string;
#define PARSE(str) \
({ \
size_t idx = 0; \
auto i = BencodeObject::Parse(str, &idx); \
if (!i... | true |
fe2cac6dd538231b9db2034fb17e7d4b753ba750 | C++ | jamesldalton/Word-Ladder | /Graph.cpp | UTF-8 | 4,381 | 3 | 3 | [] | no_license | //
// Graph.cpp
// WordLadder
//
// Created by James on 11/26/15.
// Copyright © 2015 James Dalton. All rights reserved.
//
#include "Graph.hpp"
Graph::Graph(vector<string> dict)
{
// load dictionary with words
dictionary = dict;
this->V = dictionary.size();
}
int Graph::getLocation(string value)
{
... | true |
4cefda57057af046e56fcd3ac3a3729e55e5f65a | C++ | cyrildewit/fhict-2021nj | /technology/p-db-tech-p-db18/orientatie/8.BlinkThreeTimesAfterButtonPushForLoop/src/main.cpp | UTF-8 | 1,315 | 3 | 3 | [] | no_license | #include <Arduino.h>
const int redLightPin = 2;
const int greenLightPin = 3;
const int blueLightPin = 4;
const int buttonBlinkPin = 5;
int buttonBlinkState = LOW;
int lastButtonBlinkState = LOW;
unsigned long timeNow = 0;
class RgbColor
{
public:
int red = 0, green = 0, blue = 0;
RgbColor(int redValue = 0, i... | true |
affd303e84e387a91d49de095c55eb5fc65135cb | C++ | JustinKin/Math | /Optical_Axis_Transition/src/function_OAT.cpp | UTF-8 | 1,528 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include "D:\QinJunyou\C\Eigen3\Eigen\Eigen"
#include "Optical_Axis_Transition.H"
using namespace std;
Optical_Axis_Transition::
Optical_Axis_Transition(std::string unit_, double includedAngle_, Eigen::Matrix<double, 3, 1> camVector_1_) : unit(unit_), camVector_1(camVector_1_)... | true |
fd0e8be651461ab4932909bf9b8fd7c1861fcc64 | C++ | Sethix/Ghost-Puncher | /GhostPuncher/MainMenu.cpp | UTF-8 | 3,902 | 2.953125 | 3 | [] | no_license | #include "MainMenu.h"
#include "AssetLib.h"
bool MainMenu::loaded = false;
// Set our start values and load our menu textures if it's our first time at the screen.
MainMenu::MainMenu()
{
setCurrentSelection(0);
setSplashState(true);
setChangedSelection(false);
setExiting(false);
hScoreString = "High score: ";
... | true |
9f76072e388e7babd21bc248cc50984780c646d0 | C++ | tmyksj/atcoder | /AtCoder Beginner Contest 150/D - Semi Common Multiple/main.cpp | UTF-8 | 931 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <map>
#include <vector>
using namespace std;
template <class T>
T gcm(T a, T b) {
if (a < b) {
T w = a;
a = b;
b = w;
}
while (b != 0) {
T w = a % b;
a = b;
b = w;
}
return a;
}
template <class T>
T lcm(T a, T b) {
... | true |
91dcc7482f28c5d78b8c50776db2177450751ea2 | C++ | poojagarg/Coding | /c,c++/storeCredit.cpp | UTF-8 | 519 | 2.640625 | 3 | [] | no_license | #include <iostream>
#include <set>
using namespace std;
int main(){
int t;
cin>>t;
int c_=1;
while(c_<=t){
int c,p;
cin>>c>>p;
int a[p];
for(int i=0; i<p; i++)
cin>>a[i];
set<int> s;
for(int i=0;i<p; i++){
if(s.find(c-a[i])!=s.end()){
for(int j=0; j<i; j++){
... | true |
961bfb4574e7dc2d7d5dfaaf286969b7c45d1f28 | C++ | Harshal555/cpp | /c++11/uniform_initializer/implicit_initialise_obj_return.cpp | UTF-8 | 324 | 3.46875 | 3 | [] | no_license | #include<iostream>
using namespace std;
class A
{
const int a;
const int b;
public:
A(int x,int y):a(x), b(y)//initializer list must be used
{
}
void show()
{
cout<<"a is "<<a<<"b is"<<b<<endl;
}
};
A fun(int m,int n)
{
cout<<"fun is called"<<endl;
return {m ,n};
}
int main()
{
A x=fun(10,55);
x.show();... | true |
0682f3d19410fdb1b850318048a43c6586e19169 | C++ | leandrovianna/ppp_book_codes | /Chapter4/4.4.2.3_example1.cpp | UTF-8 | 371 | 3.296875 | 3 | [] | no_license | //example1_for_statements.cpp
//Date: December 20, 2013
//Stroustrup's Programming Book - Chapter 4: Computation
//Example 1 - 4.4.2.3 for-statements
//calculate and print a table of square 0-99
#include "std_lib_facilities.h"
int square(int x)
{
return x*x;
}
int main()
{
for (int i = 0; i < 100; ++i) {
... | true |
bb3796b94c6d80206942eda0f33710be47cb86c9 | C++ | hnefatl/Noughts-and-Crosses | /Networking/Server/Game.cpp | UTF-8 | 3,945 | 2.953125 | 3 | [] | no_license | #include "Game.h"
#include <sstream>
#include "NetStrings.h"
#include "Globals.h"
#include <CellContents.h>
#include <Grid.h>
#include <Move.h>
Game::Game()
:Playing(true)
{
}
Game::Game(Client *PlayerOne, Client *PlayerTwo)
:Playing(true)
{
Players.push_back(PlayerOne);
Players.push_back(PlayerTwo);
}
Game::~G... | true |
a892a6b345182047dfe0320d39448a1dbd897fc7 | C++ | kashyapp/the-kitchen-sink | /code/code1/twoLarge.cpp | UTF-8 | 894 | 3.28125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <list>
#include <set>
#include <iterator>
using namespace std;
template <class InputIterator>
InputIterator twoLarge(InputIterator begin, InputIterator end){
InputIterator one = begin;
InputIterator two = one; two++;
//cout << *one << " " << *two << endl;
if(*one < *t... | true |
bf2fc9a29a56269e9d56e8f9cc71e3eeb75b33df | C++ | Tanmoy-SWE/Ludo-Game | /Ludo.cpp | UTF-8 | 3,036 | 3.65625 | 4 | [] | no_license | /***************************************************************
CSCI 240 Program 8 Spring 2021
Test the Die class
***************************************************************/
#include <iostream>
#include <iomanip>
#include <cstdlib>
using namespace std;
//********** Put the Die clas... | true |
d1166619dfd4c0cf206cd8ee7dbfff82dc2f73b5 | C++ | haclongtd1994/DataStructure_N_Algorithms | /DataStructure_N_Algorithms/Array/mergeSortArray.cpp | UTF-8 | 1,348 | 3.546875 | 4 | [] | no_license | #include "Common.h"
void mergesortArray(int *arr1, int length1, int *arr2, int length2, int slength, \
int *result){
for (size_t i = 0, j = 0, k = 0; i < slength; i++)
{
if (j != length1 && k != length2){
if (arr1[j] < arr2[k]){
result[i] = arr1[j];
j++;
... | true |
c1e2353e28c73a32c0dc00536a926e161bbb90ab | C++ | DelusionsOfGrandeur/labs | /ввп20(3).cpp | UTF-8 | 870 | 2.75 | 3 | [] | no_license | #include<stdio.h>
#include<math.h>
int main()
{
int k, i, n, dl, nk = 1, bks = 1, lks =(k==1?1:0), bes;
int a[20], b[20];
n = sizeof(a) / sizeof(int);
printf("vvedite razmer massiva\n");
scanf("%d", &n);
printf("vvedite znachenie k > 0\n");
scanf("%d", &k);
for(i=0; i<n; i++)
{
printf("a[%i] :... | true |
72690971456e7e28bf2cb531dc0eab557fd052c6 | C++ | avnishsingh516/CB-ds-and-algo | /recursion/phone_keypad.cpp | UTF-8 | 1,115 | 3.59375 | 4 | [] | no_license | #include<iostream>
using namespace std;
//keypad
char keypad[][10] = {"", "", "ABC", "DEF", "GHI", "JKL", "MNO", "PQRS", "TUV", "WXYZ"};
void generate_names(char *in , char *out, int i, int j) {
//base case
if (in[i] == '\0') {
//reach the last pos of input string
out[j] = '\0'; //add null to the last index
... | true |
47e122d0950777c74e8edca881f3d1c0077433ca | C++ | zhushiqi123/ios- | /C++语言程序设计 郑莉 第四版(课件、课后答案、例题源代码)/C++语言程序设计案例的源代码和目录/10852C++案例教程源代码/case03/3_17.cpp | GB18030 | 577 | 3.5 | 4 | [] | no_license | #include <iostream>
#include <cstdarg>
using namespace std;
int max(int,int...); //ԭ
int main()
{ int a,b,c,d,e;
cout<<"Enter five integers, seperate with space:"; cin>>a>>b>>c>>d>>e;
cout<<"The maxmum in a and b is:"<<max(2,a,b)<<endl;
cout<<"The maxmum in five integers is:"<<max(5,a,b,c,d,e)<<endl;
... | true |
355eb4b652af58a1ac3900890c3d818b07b693f4 | C++ | chamow97/Competitive-Coding | /codeforces/coach.cpp | UTF-8 | 2,202 | 2.671875 | 3 | [] | no_license | //template by chamow
#include<bits/stdc++.h>
/*-------------------------------------------------------- */
using namespace std;
/*-------------------------------------------------------- */
#define rep(i,val,n) for(ll i=val;i<n;i++)
#define per(j,val,n) for(ll j=val;j>=n;j--)
#define pb push_back
#define pi 3.14157
#... | true |
e0e15a3613991e098fefafcef9dc09b81f64ad0b | C++ | akrasuski1/factorio-combinators | /cpp/src/entity.h | UTF-8 | 1,840 | 2.53125 | 3 | [] | no_license | #ifndef ENTITY_H_
#define ENTITY_H_
#include "simulation.h"
#include "lib/json11.hpp"
#include <iostream>
class Decider {
public:
Decider(Simulation& simulation, json11::Json json);
virtual void print(std::ostream& os);
bool is_fulfilled(signal_t signal, resource_t res = Simulation::NONE);
resource_t left, rig... | true |
51ebcef02f3db50e0728e9c443f885f232282947 | C++ | ebriussenex/cplusplus-issue | /yellow_belt/5week/503Figure_inheritance.cpp | UTF-8 | 2,972 | 2.546875 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#define _CRT_DISABLE_PERFCRIT_LOCKS
#define pass (void)0
#include <limits>
#include <exception>
#include <stdexcept>
#include <cassert>
#include <cstdint>
#include <memory>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <sstream>
#include <fstream>
#include <cfenv>
#incl... | true |
52baefbd35f4dc64132da6d34ecfe9bb219a2a66 | C++ | captainsano/pgn-reader | /PGN Reader/PGNTokenizer.cpp | UTF-8 | 17,815 | 2.765625 | 3 | [] | no_license | //
// PGNTokenizer.cpp
// PGN Reader
//
// Created by Santhosbaala RS on 22/08/13.
// Copyright (c) 2013 64cloud. All rights reserved.
//
#include "PGNTokenizer.h"
#include "PGNException.h"
#include <regex>
PGNTokenizer::Token PGNTokenizer::nextToken(std::string::const_iterator begin, std::string::const_iterator ... | true |
50f32e01bb07637c7d62ed1070e37bf40eb1b7ca | C++ | pushprajsingh14/Competitive-programming | /PAJAPONG.cpp | UTF-8 | 340 | 2.859375 | 3 | [] | no_license | //https://www.codechef.com/problems/PAJAPONG
#include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--)
{
int x,y,k;
cin>>x>>y>>k;
int a=(x+y)/k;
if(a%2==0)
{
cout<<"Chef"<<endl;
}
else
{
cout<<"Paja"<<endl;
... | true |
4aee6b4fbcb8ba6b717f119a738e2dd6abe85043 | C++ | SeaKoala/prog06_avm799 | /player.cpp | UTF-8 | 2,108 | 3.328125 | 3 | [] | no_license | //
// Created by Alec Mehra on 11/8/2019.
//
#include "player.h"
#include <string>
#include <stdlib.h>
using namespace std;
Player::Player() = default;
void Player::bookCards(Card c1, Card c2) {
myBook.push_back(c1);
myBook.push_back(c2);
removeCardFromHand(c1);
removeCardFromHand(c2);
}
void Playe... | true |
2de98b1a6da5feb23968ab8e7d8f33b510c803c3 | C++ | madelainemar/Comp371Project | /Comp371Project/src/Rendering/CameraController.h | UTF-8 | 6,171 | 2.734375 | 3 | [] | no_license | #pragma once
#include "../Core/Script.h"
#include "../Core/Application.h"
#include "../Core/Input.h"
#include "../Core/Time.h"
#include "Camera.h"
#include "../Dependencies/glfw-3.3.4/include/GLFW/glfw3.h"
//camera controller script responsible for the movement and rotation of the camera
class CameraController : publ... | true |
fd397223eff19352417b5f568c589eae7aeed403 | C++ | iangeos/oop | /Shape.h | UTF-8 | 821 | 3.3125 | 3 | [] | no_license | const double PI = 3.14159;
// virtual function: can be overriden in child classes
// Interface: contains only virtual functions. Only definition, not implementation
// Abstract: contains at least 1 virtual function. It can be instantiated.
// A class can inherit only 1 abstract but >1 interfaces. It can be instanti... | true |
6d9f428d3de108363f603ed95c3fad99401aa952 | C++ | Ta3ikNSU/lab3Sem | /lab2/Operation/Pop.cpp | UTF-8 | 499 | 2.515625 | 3 | [] | no_license | //
// Created by Ta3ik on 03.12.2020.
//
#include "Pop.h"
#include "../Factory/OperationMaker.h"
REGISTER_OPERATION(Pop, POP);
#include "../Exceptions/arg_command_error.h"
#include "../Exceptions/stack_error.h"
void Pop::execute(std::list<std::string> &arg, Context & ctx) const {
if (arg.size() != 0)
th... | true |
80a84bd7abaaba4e6f545f926e4df12943d9c36c | C++ | abhicse32/Codechef-Solutions | /SALARY.cpp | UTF-8 | 483 | 2.71875 | 3 | [] | no_license | #include <stdio.h>
#include <algorithm>
#define gc getchar_unlocked
inline int fastRead(){
int num=0;
char ch=gc();
while(ch < 48) ch=gc();
while(ch>47){
num=(num<<1)+(num<<3)+ ch- 48;
ch=gc();
}
return num;
}
int main(){
int T,N,sum,M,i;
int arr[101];
T= fastRead();
while(T--){
N=fastRead();
for(i=0... | true |
d6bf89033d516ddfcf00a4dc9e2881265dfe7a48 | C++ | kundantajne/TestGit | /Program/C++ prog/inheri/Inheritance/Inheritance/InheritanceDemo.cpp | UTF-8 | 4,704 | 3.5625 | 4 | [] | no_license | #include<iostream>
using namespace std;
#include<stdio.h>
class Employe
{
int id;
char name[20];
double salary;
public:
Employe() //Default constructor
{
printf("\n Default constructor of Employe call");
//cout << constuctor of employe call;
id = 100;
strcpy(name, "Not Given");
salary = 10000;
}
Empl... | true |
c4bb035185f67922cf033db5476a86188f284194 | C++ | kallemov/VMFPolymer | /vmf/newbessel.cc | UTF-8 | 2,271 | 2.578125 | 3 | [] | no_license | // File: newbessel.cc
// Author: Suvrit Sra <suvrit@cs.utexas.edu>
// (c) Copyright 2006,2007 Suvrit Sra
// The University of Texas at Austin
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundati... | true |
e51f1abb51d43fd9ae04fb3c549927cb4f12c5ec | C++ | NKSG/c_learning_record | /cc150/1.3.cc | UTF-8 | 900 | 3.421875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <string>
#include <array>
/*
std::string sort(const std::string &s){
std::string temp(s);
std::sort(temp.begin(),temp.end());
return temp;
}
*/
bool permutation(std::string s1, std::string s2){
if(s1.size()!=s2.size()) return false;
/*
std::stri... | true |
9918f8560da5c64abd8ff1e24bab5ecb949b2bf3 | C++ | bluwireless/LuaChat | /src/actions/lua_chat_action_timer.hpp | UTF-8 | 2,387 | 2.96875 | 3 | [
"MIT"
] | permissive | /**
* bwt_mcm_action_timer.hpp
*
* The Timer action allows the user to wait for a given duration. Lua simply
* polls the object to discover whether the timer has fired. The action allows
* for non-blocking and blocking waits.
*
* Copyright © Blu Wireless. All Rights Reserved.
* Licensed under the MIT license. S... | true |
cd8d7fe695d53ee0da8561f1acc48c03cc7c7392 | C++ | franklee26/CS24 | /csproj/main.cpp | UTF-8 | 542 | 2.96875 | 3 | [] | no_license | #include "node.h"
#include "list.h"
#include "expression.h"
#include <iostream>
#include <string>
int main(){
string work="(((x+3)+((x*2)/(x-3)))*((x+7)-((x+2)*(x/2))))";
string easy="((x-9)/((x+3)*(x-7)))";
list l(work);
list g(easy);
node* head=l.gethead();
head=head->getnextleft(head);
std::cout<<head->... | true |
6c6e697c457825a952fbeb61d03295d185cd5d5b | C++ | sojung127/bookish-telegram | /Algorithm_graph/Algorithm_graph/lan.cpp | UTF-8 | 637 | 2.75 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
int k, n;
scanf("%d %d", &k, &n);
vector<int> line(k);
for (int i = 0; i < k; i++) {
scanf("%d", &line[i]);
}
long long len = 0;
for (auto a : line)
len += a;
//
long left = 1;
long right ... | true |
2695557ac19c0c744afa581036304565913cc920 | C++ | hitwlh/leetcode | /98_Validate_Binary_Search_Tree/solution.cpp | UTF-8 | 621 | 3.046875 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
bool isValidBST(TreeNode* root) {
show(root);
return ret;
}
private:
... | true |
648d5fc24af1d4d0330d6a775d0a0f7aa3c91095 | C++ | gautamshah6/Coding_Blocks_Solution-c- | /class_assignment.cpp | UTF-8 | 354 | 3.015625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int solution(int a)
{
if(a==1)
return 2;
if(a==2)
return 3;
int ans=solution(a-1)+solution(a-2);
return ans;
}
int main()
{
int n;
cin>>n;
int *a=new int [n];
for(int i=0;i<n;i++)
{
cin>>a[i];
cout<<"#"<<a[i]<<" : "<<soluti... | true |
2f2d4a84c133f2a4b56ac438de8d6c56d03f9b7d | C++ | baubs/Sudoku | /Part3/Sudoku.cpp | UTF-8 | 769 | 3.328125 | 3 | [] | no_license | //Brandon Aubrey
//Driver for templated sudoku puzzle
//2/24/2015
#include <iostream>
#include <string>
#include "Puzzle.h"
using namespace std;
int main()
{
Puzzle<int> sudoku("sudoku.txt");
sudoku.display();
cout << endl;
int val = '1';
int row, col;
while(val != '0' && !sudoku.finished())
{
... | true |
a76ed9d9c78e9484c3db4562cc93c827ad798581 | C++ | dmgardiner25/CS-Classes | /C++/CS1580/Lab10/lab10_functions.cpp | UTF-8 | 1,099 | 3.3125 | 3 | [] | no_license | /*
Programmer: David Gardiner, 12447993
Instructor: Rushiraj
Section: E
Date: 10/26/16
File: lab10_functions.cpp
Description: Function defintions to encrypt a given name using an NTCA.
*/
#include <iostream>
#include <cctype>
#include "lab10.h"
using namespace std;
void greeting()
{
cout << "Welcome to the Enigma M... | true |
85d316444537b6938542fabcd8fa900ea06b68a1 | C++ | FEniCS/basix | /cpp/basix/moments.cpp | UTF-8 | 19,987 | 2.59375 | 3 | [
"MIT"
] | permissive | // Copyright (c) 2020 Chris Richardson & Matthew Scroggs
// FEniCS Project
// SPDX-License-Identifier: MIT
#include "moments.h"
#include "cell.h"
#include "finite-element.h"
#include "math.h"
#include "quadrature.h"
using namespace basix;
namespace
{
namespace stdex = std::experimental;
template <typename T, std:... | true |
e804218cd3b2ab4081177835550e962aaaa9eab2 | C++ | nori0428/libj | /src/set.cpp | UTF-8 | 1,585 | 2.875 | 3 | [
"BSD-2-Clause"
] | permissive | // Copyright (c) 2012 Plenluno All rights reserved.
#include <set>
#include <utility>
#include "libj/set.h"
#include "libj/string.h"
namespace libj {
class SetImpl : public Set {
private:
class ValueComp {
public:
Boolean operator() (const Value& lv, const Value& rv) const {
return lv.... | true |
a2b745b56c86aa37d5579a79d3c40fd7eb8cf532 | C++ | zhzwill/leetcodegit | /Compare_Version_Numbers.h | UTF-8 | 1,376 | 3.390625 | 3 | [] | no_license | #include <string>
using namespace std;
class Solution {
public:
int compareVersion(string version1, string version2) {
int s1_begin,s1_end;
int s2_begin,s2_end;
s1_begin = 0;
s2_begin = 0;
while (s1_begin < version1.size() && s2_begin < version2.size()) {
s1_end = s1_begin+1;... | true |
782440b4a8081dea27d03260523e6393fff20644 | C++ | opencv/opencv | /samples/cpp/lsd_lines.cpp | UTF-8 | 2,148 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | #include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
using namespace std;
using namespace cv;
int main(int argc, char** argv)
{
cv::CommandLineParser parser(argc, argv,
"{input i|building.jpg|input image}"
... | true |
39dd6f923c185bea0a3a53e17f975e660300915c | C++ | NikeshMaharjan1217/Nikesh-Maharjan | /character.cpp | UTF-8 | 155 | 2.640625 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
main()
{
char a;
printf("Entre a character:");
scanf("%c",&a);
printf("Value of a is %c",a);
getch();
}
| true |
2bc7d2d28e6187b5f96020f2cf8967c1fb15a02b | C++ | Mauricioduque/PARCIAL2 | /Parcial2_Mauricio_Duque/main.cpp | UTF-8 | 2,723 | 2.953125 | 3 | [] | no_license | #include "caniondefensivo.h"
#include "canionofensivo.h"
int main()
{
canionOfensivo disOfensivo;
canionDefensivo disDefensivo;
float Vini,VinO,angleO;
int a;
float d,Yo,Yd;
cout<<"-------SISTEMA DE SIMULACION DE ATAQUES--------"<<endl<<endl;
cout<<"Ingrese la condiciones iniciales"<<endl;
... | true |
72c0ee7a15d44cd3015eda7150b810f73b72851e | C++ | kuangtu/cplusplus | /chap5/exec5_19.cpp | UTF-8 | 500 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
using std::cin;
using std::cout;
using std::endl;
using std::vector;
using std::string;
int
main(int argc, char *argv[])
{
string s1;
string s2;
string resp;
do
{
cout << "please input str1 " << endl;
cin >> s1;
cout << "Please input str2 " <... | true |
8ac95302e376e0310d7bd83876d706db6c465d5e | C++ | sraaphorst/spelunker | /apps/Utils.h | UTF-8 | 745 | 3.203125 | 3 | [
"Apache-2.0"
] | permissive | /**
* Utils.h
*
* By Sebastian Raaphorst, 2018.
*/
#pragma once
#include <cstdlib>
#include <functional>
class Utils final {
private:
Utils() = default;
public:
template<typename P>
static P parse(std::function<P(const char*, char**)> parser, const char *str) {
char *temp = nullptr;
... | true |
bb48b206da7d05abfe16810388d4d1c06d98913b | C++ | cad0921/530-base_class | /5301007/H_41A.cpp | UTF-8 | 484 | 2.53125 | 3 | [] | no_license | #include <bits/stdc++.h>
#define co ios::sync_with_stdio(0); cin.tie(0);
using namespace std;
int main() {
co;
string a, b;
cin >> a >> b;
if (a.length() != b.length())
cout << "NO";
else {
bool can = true;
for (int i = 0; i < a.length(); i++) {
if(a[i... | true |
e8735105f653f0dd8d2e9b9e0d326f1d41376a2c | C++ | jwijffels/Image-Processing | /segmentation.cpp | UTF-8 | 16,010 | 2.703125 | 3 | [] | no_license | #include "mainwindow.h"
#include "ui_mainwindow.h"
//----------------------------------------------------------------------------------
//------------------- FUNCTIONS FOR THE SEGMENTATION TAB ---------------------------
//----------------------------------------------------------------------------------
//F... | true |
b69fb5a61162c91ac090abb65b9ef9da955e1a82 | C++ | Red-mar/CrossChess | /src/tile.cpp | UTF-8 | 1,750 | 3.0625 | 3 | [] | no_license | #include "tile.h"
Tile::Tile(Window *window, Hex hexTile, Layout layout) : window(window),
tileIndex(tileIndex),
hexagon(nullpt... | true |
7776bbec6bae6a5b074933a7c23159ccd37ccccd | C++ | kurocha/commander | /source/Commander/Commands.hpp | UTF-8 | 851 | 2.859375 | 3 | [
"MIT"
] | permissive | //
// Commands.hpp
// This file is part of the "Commander" project and released under the MIT License.
//
// Created by Samuel Williams on 19/8/2017.
// Copyright, 2017, by Samuel Williams. All rights reserved.
//
#pragma once
#include "Map.hpp"
namespace Commander
{
class Command;
class Commands : public Ma... | true |
dc35db4caf97d1da5209e214ef450fc57d8c44e2 | C++ | cvl-umass/libspline | /additiveModel.cpp | UTF-8 | 13,661 | 2.90625 | 3 | [
"BSD-3-Clause"
] | permissive | /* Author : Subhransu Maji
*
* Implements encoding methods
*
* Version 1.0
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "additiveModel.h"
#define INF 1e10
typedef signed char schar;
template <class T> static inline void swap(T& x, T& y) { T t=x; x=y; y=t; }
#ifndef min
template <class T... | true |
ada5b2a51a7df58a984c3dc605278565c6a8378f | C++ | gbrlas/AVSP | /CodeJamCrawler/dataset/10_7936_76.cpp | UTF-8 | 558 | 2.859375 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
long long gcd(long long a,long long b){
return (b==0)?a:gcd(b,a%b);
}
int main(){
int C; cin >> C;
for(int c=0;c<C;++c){
int T; cin >> T;
vector<long long> time(T,0);
for(int i=0;i<T;++i){
long long t;
cin >> t;
time[i]=t;... | true |
ab762a0ae3259434bfe551589c9957ef38048ebf | C++ | aubreyfern/data-structures | /aubreyfernando_assignment6/ShellSort.cpp | UTF-8 | 1,337 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <fstream>
#include <cstdlib>
#include "math.h"
#include "ShellSort.h"
using namespace std;
ShellSort::ShellSort()
{
}
ShellSort::ShellSort(string file)
{
fileName = file;
readInFile();
}
ShellSort::~ShellSort()
{
delete[] theArray;
}
voi... | true |
0b5cbd7cd23313a309a1ef75a76627618c8f5aae | C++ | dmzld/algorithm | /BOJ/2805_나무자르기.cpp | UTF-8 | 789 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int N;
long long M;
vector<long long> W, sum;
long long find(int idx){
for (long long h = W[idx]; h < W[idx + 1]; h++){
if ((sum[N] - sum[idx]) - (N - idx)*h < M){
return h - 1;
}
}
}
int main(){
ios::sync_with_stdio(0);
cin... | true |
79ac3242c8fabba0c7a5889d95df136f22ba4e76 | C++ | CIVICS/Interactive_Development_in_Open_Frameworks | /c++_basic_code_examples/CircleNames/CircleNames/main.cpp | UTF-8 | 724 | 3.234375 | 3 | [] | no_license | //
// main.cpp
// CircleNames
//
// Created by Phoenix Perry on 05/11/14.
// Copyright (c) 2014 Phoenix Perry. All rights reserved.
//
#include <iostream>
#include <vector>
using namespace std;
struct Circle
{
int x;
int y;
int w;
int h;
string name;
};
const int numCircles = 3;
vector <string... | true |
e7e1edbf0e7c0859743dee4f67bf6e31f498037f | C++ | spsu/os | /source/ltscheduler.cpp | UTF-8 | 4,364 | 3.0625 | 3 | [] | no_license | #include "ltscheduler.hpp"
#include "memory.hpp"
#include "processlist.hpp"
#include "pcb.hpp"
#include <vector>
#include <iostream>
using namespace std;
void LongTermScheduler::schedule()
{
moveFinishedToDisk();
moveNewToRam();
}
void LongTermScheduler::moveNewToRam()
{
vector<Pcb*> newPcbs;
Pcb* pcb = 0;
// ... | true |