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
69f895a2b77e2cf6b5bb519394568ecc43ca7454
C++
ssoo2024/Programmers
/Problems[LV3]/[LV3]GPS.cpp
UTF-8
1,081
2.671875
3
[]
no_license
#include <vector> #include <algorithm> using namespace std; int g[201][201]; int dfs(int n, int pos, vector<int> &gps_log) { if (pos == 1) { return g[gps_log[pos]][1] ? 0 : 1000; } int ans = 1000; for (int i = pos; i > 0; i--) { if(i == 1) return g[gps_log[i]][gps_log[0]] ? 0 : 1000; else{ ...
true
680596eb184274899b5635b727ab3693b1cde2bf
C++
MillerRidgeway/OperatingSystems_W18
/Lab4/MemorySubsystemS2018/PhysicalMemory.h
UTF-8
2,840
3.34375
3
[]
no_license
/* Interface to physical memory * * File: PhysicalMemory.h * Author: Mike Goss <mikegoss@cs.du.edu> * * Created on June 29, 2017, 11:45 AM */ #ifndef MEM_PHYSICALMEMORY_H #define MEM_PHYSICALMEMORY_H #include "MemoryDefs.h" #include <cstddef> #include <vector> namespace mem { class PhysicalMemory { publi...
true
abf4c9543fe64b709519399c53d37f6b203ea8bd
C++
spider3177/Lab-5
/q23.cpp
UTF-8
267
3.1875
3
[]
no_license
// first the library #include <iostream> using namespace std; int main(){ //declaring the variables int a; // asking for a number cout<< "Gimme any natural number "<<endl; cin>>a; //formulating while (a>0){ cout<<"Back it up "<< a<<endl; --a; } return 0; }
true
8adbe8028c80e7217f645c626538c154ea924dbd
C++
ebanjo-2/undicht_0.36
/undicht/engine/src/2D/animated_sprite.cpp
UTF-8
1,049
2.640625
3
[]
no_license
#include "animated_sprite.h" namespace undicht { AnimatedSprite::AnimatedSprite() { //ctor } AnimatedSprite::~AnimatedSprite() { //dtor } void AnimatedSprite::setAnimation(Animation2D* animation) { m_current_animation = animation; } void AnimatedSprite::setAnima...
true
95282d0033471560c4703b83389bf2c4dd431a8c
C++
gbrlas/AVSP
/CodeJamCrawler/dataset/09_23662_49.cpp
UTF-8
555
2.5625
3
[]
no_license
#include <stdio.h> int main(){ int ecase,ecount; int en; char input[10000]; int info[1000]; int i,j,k; int ans; scanf("%d",&ecase); for(ecount=1;ecount<=ecase;ecount++){ scanf("%d",&en); for(i=0;i<en;i++){ scanf("%s",input); info[i]=0; for(j=0;j<en;j++) if(input[j]=='1') info[i]=j; } ...
true
3b88b21096ac3fac278b99b4e4f0eeacba30ef39
C++
PavelLab/mp2-lab6-TText
/mp2-lab6-test/TTextLink.cpp
WINDOWS-1251
1,655
2.984375
3
[]
no_license
#include "TTextLink.h" #include "TText.h" void* TTextLink::operator new(size_t size) { TTextLink *pLink = MemHeader.pFree; if (MemHeader.pFree != NULL) MemHeader.pFree = MemHeader.pFree->pNext; return pLink; } void TTextLink::operator delete(void *pM) { TTextLink *pLink = (TTextLink*)pM; pLink->pNext = MemHeader....
true
6d3ab523ab45d93e6f18a9fe995d093dfb901ab8
C++
shauuebbit/procon
/library/util/timer.hpp
UTF-8
1,723
3.375
3
[]
no_license
#pragma once #include <chrono> #include <stack> #include <vector> class Timer { private: std::stack<std::chrono::system_clock::time_point, std::vector<std::chrono::system_clock::time_point>> time_stack; public: Timer() = default; void start() { auto t = std::chrono::system_clock::now(); ...
true
3a1d1016dc939bc524be4fe7ba44ce3b0928f95a
C++
shnoh171/problem-solving
/backjoon-online-judge/9012-parenthesis/parenthesis.cpp
UTF-8
762
3.28125
3
[]
no_license
#include <iostream> #include <stack> #include <string> using namespace std; // https://www.acmicpc.net/problem/9012 // Not good coding style istream& is_correct_paren(istream& in, ostream& out); int main() { ios_base::sync_with_stdio(false); int num; cin >> num; for (int i = 0; i != num; ++i) is_correct_pare...
true
ab82df7cef02bdc9c5bde221e77608f9b53c4b87
C++
burns534/Terrain-generation
/Elements.h
UTF-8
17,393
2.8125
3
[]
no_license
// // Header.h // Game1 // // Created by Kyle Burns on 1/22/20. // Copyright © 2020 Kyle Burns. All rights reserved. // #ifndef Header_h #define Header_h #pragma once #include "NoiseMap.h" #include <fstream> #include "VectorUtility.h" std::ofstream outfile; class Elements { public: unsigned* indices; fl...
true
8a6ca6ae08ab9f663d90d4b55fcbae02d7afc9a5
C++
ashishpandey2600/Lab10
/Assignment2/q1.cpp
UTF-8
1,236
3.640625
4
[]
no_license
#include<iostream> #include<vector> using namespace std; class vectors{ public: vector<float> name; void create() { name.push_back(3.12); name.push_back(4.54); name.push_back(5.54); } void modify() {float store; cout<<"before modification"<<endl; fo...
true
047668656f68e1dba1c64f3c00ea291e41c6d5e3
C++
jakubbaron/projecteuler
/0035/main.cpp
UTF-8
2,109
3.875
4
[]
no_license
#include <iostream> #include <set> #include <vector> #include <cmath> #include <algorithm> // The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. // // There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97. //...
true
64ef7b9370e6e59dfe89fa5b31912fd2b7a8e470
C++
NikeshMaharjan1217/Nikesh-Maharjan
/electricity bill.cpp
UTF-8
300
2.875
3
[]
no_license
#include<stdio.h> #include<conio.h> main() { int n,amt; printf("Enter the value of n:"); scanf("%d",&n); if(n<=80) { amt=1000; } else if(n<=150) { amt=1000+(n-80)*15; } else { amt=1000+70*15+(n-150)*20; } printf("Total bill amount is %d",amt); getch(); }
true
0d642a245d4b63d6a51e4c8865b8a7526f7e543d
C++
Inryu/algorithm
/BOJ/DFS BFS/14502 연구소.cpp
UTF-8
2,606
3.15625
3
[]
no_license
#include <iostream> #include <algorithm> #include <vector> #include <queue> #include <cstring> using namespace std; int N,M; int map[10][10]; int tmpMap[10][10]; bool visited[10][10]; //BFS 용 int dr[4]={-1,0,1,0}; int dc[4]={0,1,0,-1}; int maxVal=-1; vector<pair<int,int>> threeWalls(3); //고른 3개의 벽 vector<pair<int,int...
true
8c9cda9a48ccc1484e1fe720d7dbea4191411e39
C++
UnsafePointer/opengl-renderer-tests-archived
/src/main.cpp
UTF-8
637
2.921875
3
[]
no_license
#include "Renderer.hpp" int main() { Renderer renderer = Renderer(); std::vector<Vertex> vertices = { Vertex(0.5f, -0.5f, 1.0f, 0.0f, 0.0f), Vertex(-0.5f, -0.5f, 0.0f, 1.0f, 0.0f), Vertex(0.0f, 0.5f, 0.0f, 0.0f, 1.0f) }; bool quit = false; while (!quit) { SDL_...
true
42e2e950127bb36f513e84f11bf51dde387a82e2
C++
Huangxy0106/Renderer
/code/Part2/src/chapter7/depth_reciprocal/lib/include/GraphicsLibrary.h
UTF-8
1,062
2.703125
3
[ "Apache-2.0" ]
permissive
#ifndef _GRAPHICSLIBRARY #define _GRAPHICSLIBRARY #include <GraphicsDevice.h> #include <vector> #include <algorithm> #define ABS(x) ((x)>0?(x):-(x)) class Point4 { public: double X, Y, Z, W; std::vector<double> ValueArray;//本顶点属性集合,在多属性插值MultipleInterpolationArrayIn2D中使用 Point4(double x, double y, double z, double w...
true
5c70524c4cfe2ab79b250962b1b3c3cb6262c7c8
C++
salma77/Codeforces
/478A.cpp
UTF-8
214
2.84375
3
[]
no_license
#include <iostream> using namespace std; int main() { int x, sum = 0; for (int i = 0; i < 5; i++) { cin >> x; sum += x; } if (sum % 5 == 0 && sum != 0) cout << sum / 5; else cout << "-1"; return 0; }
true
88cdbadfe4c60374a79518a11d30697f5e9e5f8f
C++
JackCui001/Solutions_for_CodeForces
/A-Set/461A - Appleman and Toastman.cpp
UTF-8
370
2.78125
3
[]
no_license
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { vector<int> group; long long i,num,temp,sum=0,ans=0; cin>>num; for(i=0;i<num;i++) { cin>>temp; group.push_back(temp); sum+=temp; } sort(group.begin(),group.end()); ans=sum; for(i=0;i<num-1;i++) { ans+=sum; ...
true
4f2ff6bfc8f5937bcb78feac217dbd7f05d01428
C++
purvasingh96/HackerRank-solutions
/algorithm/implementation/Fair Rations.cpp
UTF-8
1,981
2.65625
3
[]
no_license
#include <map> #include <set> #include <list> #include <cmath> #include <ctime> #include <deque> #include <queue> #include <stack> #include <string> #include <bitset> #include <cstdio> #include <limits> #include <vector> #include <climits> #include <cstring> #include <cstdlib> #include <fstream> #include <numeric> #inc...
true
59cdc7598b9776ac2af636908bc0be028dd22bde
C++
BrizziB/SerialKMeans
/cluster.h
UTF-8
1,451
3.140625
3
[]
no_license
// // Created by Boris on 13/03/2017. // #ifndef SERIALKMEANS_CLUSTER_H #define SERIALKMEANS_CLUSTER_H #include <iostream> #include <fstream> #include <string> #include <iterator> #include <algorithm> #include <vector> #include "Point.h" #include <list> class cluster{ private: Point centroid; std::vector<Po...
true
a0a508ce300537cafaf91212939b2629283f8103
C++
AlonsoCerpa/ComputerNetworks
/UDP_v1/dividir_en_bloques.h
UTF-8
1,633
3.375
3
[]
no_license
#include <vector> #include <fstream> #include <sstream> #include <iostream> using namespace std; int contar_caracteres(char const* filename) { FILE * f; int numero = 0; char caracter; f = fopen (filename, "r"); if (f == NULL) { return -1; } while (feof (f) == 0) { fscanf (f, "%c", &caracter); numer...
true
4351b54964c1064e6d6b0948521e64421849b7ec
C++
ttdyce/Dynamic-embedding-labeller
/selected-data/1775.cpp
UTF-8
1,138
3.0625
3
[]
no_license
#include <iostream> #include <stdio.h> #include <math.h> #include "../StateIntercept.cpp" #include <string.h> using namespace std; Intercept<int> s(Intercept<int> a, Intercept<int> b) { Intercept<int> intercepts[] = {Intercept<int>(0, 3), Intercept<int>(0, 2), Intercept<int>(0, 8), Intercept<int>(0, 5), Intercept<int...
true
10dca1af77e48071619445a9ae920933951414f3
C++
JacobianDet/CompeteUp
/ecf41/tt.cpp
UTF-8
349
2.53125
3
[]
no_license
#include <bits/stdc++.h> int main(void) { int n,m; std::cin>>n>>m; int col[n+1]; memset(col,0,sizeof(col)); int ctr = 5000; for(int i=0;i<m;i++) { int x; std::cin>>x; col[x]++; } /*for(int i=1;i<=n;i++) std::cout<<col[i]<<"\n";*/ for(int i=1;i<=n;i++) { if(col[i] < ctr) ctr = col[i]; } std::...
true
f484fda86c175fb3565f3772f25cbababcb75143
C++
celestecote21/ray_tracer_cpp
/Material.hpp
UTF-8
429
2.703125
3
[]
no_license
#ifndef MATERIAL_H #define MATERIAL_H #include "Vec3.hpp" #include "Ray.hpp" #include "Hitable.hpp" // abstract class, une methode qui prend la ray recu, le dernier record (pour avoir le point, la normal..) // une ref vers un Vec pour l'attenuation et une ref vers la ray qui va sortir class Material{ public: vir...
true
17114f51439cc86536523e39b13aa922fd04ff79
C++
alicecaron/tpinf224
/tp1/Video.h
UTF-8
597
2.90625
3
[]
no_license
#ifndef VIDEO_H #define VIDEO_H #include "Multimedia.h" class Video : public Multimedia { private: float duree; public: Video(); Video(string _nom,int _date, string _path,float _duree); /** * @brief getDuree * @return * Récupérer la durée de la vidéo */ const virtual float getDu...
true
bff512ccca84979617266e7db9ae38147c1fd81d
C++
WhiZTiM/coliru
/Archive2/4b/31ac15563e636f/main.cpp
UTF-8
789
2.828125
3
[]
no_license
#include <regex> #include <string> #include <iostream> int main() { const std::wstring str = L"We bought the grocer oil worth 2,48 drachmas. " "soap worth 94 drs. and rice worth 11,75 drachmas." "How much change will take from 7/8 of 50 drachmas?...
true
1280e18c7f3b6e3718a692c41a50e3eeff98e269
C++
BoChang11/ActionAndMotionPlanner
/src/MP/Action.hpp
UTF-8
1,285
2.796875
3
[]
no_license
#ifndef ABETARE__ACTION_HPP_ #define ABETARE__ACTION_HPP_ #include "Utils/Constants.hpp" #include "Utils/HashFn.hpp" #include <functional> namespace Abetare { struct Action { enum Type { TYPE_MOVE = 0, TYPE_MOVE_WITH_OBJECT = 1, TYPE_PICKUP = 2, TYPE_RELEASE = 3 ...
true
0524310a7d58e67da1a05a6f3150c6e707aa8147
C++
Ferdinand-vW/Hackerrank
/cpp/attending_workshops/main.cpp
UTF-8
1,773
3.734375
4
[]
no_license
#include<bits/stdc++.h> using namespace std; //Define the structs Workshops and Available_Workshops. //Implement the functions initialize and CalculateMaxWorkshops struct Workshop { int start_time; int duration; int end_time; }; struct Available_Workshops { int n; std::vector<Workshop> workshops;...
true
8bf54b6947bc9b919eddd67966b67be0377fe8bf
C++
PingguSoft/ESP8266
/Bebop/utils.cpp
UTF-8
6,436
2.734375
3
[]
no_license
/* This project 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 Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WI...
true
c9080b0cc169494f39b0400a36f6dd9c78a39cb0
C++
JMCeron/Arduino
/Energy_Shield/DemoConfigureRTC/Rtc.cpp
UTF-8
7,230
3.359375
3
[]
no_license
#include <string.h> #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include "Wire.h" #include "Rtc.h" /////////////////////////////////////// //public functions /** * 1) Sets the date and time on the ds1307 * 2) Starts the clock * 3) Sets hour mode to 24 hour clock * Assumes you're passing in valid ...
true
82f1927ee10fc08118ae2f8f995a02c581bfd1be
C++
biomorphs/DemoFramework
/tests/test_string_hash.cpp
UTF-8
875
3.015625
3
[]
no_license
/* DemoFramework Matt Hoyle */ #include "catch.hpp" #include "core/string_hashing.h" TEST_CASE("Simple string hashing correct", "[Core::StringHashing]") { SECTION("Null string is empty hash") { REQUIRE(Core::StringHashing::GetHash(nullptr) == Core::StringHashing::EmptyHash); } SECTION("Empty string is empty has...
true
6abac07021f7f59568c8975cd3e4305d9156cc83
C++
cesar-magana/Leet-Code
/0297. Serialize and Deserialize Binary Tree/serialize01.cpp
UTF-8
1,133
3.5
4
[]
no_license
// Encodes a tree to a single string. string serialize(TreeNode* root) { string res = ""; if (root == NULL) return res; res += to_string(root->val); makeSerialize(root->left, res); makeSerialize(root->right, res); return res; } void makeSerialize(TreeNode* root, string& res) { if (root == N...
true
767504cad9ad3eab754f6ccc8d8121d3c9b2532e
C++
ZimboPro/WTC
/3rdSemester/CPP/AbstractVM/Parse.cpp
UTF-8
5,546
2.78125
3
[]
no_license
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Parse.cpp :+: :+: :+: ...
true
e224413eab5c570f1f43eaa1bef40027ce44bd82
C++
ai5/gpsfish
/osl/core/osl/bits/align16New.cc
UTF-8
991
2.59375
3
[]
no_license
/* align16New.cc */ #include "osl/bits/align16New.h" #include <cassert> #include <cstdlib> void * osl::misc::Align16New::operator new(size_t size) { char *ptr = ::new char[size+Alignment]; for (int i=0; i<Alignment; ++i) { if (reinterpret_cast<unsigned long>(ptr + i + 1) % Alignment == 0) { *(ptr + i) =...
true
471c04d6229407587e64c8174f8a2ae8ae74c070
C++
w86763777/ACM_ICPC_codebook
/Source/Graph_Maximum_Cardinality_Matching.cpp
UTF-8
3,224
2.75
3
[]
no_license
#include <cstdio> #include <queue> #include <cstring> using namespace std; struct BlossomAlgorithm { private: // number of vertex, zero base static const int N = 205; int match[N]; int d[N]; queue<int> q; deque<int> path[N]; void label_one_side(int x...
true
23e634ce4c2be8885bd467c01c7502828d355019
C++
mfkiwl/FlyDog_SDR_GPS
/extensions/DRM/dream/MSC/logicalframe.h
UTF-8
2,243
3.03125
3
[ "MIT" ]
permissive
#ifndef LOGICALFRAME_H #define LOGICALFRAME_H /* * 3.1 * logical frame: data contained in one stream during 400 ms or 100 ms * 5.2 The channel coding of DRM is performed on logical frames of constant bit rate for any given combination of parameters. * 6.2.2 * The MSC contains between one and four streams. Each st...
true
a48b5857d85162485b09a2a966c77f17bba54844
C++
yongyanghz/Last-mile-delivery-problem
/cainiao - 3.1/src/location.cpp
UTF-8
478
2.78125
3
[]
no_license
#include "location.h" location::location() { //ctor } location::~location() { //dtor } location::location(string s,double lng,double lat): id_(s),lng_(lng),lat_(lat){ } void location::setID(string str){ id_ = str; } string location::id(){ return id_; } void location::setLng(double value){ ln...
true
d7ece8502b8ac441aa0572513dfa2aa5a83f0033
C++
papicheng/offer-boom
/.vscode/linknode_insert.cpp
WINDOWS-1252
1,268
2.515625
3
[]
no_license
/*ܣ*/ #include<bits/stdc++.h> using namespace std; struct Node{ int val; Node* next; Node(int x): val(x){}; }; typedef struct Node Node; int mian(){ Node* pre, cur ,head; head = (Node*)malloc(sizeof(Node)) return 0; } int cnt = 0; queue<vector<int>> que; for(int i = 0; i < g...
true
76420b803c0e617ccc68f212f2b063533388b3d0
C++
eitanshalev/Lion-King-Scar
/Lion King Scar/src/main.cpp
UTF-8
261
2.640625
3
[]
no_license
#include "Menu.h" #include <cstdlib> int main() { Menu menu; try { menu.run(); } catch (std::exception& ex) { std::cout << ex.what(); std::cout << "can not read this file!\n"; } return EXIT_SUCCESS; }
true
417acaf1c94229fe7bac73b410443eddb4885eaf
C++
demonsheart/C-
/rongyu/homework1/file/2018152086_1042_答案错误_605.cpp
UTF-8
662
3.140625
3
[]
no_license
#include<iostream> using namespace std; int compare(char* s,char*t){ int i,j,sum1=0,sum2=0; for(i=0;i<10;i++){ if(*(s+i)!='\0'&&*(t+i)!='\0'){ if(*(s+i)>*(t+i)){ sum1++; } else if(*(s+i)<*(t+i)){ sum2++; } } else if(*(s+i)=='\0'&&*(t+i)=='\0'){ break; } else if(*(s+i)=='\0'&&*(t+i)!...
true
229ab9e47c6d11c06e7e96ecee9cbb563c30cde3
C++
arlechann/atcoder
/AtCoder/AtcoderBiginnersSelection/ABC086C.cpp
UTF-8
993
3.28125
3
[ "CC0-1.0" ]
permissive
#include<cstdio> #include<cstdlib> typedef struct{ int t; int x; int y; }Plan; int n; Plan plan[100000]; bool solve(void); int manhattan_distance(int x1, int y1, int x2, int y2); int main(void){ scanf("%d", &n); for(int i = 0; i < n; i++){ scanf("%d %d %d", &plan[i].t, ...
true
12dbfc77046f461db4d99666f26ef7f92f128f70
C++
YashavikaSingh/leetcodegrind
/804.cpp
UTF-8
1,063
3.0625
3
[]
no_license
#include <string> #include <vector> #include <map> #include <iostream> using namespace std; int uniqueMorseRepresentations(vector<string> &words) { int count = 0; vector<string> m{".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.", ".....
true
b793c39210d6ff30773eaac9db9891cfbe258089
C++
noachain/dapp
/programs/globalfunction.h
UTF-8
728
2.84375
3
[]
no_license
#ifndef GLOBALFUNCTION_H #define GLOBALFUNCTION_H #include <iostream> #include <string> #include <vector> namespace globalFun { static std::vector<std::string> spliteStr_g(const std::string &strTol,const std::string &strSplite) { std::vector<std::string> retVect; if("" == strTol) { return retVect...
true
d3755dfb697c11cfcfe9a857eb933abe8d88c0cb
C++
SanD94/USACO
/shuttle/shuttle.cpp
UTF-8
1,635
2.921875
3
[]
no_license
/* ID: safaand1 PROG: shuttle LANG: C++11 */ #include <iostream> #include <cstdio> using namespace std; int N; char map[30]; int res[5000]; int cnt; int level; bool check(){ for(int i=0;i<N;i++) if(map[i]!='B' || map[i+N+1]!='W') return 0; return 1; } void swap(char &a, char &b){ ...
true
ea9bf9765f6bd9fb25076a89090977bca4b9b29d
C++
gagan86nagpal/SPOJ-200
/TWOSQRS/main.cpp
UTF-8
608
2.828125
3
[]
no_license
#include <iostream> #include <math.h> using namespace std; int main() { int t; cin>>t; while(t--) { long long n; cin>>n; long long a =0; long long b = sqrt(n)+1; bool flag = false; while(a<=b) { long long c = a*a + b*b; if(...
true
723e1a901e91336afa0bc4101cb23453905630c1
C++
rummansust/Codeforces-Contest
/Codeforces/Codeforces Round #181 (Div. 2)/B.cpp
UTF-8
3,963
2.59375
3
[]
no_license
#include <cstdio> #include <cmath> #include <algorithm> #include <iostream> #include <deque> #include <queue> #include <stack> #include <vector> #include <map> #include <cstdlib> #include <cstring> #include <string> #include <ctime> #include <sstream> #define clr(name,val) memset(name,val,sizeof(name));...
true
627908f3a7605e925a74725e84e73a6bf1f93960
C++
hzh0/LeetCode
/1584. 连接所有点的最小费用.cpp
UTF-8
1,453
2.71875
3
[]
no_license
class Solution { public: class Djset { public: vector<int> parents; int count; Djset(int n) { for (auto i = 0; i < n; ++i) { parents.push_back(i); } count = n; } int find(int num) { if (parents[num] != num)...
true
218b2add386ffa95acfd9907098ad2cbf023a59b
C++
caiji200/cs330Assignment5
/Process.cpp
UTF-8
1,514
3.21875
3
[]
no_license
#include "Process.h" Process::Process() { Priority = 0; processingTime = 0.0; burstTime = 0.0; processName = ""; }; Process::Process(int myPriority, float myProcessingTime, float myBurstTime, string myProcessName) { this->Priority = myPriority; this->processingTime = myProcessingTime; this->burstTime =...
true
12f78eaec8799e1025ca19bc16ab757e50a26680
C++
dihesoyam/carder_on_c
/core/core.cpp
UTF-8
533
2.84375
3
[]
no_license
#include <iostream> #include "funcs.h" using std::cout; using std::endl; using std::cin; int launch() { int first, second, rnd_value, *value_address; start = true; if(start){ cout<<"Enter minimal value: "<<endl; cin>>first; cout<<"Enter value of scatter: "<<endl; cin>>second; ...
true
4ef50bde101c99282b1d1d07d4e2d6135d626de8
C++
alanbu/tbx
/tbx/path.h
UTF-8
13,148
2.53125
3
[]
no_license
/* * tbx RISC OS toolbox library * * Copyright (C) 2010-2014 Alan Buckley All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including withou...
true
e841efabf2cfdf20f061b1b5adf17c9cc14554d8
C++
rlee32/standard-k-opt
/k-opt/fileio/PointSet.cpp
UTF-8
1,971
3.03125
3
[]
no_license
#include "PointSet.h" namespace fileio { PointSet::PointSet(const char* file_path) { std::cout << "\nReading point set file: " << file_path << std::endl; std::ifstream file_stream(file_path); if (not file_stream.is_open()) { std::cout << "ERROR: could not open file: " << file_path << std::endl...
true
c8d262d8f2f28fb8269be89eebb082b4e2269000
C++
pmeade/dragons
/src/HouseState.h
UTF-8
514
2.765625
3
[]
no_license
// // Created by Patrick Meade on 2019-03-26. // #ifndef DRAGONS_HOUSESTATE_H #define DRAGONS_HOUSESTATE_H #include <ostream> struct HouseState { uint8_t dimension; uint8_t number; uint32_t value; friend ostream &operator<<(ostream &os, const HouseState &state) { ios_base::fmtflags stream_s...
true
ccb0a4e87b00538090a0f73390ade1a76897c55a
C++
LuukSteeman/Themadevices-groep_7
/src/Gamemaster/controllers/transferController.hpp
UTF-8
1,019
3.171875
3
[]
no_license
#pragma once #include "../entity/damageStorage.hpp" #include "rtos.hpp" #include "transferController.hpp" #include "hwlib.hpp" #include "../boundary/usb.hpp" /* Transfer controller can be run by running run and giving it a task */ class TransferController { public: /** Create a transfer controller @p...
true
af3fac8cc666b166d4d0d432dda789573c887c77
C++
tkr987/NyaGadget
/GT_Kruskal.h
UTF-8
4,399
3.28125
3
[]
no_license
#include <bits/stdc++.h> using namespace std; namespace NyaGadget { /*** クラスカル法ライブラリ ***/ struct GT_Kruskal { struct Edge { long long f = 0; // from vertex long long t = 0; // to vertex long long cost = 0; bool operator < (const Edge& r) { return cost < r.cost; } }; /** @brief 最小全域木の最小コストを求め...
true
06cd099080f6186af0de2867feeb0a70fd22c8f0
C++
pdet/kaleidoscope
/src/include/ast/ExprAST.hpp
UTF-8
386
2.515625
3
[]
no_license
#pragma once #include "llvm/IR/BasicBlock.h" // Base Class for all expression nodes. class ExprAST{ public: virtual ~ExprAST() = default; // Value is an LLVM object used to represent SSA register // Its value is computed as the related instruction executes and it does not get a new value until // (and if) th...
true
979deafa77688070e4023719be002e604abdc1a8
C++
FRENSIE/FRENSIE
/packages/monte_carlo/collision/electron/src/MonteCarlo_ElectronScatteringDistributionNativeFactoryHelpers.cpp
UTF-8
2,287
2.5625
3
[ "BSD-3-Clause" ]
permissive
//---------------------------------------------------------------------------// //! //! \file MonteCarlo_ElectronScatteringDistributionNativeFactoryHelpers.cpp //! \author Luke Kersting //! \brief The electron scattering distribution native factory helpers definitions //! //------------------------------------------...
true
b41a307809913a5c4df75eab2b80ee081547c495
C++
tjt7a/VASim
/test/VASim/testExactStringMatch.cpp
UTF-8
2,059
3.234375
3
[]
permissive
#include "automata.h" #include "test.h" /** * Adds STEs to an automata to match an exact string. Simulates the automata on that string. Should obviously have one report at the end of simulation. */ using namespace std; string testname = "TEST_EXACT_MATCH"; string wrapWithBrackets(char c) { string str = s...
true
2f5854aa7d334d2e620b3a77069eef33411552d9
C++
progdn/ProGDN-RVI
/src/progdn_core/ip_address_helper.h
UTF-8
480
2.671875
3
[]
no_license
#pragma once #include <boost/asio.hpp> namespace progdn { struct IP_Host { uint32_t host; IP_Host() = default; IP_Host(const char* serialized) { struct in_addr addr; if (!::inet_pton(AF_INET, serialized, &addr)) throw std::invalid_argument(std:...
true
e4359543c4ec9bf32294efcc9a481716fd883b6e
C++
YanaPatyuk/MyProjects
/Advanced programming 1-C++/ex7/src/server/src/Server.cpp
UTF-8
7,039
2.765625
3
[]
no_license
/* * Server.cpp * * Created on: 2 בדצמ׳ 2017 * Author: yanap */ #include "../include/Server.h" #include <unistd.h> Server::Server(int port, CommandManager *controller) : port(port), serverSocket(0), pool(10) { this->controller = controller; cout << "Server" << endl; this->stopGame = 0; } void ...
true
aabb70139e8212b10c3d2393db9ce26ce0334d3f
C++
huangshengh/c-primer
/16.6/源.cpp
UTF-8
585
3.59375
4
[]
no_license
#include <iostream> #include <vector> #include <list> #include <string> // the same as std::begin template<typename T, unsigned size> T* begin_def(T(&arr)[size]) { return arr; } // the same as std::end template<typename T, unsigned size> T* end_def(T(&arr)[size]) //We usually don't use a function name which is the ...
true
2830705af377a78498c14de9343df7f38445a549
C++
HardwareIR/netlistDB
/src/serializer/serializer_io.cpp
UTF-8
1,948
2.734375
3
[ "MIT" ]
permissive
#include <netlistDB/serializer/serialization_io.h> #include <boost/filesystem/operations.hpp> namespace netlistDB { namespace serializer { void iSerializationIO::file_extension(const std::string & extension) { FILE_EXTENSION = extension; } void iSerializationIO::hierarchy_push(const std::string & name) { } void iSe...
true
66e91c7fcd54d072b60be72fda988d3d5ea454d5
C++
KaileyCozart/Data-Structures-Final-Project
/Emergency Room Simulation/Emergency Room Simulation/Doctor.h
UTF-8
948
3.09375
3
[]
no_license
#pragma once #ifndef DOCTOR_H_ #define DOCTOR_H_ #include "Random.h" #include "Staff.h" class Doctor : public Staff { private: int max_treatment_time = 20; int treatment_time = 0; int max_severity = 20; int start_time = 0; Random* my_random = new Random(); public: Doctor(); ~Doctor(); int get_max_severity...
true
7dac602b118701e554e0862543c4f062215d14a9
C++
egormkn/SDLXX
/examples/game/game.h
UTF-8
1,796
2.515625
3
[ "Zlib" ]
permissive
#ifndef SDLXX_GAME_H #define SDLXX_GAME_H #include <box2d/box2d.h> #include "Box2DDrawer.h" namespace sdlxx { class Game : public Scene { public: explicit Game() : Scene("The game") { b2Vec2 gravity(0.0f, 9.8f); world = std::make_unique<b2World>(gravity); b2BodyDef groundBodyDef; groundBodyDef.po...
true
fe2c5b8deb3b0d71c222d1e649ee686ae66fe4fa
C++
dani125/Airline-Reservation-System
/Airplane/Airplane/Airplane/Airplane/Flight.h
UTF-8
976
2.6875
3
[]
no_license
#pragma once #include <iostream> #include <string> #include "AircraftSeat.h" using namespace std; const int totalSeat = 20; class Flight:public AircraftSeat { public: Flight(); ~Flight(); void setDeparture(string ); string getDeparture(); void setArrival(string); string getArrival(); void setDepartTime(st...
true
fefa9f355413347c9b6210ecc561a8e3167fb746
C++
Vangasse/Huffman
/node.cpp
UTF-8
979
3.140625
3
[]
no_license
#include "node.h" unsigned char Node::getValue() const { return value; } void Node::setValue(unsigned char value) { this->value = value; } QByteArray Node::getElement() const { return element; } void Node::setElement(QByteArray element) { this->element = element; } int Node::getNumber() const { ...
true
2dc0a51598ee4b21fc613d83d0b2d6c7f8b24712
C++
NLObedear/MagicCards
/Magic Cards Code/Custom_Game_GP/InGameStateManager.cpp
UTF-8
1,482
2.921875
3
[]
no_license
#pragma once #include <iostream> #include "GameStates.cpp" #include "InGameStates.cpp" #include "EndGame.cpp" #include "PlayerTurn.cpp" #include "ComputerTurn.cpp" class InGameStateManager { private: EndGame quitgame; PlayerTurn playert; ComputerTurn compt; Field* field; PlayerHealth* health; InGameStates* _c...
true
2072c6ae88df9d2afcf90debe25c7e1a5b441184
C++
Hannna/robocupsslclient
/ robocupsslclient/Plays/KickOffPlay.cpp
UTF-8
2,404
2.546875
3
[]
no_license
/* * KickOffPlay.cpp * * Created on: 24-05-2011 * Author: maciek */ #include "KickOffPlay.h" KickOffPlay::KickOffPlay( std::string teamColor ): Play( teamColor, 3) { /*przygotowuje roboty do wykopu pilki ze srodka boiska * */ // void SimplePlay::prepareForKickOff(const Vector2D& kickoffPose){ /* LOG...
true
2cf73b4117e025a6eba735adc168456177dc2238
C++
sammyne/LeetCodeCpp
/406-Queue-Reconstruction-by-Height/main.cpp
UTF-8
1,282
3.40625
3
[]
no_license
#include <algorithm> #include <iostream> #include <vector> using namespace std; class Solution { public: using PairType = pair<int, int>; static vector<pair<int, int>> reconstructQueue(vector<pair<int, int>> &people) { sort(std::begin(people), std::end(people), [](const PairType &pr1, co...
true
fa8f80bc2d684de2571b88cc08e003e84992560d
C++
LucasFROGER/MyWork
/Engine/Engine/Lights/Light.h
UTF-8
1,105
2.828125
3
[]
no_license
#ifndef _LIGHT_H_ #define _LIGHT_H_ #include "../Core/Maths/Vector/Vec4.h" #include "../Core/Maths/Matrix/Mat4.h" namespace engine { namespace light { class Light { public: Light(); Light(const Light& other); ~Light(); void SetColor(engine::core::maths::Vec4 color); void SetIntensity(float int...
true
e6bda96cfd5baaa30214e53d8480c1a201675cb8
C++
cesar-magana/Leet-Code
/0416. Partition Equal Subset Sum/canPartition01.cpp
UTF-8
1,140
3.03125
3
[]
no_license
bool canPartition(vector<int>& arr) { int sum = accumulate(arr.begin(), arr.end(), 0); int n = arr.size(); if ( sum%2 == 1 ) return false; bool part[sum / 2 + 1][n + 1]; // initialize top row as true for (int i = 0; i < n+1; i++) part[0][i]...
true
e1deb1d6a86d0352a0686886ebbc00738fab1290
C++
wegatron/embedded_thin_shell
/src/volume_simulator/ui_lib/Render/AxisTorus.h
UTF-8
1,334
2.78125
3
[ "Apache-2.0" ]
permissive
#ifndef _AXISTORUS_H_ #define _AXISTORUS_H_ #include <boost/shared_ptr.hpp> #include <SelfRenderEle.h> #include <Selectable.h> namespace QGLVEXT{ /** * @class AxisTorus * */ class AxisTorus:public SelfRenderEle, public Selectable{ public: AxisTorus(){ selected_axis = -1; translation[0] ...
true
20e872e2576463bf809996f430f9bc20b5c7539e
C++
krath912/tmproj
/object.cpp
UTF-8
4,432
2.6875
3
[]
no_license
#include <algorithm> #include <string> #include "object.h" #include "event.h" #include "background.h" #include "mainwindow.h" //loads an object void Object::loadGame() { QFile data("data.txt"); if(data.open(QIODevice::ReadWrite)){ QString s = data.readLine(); QString str = data.readL...
true
62a9c5637d943fe2a37b1467bdad4c0a8a40c05f
C++
mouqi123/c-_test
/fifth/fifth_1.cpp
UTF-8
1,415
3.65625
4
[]
no_license
/** * File Name: fifth.cpp * Author: mackie * Mail: mouqi562315905@qq.com * Created Time: 2017年04月23日 星期日 16时17分39秒 */ #include<iostream> using namespace std; class Frame { public : int weight; int ID; Frame(): weight(0), ID(0) { } friend istream& operator>>(istream& in, Frame* f) { ...
true
ceecc827b819c6feeef15707e53e01249fb2f891
C++
Wsewlad/CPP_Piscine
/d07/ex02/main.cpp
UTF-8
2,738
3.015625
3
[]
no_license
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* main.cpp :+: :+: :+: ...
true
02e5786efed72c91e278f31bb1d0c0206cb76f9f
C++
MarkOates/dungeon
/src/dungeon/models/naughty_list.cpp
UTF-8
4,933
2.84375
3
[]
no_license
#include <dungeon/models/naughty_list.hpp> //#include <framework/useful.hpp> NaughtyList::Kid::Kid(std::string name, int sprite_index, int scene_id, behavior_t behavior) : name(name) , scene_id(scene_id) , sprite_index(sprite_index) , behavior(behavior) , killed(false) {} behavior_t NaughtyList:...
true
60774fcdee4048901d407a9fecd022fbef67a5c4
C++
github/codeql
/cpp/ql/src/jsf/4.10 Classes/AV Rule 95.cpp
UTF-8
400
3
3
[ "MIT" ]
permissive
enum Shape_color { red, green, blue }; class Shape { public: virtual void draw (Shape_color color = green) const; ... } class Circle : public Shape { public: virtual void draw (Shape_color color = red) const; ... } void fun() { Shape* sp; sp = new Circle; sp->draw (); // Invokes Circl...
true
41c6f8aa9b0af5fb09a683bdb95eb88484717619
C++
viataazang/EchoLib
/eventfd/main.cpp
UTF-8
987
3.203125
3
[]
no_license
#include "EventfdThread.h" #include <iostream> #include <unistd.h> using namespace std; using namespace wd; /* ### eventfd函数 #include <sys/eventfd.h> int eventfd(unsigned int initval, int flags); * initval 初始的引用计数,为64位无符号整数 * flags 标志位,一般设置为0 eventfd的作用主要在于进程,线程间通信;通过向eventfd write信号,eventfd接收信号并作出相应的回应 ### even...
true
bbd0ab8ef57bb03752a727f4e38865813a63abb0
C++
vector-of-bool/let
/tests/parser.cpp
UTF-8
1,600
2.890625
3
[]
no_license
#include <let/parser.hpp> #include <let/parser/token.hpp> #include <catch/catch.hpp> TEST_CASE("Tokenize some strings", "[parser][tokenizer]") { auto str = "foo bar"; auto toks = let::ast::tokenize(str); CHECK(toks.size() == 2); str = "foo bar "; toks = let::ast::tokenize(str); REQUIRE(tok...
true
1e5250a03b950112365a6560f9689fc316982fbf
C++
zevenrodriguez/mtec
/codeExamples/arduino/2280Spring16/buttonpress/buttonpress.ino
UTF-8
372
2.796875
3
[]
no_license
#define toggleSwitch 2 int toggleState = 0; boolean pressing = false; void setup() { Serial.begin(9600); pinMode(toggleSwitch, INPUT); } void loop() { toggleState = digitalRead(toggleSwitch); if (toggleState == HIGH) { pressing = true; } if (toggleState == LOW && pressing == true) { pressing ...
true
151cfdfd421b8d8655b3ad8a46486f7357012319
C++
vale2005/inviwo
/modules/labtopo/integrator.cpp
UTF-8
2,586
2.640625
3
[ "BSD-3-Clause", "BSD-2-Clause" ]
permissive
/********************************************************************* * Author : Himangshu Saikia * Init : Wednesday, September 20, 2017 - 12:04:15 * * Project : KTH Inviwo Modules * * License : Follows the Inviwo BSD license model ********************************************************************* *...
true
729548d34955fa340ed960da76aaa4c230822ecb
C++
NicholasTanYuZhe/Tourist-Information-System
/Flight.cpp
UTF-8
2,415
3.421875
3
[]
no_license
/************************************* Program: Flight.cpp Course: OOPDS Year: 2015/16 Trimester 2 Name: NICHOLAS TAN YU ZHE ID: 1142701655 Lecture: TC102 Lab: TT04 Email: nicholas.290696@gmail.com Phone: 016-7768182 *************************************/ #include "Flight.h" Flight::Flight(int V) { ...
true
b7523caf73a7150769c4f60d534318633eee570d
C++
rexdex/recompiler
/dev/external/wxWidgets-3.1.0/include/wx/msw/caret.h
UTF-8
1,432
2.546875
3
[ "MIT" ]
permissive
/////////////////////////////////////////////////////////////////////////////// // Name: wx/msw/caret.h // Purpose: wxCaret class - the MSW implementation of wxCaret // Author: Vadim Zeitlin // Modified by: // Created: 23.05.99 // Copyright: (c) wxWidgets team // Licence: wxWindows licence ///...
true
5932b5df8612877002d2710f2cf1b248ba9466f8
C++
mukundkedia/DSA
/Binary_Search_Tree/LCAinBST.cpp
UTF-8
818
3.671875
4
[]
no_license
//https://practice.geeksforgeeks.org/problems/lowest-common-ancestor-in-a-bst/ #include <bits/stdc++.h> #include <iostream> using namespace std; struct Node { int data; struct Node *left, *right; }; Node * newNode(int k) { Node *temp = new Node; temp->data = k; temp->left = temp->right ...
true
9772f06dcaebf901fc1d6fe814a80b0af69eefa5
C++
MSurfer20/test2
/cpp-tizen/src/Attachments.h
UTF-8
3,332
2.9375
3
[]
no_license
/* * Attachments.h * * Dictionary containing details of a file uploaded by a user. */ #ifndef _Attachments_H_ #define _Attachments_H_ #include <string> #include "Attachments_messages.h" #include <list> #include "Object.h" /** \defgroup Models Data Structures for API * Classes containing all the Data Structur...
true
a394e90a6daf4b6fbae554daacbfb4cdaadd3e8a
C++
Bietola/old
/SWars/Cannon.cpp
UTF-8
1,539
2.78125
3
[]
no_license
#include "Cannon.h" ///cannon functions //constructors Cannon::Cannon():Thing(),Builder(){ start(NULL,SHOOT_DUMMY); } Cannon::Cannon(Texture *t,COLLFACTION cf,SHOOT st,int hp,int cdam,double cs,Ship *proj):Thing(0,0,t,COLL_SHIP,cf,hp,cdam),Builder(proj,cs){ start(proj,st); } Cannon::Cannon(int x,int ...
true
af068f2bf6620030e9b24660c10b88addaa6ff57
C++
Svaught598/cppNES
/include/log.h
UTF-8
2,505
3.53125
4
[]
no_license
#ifndef NES_LOG #define NES_LOG #include <fstream> #include <iomanip> #include <iostream> class Logger { public: // Log types enum class logType { LOG_ERROR, LOG_WARNING, LOG_OPCODE, LOG_INFO, LOG_ENDLINE }; // Constructor explicit Logger (const char *fname = "nes_log.txt") { ...
true
94c33eeed0934d5abfd0858cbcc10eda85d65cde
C++
monder0116/CSE241
/backuparr- merge sort/templateArray.cpp
UTF-8
2,216
3.328125
3
[]
no_license
#include "templateArray.h" #ifndef TDA #define TDA template <class T> TempArray<T>::TempArray(const TempArray<T>& other):size(0),capasity(other.capasity){ arr=new T[capasity]; for(int i=0;i<other.size;i++) { arr[i]=other.arr[i]; ++size; } } template <class T> TempArray<T>::TempArray(const vector<T>& other):...
true
dd67a1ca786b58f74cc468b587eb0e279bf6079f
C++
GuillaumeElias/Little2DGame
/src/Objects/ElevatorObject.cpp
UTF-8
1,021
2.9375
3
[]
no_license
#include "Objects/ElevatorObject.h" ElevatorObject::ElevatorObject(SDL_Renderer* renderer, SDL_Window* window, int pX, int pY, LTextureFactory* lTextFact, int alt) : GameObject(renderer, window, pX, pY, lTextFact), initPosY(pY) { if(alt < 0){ //if disabled disabled = true; alt = abs(alt); } ...
true
883536f4290c519ecedca2964a586b39d57ded33
C++
pigranya1218/WinAPI-worms
/effectObject.h
UTF-8
833
2.71875
3
[]
no_license
#pragma once #include "object.h" class effectObject : public object { protected: image* _img; animation* _ani; bool _effectedGravity; bool _effectedPixel; void move(); bool movePixel(); public: void init(image* img, int fps, float x, float y, float width, float height, float angle, float power, bool effecte...
true
11e43fc655d0561adc126819dcc9e153aafc3105
C++
SteveBeaupre/Vortez3DEngine
/3ds Plugins/Model3DExport/Huffman Coder.h
UTF-8
4,294
2.515625
3
[]
no_license
#ifndef C_HUFFMAN_CODER_DLL_H #define C_HUFFMAN_CODER_DLL_H #ifdef __cplusplus #include <Windows.h> #include <Stdio.h> #include "SafeKill.h" //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #define ROOT_NODE 0 #define NORMAL_NODE 1 #define L...
true
17b26889c89d5c031f84449418a1220a575a6b5b
C++
zzzlight/pat
/1087.cpp
GB18030
2,509
2.71875
3
[]
no_license
#include<iostream> #include<vector> #include<algorithm> #include<map> #include<string> using namespace std; const int inf=10000000; struct Node { int happiness; string name; int level; }node[400]; map<int,string> stringtoint; map<string,int> inttostring; int G[205][205]; int d[205]; bool vis[205]; int numofpath; i...
true
912cba8f5c0111523d220b02a994ebe6259b0cea
C++
lc5313/Global-Illumination-Ray-Tracer
/Application.cpp
UTF-8
761
2.578125
3
[]
no_license
// // Created by lauren on 2/3/20. // #include "Application.h" #include "ObjectData.h" #include "Camera.h" //GLOBALS //background color is "cornflower blue" Color bgColor(0, 0.0, 1.0); void Application::letsGo(){ cout <<"hi" <<endl; //create a world and add objects to it World world = World(bgColor); ...
true
d5de3caf3663079368d3219241322b10a83b8364
C++
TurtleShip/ProgrammingContests
/Solutions/LiveArchive/2007/South_America/3651/3651_WeekendLottery.cpp
UTF-8
963
2.5625
3
[]
no_license
#include <cstdio> #include <algorithm> using namespace std; const int maxN = 10010; const int maxC = 15; const int maxK = 110; int arr[maxK]; int main() { int N, C, K; while(scanf(" %d %d %d", &N, &C, &K) && !(N == 0 && C == 0 && K ==0)) { int minVal = 10000; for(int i=1; i <= K; i+...
true
95853049b4462ca10d1cfc5fb17609461f77a46c
C++
rthanjappan/CPlusPlusCheckersGame
/CheckersAug192021.cpp
UTF-8
18,500
2.84375
3
[]
no_license
// Program : Checkers Game //programmer : Rosemol Thanjappan //Date : 11/24/2018 #include <iostream> #include <string> #include <cstring> #include <ctime> #include <Windows.h> #include "MMSystem.h" #include <vector> #include<fstream> #include <iomanip> using namespace std; class game { public: void mainLine(); priv...
true
e566a114835947cbb0294b61bfba585941095ae7
C++
RishatIbrahimov/cpp-tasks
/06_pow.cpp
UTF-8
273
3.390625
3
[]
no_license
#include <iostream> using namespace std; // a^x int pow(int a, int x) { if (x == 0) { return 1; } int res = pow(a, x / 2); res *= res; if (x % 2 == 1) { res *= a; } return res; } int main() { int a, x; cin >> a >> x; cout << pow(a, x) << endl; return 0; }
true
f40e7961c7ccbca8353a3932b0cd9931b56c0cd7
C++
gracefullee/Practice_Programs
/largest_prime_factor.cpp
UTF-8
643
3.75
4
[]
no_license
#include <iostream> #include <cmath> using namespace std; bool isPrime(long int num); int main() { long int n; cout << "Please Enter an Integer : "; cin >> n; if(isPrime(n)==true) cout << "Largest Prime Number is ... " << n << endl; else{ while(n!=1){ for(long int i=0; i<=n; i++){ if(isPrime(i)==tr...
true
f05d683c8302f16656a481a3db3aa45493dfc84f
C++
carlesaraguz/aeodss
/src/model/activity/ActivityHandler.hpp
UTF-8
12,107
2.609375
3
[]
no_license
/***********************************************************************************************//** * Container and manager of activities known or generated by a single Agent. * @class ActivityHandler * @authors Carles Araguz (CA), carles.araguz@upc.edu * @date 2018-sep-26 * @version 0.1 * ...
true
2d6b9035e4047118fe564b18dbee01d0e7bf2d5c
C++
nitin-rajesh/cpp_projects
/MasterMind_proj/MasterMind_ultra.cpp
UTF-8
8,866
2.765625
3
[]
no_license
#include<iostream> #include<string.h> #include<time.h> #include<stdlib.h> #include<stdio.h> #define clear system("clear") //if cout<<"\033[2J\033[;H" doesn't work, use system("cls") #define line cout<<endl using namespace std; const int numberOfRows=12; struct Grid{ char pos[numberOfRows][4]; ...
true
883fbac0ab61cfcab47e1f588dd1bddd49e10c40
C++
corywelch/DigitalSystemsSYDE192-FunctionGenerator
/lab07/lab742/lab742.ino
UTF-8
1,537
2.953125
3
[]
no_license
int poll = 4; int i = 0; int j = 0; volatile int state = 1; void setup(){ pinMode(poll, INPUT); attachInterrupt(0, handler, CHANGE); Serial.begin(9600); } void loop(){ j = 0; //Polling pin 4 // Detect high if (digitalRead(poll) == HIGH){ // notify user Serial.println...
true
e8c244008a2c194b5d96ae08be05cb3f6f45f40c
C++
smueksch/shared-memory-server
/src/client/client.cpp
UTF-8
1,521
3.34375
3
[ "Unlicense" ]
permissive
#include <cstdlib> // EXIT_SUCCESS #include <csignal> // SIGINT, signal #include <iostream> // cin, cout, endl #include <string> // string #include <fcntl.h> // O_WRONLY #include <sys/mman.h> // mmap, shm_open, PROT_WRITE #include <unistd.h> // ftruncate // Name of shared memory object. #define SHM_NA...
true
b4752f4feb82b0090b777ac6a72012bb940d829b
C++
boatshaman/HomemadeHardware
/firstInteraction_ATtiny85/sketch/tiny85_code.ino
UTF-8
242
2.578125
3
[]
no_license
void setup() { // put your setup code here, to run once: pinMode(4, INPUT); pinMode(2, OUTPUT); } void loop() { if(digitalRead(4) == HIGH){ digitalWrite(2, HIGH); }else{ digitalWrite(2, LOW); } delay(10); }
true