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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
f11d3b8843c29ffe6e0b186c89dda5cd8636eb0f | C++ | NITISH26ISM/C_DS_ALGO | /priority Queue/minBinaryHeap.cpp | UTF-8 | 4,820 | 3.40625 | 3 | [] | no_license | # include <iostream>
# include <vector>
# include <unordered_map>
# include <cstring>
# include <list>
# include <climits>
using namespace std;
struct node{
int vertice;
int priority;
node() { }
node(int v, int p){
vertice = v;
priority = p;
}
};
struct edge{
int v;
... | true |
d490a7ce18a4e7c53256c7241a37d2ae6c54ae2c | C++ | LiYouCheng2014/leetCode | /leetCode-c/leetCode-c/LeetCode/leetCode-0050/leetCode-0050.cpp | UTF-8 | 1,340 | 2.96875 | 3 | [] | no_license | //
// leetCode-0050.cpp
// leetCode-c
//
// Created by liyoucheng on 2019/1/27.
// Copyright © 2019年 Giga. All rights reserved.
//
#include "leetCode-0050.hpp"
//class Solution {
//public:
// double myPow(double x, int n) {
//
// if (n < 0) {
//
// return 1 / power(x, -n);
// }
// ... | true |
c6f9d1ef61d93bad091d96bc9046172115ead76e | C++ | IgorRas/studia_przed_spec | /Add.cpp | UTF-8 | 1,767 | 3.875 | 4 | [] | no_license | /*
Zaimplementuj:
•Operator+, po którego obu stronach stoją niemodyfikujące referencje wektorów liczb rzeczywistych,
zaś wynikiem jest nowy wektor zawierający wszystkie elementy wektora po lewej,
a po nich wszystkie elementy wektora po prawej.
•Operator+=, po którego lewej i prawej stronie stoi odpowiednio ... | true |
c3d4c8f882b16533be85e7dc46bf4299def100e1 | C++ | eckertalex/musicplayer372 | /src/textureManager.cpp | UTF-8 | 625 | 2.515625 | 3 | [
"Unlicense"
] | permissive | // textureManager.cpp
// 26. April 2017
// Created by:
// Bryan Burkhardt (bmburkhardt@alaska.edu)
// Alexander Eckert (aeckert@alaska.edu)
// Jeremiah Jacobson (jjjacobson2@alaska.edu)
// Jarye Murphy (jmurphy11@alaska.edu)
// Cameron Showalter (@alaska.edu)
//
// Source file for textureManager
#incl... | true |
ea8f3956d362af86d086ae049ea904244ed72642 | C++ | Bablu-Mehta/GymTraine-cpp | /GymTraine.cpp | UTF-8 | 11,793 | 2.640625 | 3 | [] | no_license | #include<conio.h>
#include<iostream>
#include<string.h> //string header file
using namespace std;
class man
{
public:
void monday()
{
cout<<"\t\tChest day"<<endl;
cout<<"\t\tFirst of all Stretch your body"<<endl;
cout<<"\t\t1. Barbell Bench Press"<<endl;
cout<<"\t\t\t * 3-4 sets of 6-8 reps or 10-12 reps"<<endl;
... | true |
ed1cf63ce9fabf9a7e8acca74004c464d2bb7c30 | C++ | hyunstory/CodingTestPractice | /Baekjoon/CPP/17090.cpp | UTF-8 | 1,540 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <deque>
using namespace std;
#define input_max 500 + 1
int n, m;
char map_c[input_max][input_max];
int map_status[input_max][input_max]; // 0은 모름 unkown, 1은 가능, 2는 불가능, 3은 갔던 길
int dx[] = { -1, 0, 1, 0 }; // 상우하좌
int dy[] = { 0, 1, 0, -1 };
int result;
void solution() {
cin >> n >> ... | true |
8396d65c8b05257acc70b5a730b56950aa2d93a1 | C++ | skyformat99/lftpd | /src/config.cc | UTF-8 | 2,607 | 3.171875 | 3 | [] | no_license | #include "config.h"
#include <boost/regex.hpp>
#include <iostream>
#include <fstream>
Config * Config::instance = NULL;
Config::Config(){
}
Config * Config::get_instance(){
if(!instance){
instance = new Config();
}
return instance;
}
CFG_CODES Config::parse_config(std::string file_name){
... | true |
ff03bd58cbb9d710283396c42255f73df0187db2 | C++ | tangzhenyu/Distributed_Machine_Learning | /mpi_based/src/io/io.h | UTF-8 | 900 | 2.59375 | 3 | [] | no_license | #pragma once
#include <fstream>
#include <iostream>
namespace dml{
struct kv{
int fgid;
long int fid;
float val;
};
class IO{
public:
IO(const char *file_path) : file_path(file_path){
Init();
};
~IO(){};
void Init(){
fin_.open(file_path, std::i... | true |
8c41696ce68ed5a7f2efe2dc64ce233eb6b10dc9 | C++ | lucaschf/OnlineJudge | /Beginner/Problem1478.cpp | UTF-8 | 933 | 3.1875 | 3 | [] | no_license | //
// Created by lucas on 01/18/2021.
//
#include <iostream>
using namespace std;
int main() {
int size;
while ((cin >> size) && (size != 0)) {
int arr[size][size];
for (int line = 0; line < size; line++) {
arr[line][0] = line + 1;
for (int column = line; column >= ... | true |
267948eccf8735a571b3e7abe28a05c1f60a9706 | C++ | Jim-CodeHub/libmime | /libmime/rfc822/field_name.cpp | UTF-8 | 2,952 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | /**-----------------------------------------------------------------------------------------------------------------
* @file field_name.cpp
* @brief Standrad for ARPA Ineternet text messages
* @ref IETF-rfc822
*
* Copyright (c) 2019-2019 Jim Zhang 303683086@qq.com
*----------------------------------------------... | true |
b57ad07a8bbf6667d778732a7e4e801b8489bcc8 | C++ | frc4646/frc4646-2015-competition-code | /src/Commands/TotesMaGoats.cpp | UTF-8 | 2,345 | 2.765625 | 3 | [] | no_license | #include "TotesMaGoats.h"
#include "GrabberCloseCommand.h"
#include "LiftToLevelCommand.h"
#include "DriveForDistance.h"
#include "../RobotMap.h"
#include "SlideForDistance.h"
#include "DriveUntilClose.h"
#include "DriveUntilCloseWithIntake.h"
#include "GrabberOpenCommand.h"
#include "LiftToBottomCommand.h"
TotesMaGoa... | true |
e78e685ffbb3f99fe6981faecb535059a236e74e | C++ | querrec/Mascaret | /Dev/C++/Mascaret/include/VEHA/Entity/AnimationSpecification.h | UTF-8 | 3,237 | 2.796875 | 3 | [] | no_license | #ifndef _v2_VEHA_Entity_Animation_H
#define _v2_VEHA_Entity_Animation_H
#include <boost/signal.hpp>
#include <boost/bind.hpp>
#include "Tools/veha_plateform.h"
#include "VEHA/Entity/VirtualRealitySpecification.h"
namespace VEHA
{
class ShapeSpecification;
class VEHA_API AnimationSpecification : public VirtualReality... | true |
b7518ec06910fb9093bffd61b9d8054f8c44aaac | C++ | dcesini/Darwin | /Chromo.cpp | UTF-8 | 3,403 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | #include "include/Constants.h"
#include "include/Constants_wrapper.h"
#include "include/Chromo.h"
#include <iostream>
#include <string>
#include <sstream>
std::string chromo::REPRODUCTION_METHOD = "";
chromo::chromo(){
for(int i = 0; i < DIM ; ++i) ch_[i] = 0;
REPRODUCTION_METHOD = "SEGMENTS_EXCHANGE";
};
ch... | true |
50512e1eb82fc087535d566887c89b33675dc356 | C++ | tjfr8s/GameOfLife | /cell.cpp | UTF-8 | 653 | 3.59375 | 4 | [] | no_license | #include "cell.h"
// populated cell status denoted by 'o' character. unpopulated cell status
// denoted by 'x' character.
Cell::Cell(char status = 'o'): m_status(status)
{
}
void Cell::toggleStatus()
{
if(m_status == 'o')
{
m_status = 'x';
}
else if(m_status == 'x')
{
m_status = ... | true |
3635f122d3ff09fcfd0f162b374d3c83315c30b0 | C++ | qulacs/qulacs | /src/csim/update_ops.hpp | UTF-8 | 60,932 | 2.703125 | 3 | [
"MIT"
] | permissive | /*
rules for arguments of update functions:
The order of arguments must be
information_about_applying_qubits -> Pauli_operator ->
information_about_applying_gate_matrix_elements -> a_kind_of_rotation_angle ->
state_vector -> dimension If there is control-qubit and target-qubit,
control-qubit is the first a... | true |
07c4102b3494b1eff3f4570911650d47281ba0ee | C++ | bmihaljevic/bnclassify | /inst/include/infer.h | UTF-8 | 5,457 | 2.921875 | 3 | [] | no_license | #ifndef bnclassify_infer_H
#define bnclassify_infer_H
#include <Rcpp.h>
#include <cmath>
#include <basic-misc.h>
#include <multidim-array.h>
/**
* All CPT internal logics and rules here.
* Users of this class should not need to think of dimnames and similar, just of variables, features, etc.
* It hold the log... | true |
99064870e7d2c97f982cd1489ec7403e5a56b4e7 | C++ | Eric-Ma-C/PAT-Advanced | /Advanced/AA1104/AA1104/main.cpp | GB18030 | 321 | 2.734375 | 3 | [
"MIT"
] | permissive | #include<stdio.h>
double a[100005];
double time[100005]={0};//int
int main(){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%lf",a+i);
time[i]=(n-i)*1.0*(i+1);
}
double sum=0.0;
for(int i=0;i<n;i++){
sum+=a[i]*time[i];
}
printf("%.2f",sum);
getchar();
getchar();
return 0;
} | true |
40fdd74c3ace354cc6dd55aabb939984fc8d2bce | C++ | WhiZTiM/coliru | /Archive2/3f/4eb8f5da9ca075/main.cpp | UTF-8 | 2,095 | 3.390625 | 3 | [] | no_license | #include <vector>
#include <map>
#include <algorithm>
#include <iostream>
template<typename T>
static
std::pair< std::vector<T>, std::vector<T> >
compare(std::vector<T>& old_user_devices,
std::vector<T>& new_user_devices)
{
std::sort(std::begin(old_user_devices), std::end(old_user_devices));
std::sort(std:... | true |
057dc0c2d57805cfd36e6c7e0a12c0dbc43b5191 | C++ | ul5/VoxelGame | /src/world/Chunk.h | UTF-8 | 979 | 2.828125 | 3 | [] | no_license | #pragma once
#include "Block.h"
#include "../graphics/BlockMesh.h"
namespace world {
class Chunk {
private:
world::Block **blocks = new world::Block*[16 * 16 * 256];
graphics::BlockMesh *blockMesh = nullptr;
void createMesh();
int chunk_x, chunk_z;
public:
Chunk... | true |
80ad358ca1210a1a54c4f7b3b194367b53acd77f | C++ | Huppdo/ECCS1611 | /Labs/LabThree/src/Hupp_Lab3_Part2.cpp | UTF-8 | 1,081 | 3.65625 | 4 | [] | no_license | //Dominic Hupp - ECCS1611 - Lab 3 Part 2 - 8/26/20
/*
Determine the cost of owning a car with the provided inputs
*/
#include <iostream>
using namespace std;
int main() {
//Establish user input variables
int costOfCar = 0;
double milesPerGallon = 0;
int milesPerYear = 0;
double gasPrice = 0;
double yearsOfUse... | true |
da96ef06eef139f28cb2e9a400cea7b99cf444ec | C++ | ratulSharker/Java_like_thread_in_c_plus_plus | /Example_6_get_status.cpp | UTF-8 | 2,120 | 3.3125 | 3 | [] | no_license | #include <iostream>
using namespace std;
#include "Thread.h"
class GetStatusDemo implements Thread
{
public:
void run()
{
for(int i = 0 ; i < 10 ; i++)
{
//this enable wait checking will make the thread to be in te wait checking state
ENABLE_WAIT_CHECKING;
... | true |
b6ca7ba0e8b127a7434dfca1e702c325da5ccc2d | C++ | idaholab/raven | /src/utilities/microSphere.cxx | UTF-8 | 3,322 | 2.640625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | /* Copyright 2017 Battelle Energy Alliance, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agree... | true |
53e0b1df126ed95da03cbd5bf1c49550cc502caa | C++ | CoderHermano/Data-Structures-CPP | /Leetcode/Array/Remove Duplicates/Duplicates.cpp | UTF-8 | 872 | 3.90625 | 4 | [
"MIT"
] | permissive | // Remove Duplicates from Sorted Array
// Given a sorted array nums, remove the duplicates in-place such that each element appears only once and returns the new length.
// Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
#include<bits/stdc++.... | true |
28e02600ef9d0d9d5d120510508b4f99bdf1003b | C++ | strengthen/LeetCode | /C++/621.cpp | UTF-8 | 2,163 | 2.609375 | 3 | [
"MIT"
] | permissive | __________________________________________________________________________________________________
sample 12 ms submission
int any = []() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
return 0;
}();
class Solution {
public:
int leastInterval(vector<char> &tasks, int n) {
if (tasks.empty())
return 0;
int ... | true |
0a5d55524c818867e2f45087c192947c6e96417f | C++ | jeffreyooi/SP4 | /DM2240_Lab/IntroState.cpp | UTF-8 | 7,250 | 2.765625 | 3 | [] | no_license | #include <iostream>
using namespace std;
#include "GameStateManager.h"
#include "gamestate.h"
#include "menustate.h"
#include "introstate.h"
#include "playstate.h"
CIntroState CIntroState::theIntroState;
void CIntroState::Init()
{
w = glutGet(GLUT_SCREEN_WIDTH);
h = glutGet(GLUT_SCREEN_HEIGHT);
if (!LoadTGA(&intr... | true |
eeb22106270f41a3f451f664f16e9afd3b9e8c0f | C++ | fltester/boost_tutorial | /src/test_class_inherit.cpp | UTF-8 | 1,052 | 2.875 | 3 | [] | no_license | #include<string>
#include<iostream>
#include<boost/python.hpp>
using namespace std;
using namespace boost::python;
struct Base{
virtual ~Base() {};
virtual string getName() {return "Base";}
string str;
};
struct Derived : Base{
string getName() {return "Derived";}
};
void b(Base *base) {cout << bas... | true |
e34f0639bda991b4ab503eac48af1ffad9b7340d | C++ | lee658/lee | /clang/004/day004_001/day4_004.cpp | UTF-8 | 157 | 2.515625 | 3 | [] | no_license | #include <stdio.h>
int main() {
int x = 10;
int y = 010;
int z = 0x10;
printf(" x %d\n", x);
printf("y %d\n", y);
printf("z %d\n", z);
return 0;
} | true |
f83318a3cae02339c49cf0bb88c7390aa2523830 | C++ | JHW0900/Problem_Sloving | /BOJ/1018.cpp | UTF-8 | 1,196 | 2.609375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int WB_change(int x, int y);
int BW_change(int x, int y);
const string WB[8] = {
"WBWBWBWB",
"BWBWBWBW",
"WBWBWBWB",
"BWBWBWBW",
"WBWBWBWB",
"BWBWBWBW",
"WBWBWBWB",
"BWBWBWBW"
};
const string BW[8] = {
"BWBWBWBW",
"WBWBWBWB",
"BWB... | true |
6812f5de9db0eacaac3910d51f22afea1c2ed796 | C++ | GammaG/C-- | /testRN.cpp | UTF-8 | 1,955 | 2.9375 | 3 | [] | no_license | /*
Simple Unit Test for type RationalNumber
*/
#include <stdio.h>
#include <assert.h>
#include "rationalnumber.h"
#include "rationalnumbercollection.h"
using namespace std;
int main()
{
printf("Performing unit tests for RationalNumber...\n");
/* Part 1 - RationalNumber data type */
RationalNumber ... | true |
d270274f3d280e0c5af141dd5869cfbe16318797 | C++ | JCCervera/Infinitree-LD34 | /LD34/LD34Project/Surface.cpp | UTF-8 | 1,810 | 3.375 | 3 | [] | no_license | #include "Surface.h"
//Construct absolutely nothing
Surface::Surface() {
}
//Load them surfaces
SDL_Surface* Surface::OnLoad(char* File) {
//Intialize a temporary surface and the surface to be returned
SDL_Surface* Surf_Temp = NULL;
SDL_Surface* Surf_Return = NULL;
//Load the file into the temp
i... | true |
570783e95687208bb0a1b56b9e07f9e79e7dc7e8 | C++ | DarinaKD/Task_C | /Dictionary.cpp | WINDOWS-1251 | 9,387 | 3.140625 | 3 | [] | no_license | // Dictionary.cpp : Defines the entry point for the console application.
//
#include <iostream>
//#include <stdio.h>
//#include <conio.h>
#include <windows.h>
#include <string>
//#include <stdlib.h>
//#include <dos.h>
using namespace std;
// CLASS TREE____________________________________________
class Tree{
char... | true |
9aceb6a6ac5e46b51fbb92d3eb7762210ca25498 | C++ | sebastiandev/muxer | /musicindexer/logging/FileLogger.cpp | UTF-8 | 852 | 2.703125 | 3 | [] | no_license | #include "FileLogger.h"
#include <iostream>
#include <fstream>
#include <QDateTime>
void FileLogger::LogInfo(QString message)
{
writeToFile(QString("Info"), message);
}
void FileLogger::LogError(QString message)
{
writeToFile(QString("Error"), message);
}
void FileLogger::LogDebug(QString message)
{
writeT... | true |
0bbe65041beb7622cbf70a5fbd3c44b377989a25 | C++ | SreeHaran/CPP-Assignments | /Assignment-5(4).cpp | UTF-8 | 4,461 | 3.953125 | 4 | [] | no_license | /*We want to store the information of different vehicles. Create a class named Vehicle with two data member named mileage and price. Create its two subclasses
*Car with data members to store ownership cost, warranty (by years), seating capacity and fuel type (diesel or petrol).
*Bike with data members to store the nu... | true |
91ba06099d3066075f155c76134412b3e2fdd48e | C++ | vadfabi/pylauncher_server | /LinuxServer/tcPIp_Sockets/Thread.cpp | UTF-8 | 2,628 | 3.140625 | 3 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | #include "Thread.h"
using namespace std;
/////////////////////////////////////////////////////////////////////////////
// Sleep
// sleep in milliseconds
//
void Sleep(long millis)
{
std::this_thread::sleep_for(std::chrono::milliseconds(millis));
}
///////////////////////////////////////////////////////////////... | true |
0786f3e7a45eff7308c877717b22f00c50a1b9e3 | C++ | surbhim18/bsc-lab | /Semester 3/Algorithms/rod_cut.cpp | UTF-8 | 3,133 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
using namespace std;
int maxLen;
void rod_cut_opt(int *p, int *r, int *s)
{
r[0] = 0;
s[0] = 0;
int i,j;
for(i=1; i<maxLen; i++)
{
int maximum = -1;
for(j=1; j<=i; j++)
{
int val = p[j] + r[i-j];
... | true |
b934a8ff1a4906ba3a9d60a94d4b022664f1c4a0 | C++ | GavinBupt/LeetCode | /2019_04_06_寻找两个有序数组的中位数/Project1/源.cpp | GB18030 | 2,173 | 3.34375 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
int MAX = 100000;
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {
int m = nums1.size();
int n = nums2.size();
if (nums1.empty()) //һΪ
{
if (n % 2 != 0)
return 1.0*nums2[n / 2];
... | true |
349ab82b4dd13dc380019aed448cad9bce7ca26b | C++ | Sumelt/Daily-Coding | /Primer c++/13 Folder and Message.h | UTF-8 | 1,018 | 2.921875 | 3 | [] | no_license | #include <string>
#include <set>
class Message;
class Folder{
friend void swap(Folder &, Folder &);
friend class Message;
public:
Folder() = default;
Folder(const Folder &);
Folder& operator=(const Folder &);
~Folder();
void reMsg( Message* msg ){ msgs.erase( msg ); }
void addMeg( Message* msg ){... | true |
ba8fda6476ad0e2a4618a5970cf7d633924fb31e | C++ | Jehm09/Competitive-Programming | /CodeForces/(1-25)-08-19/SagheerandNubianMarket.cpp | UTF-8 | 1,513 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include <string.h>
#include <algorithm>
#include <bits/stdc++.h>
#define ll long long int
#define lenA(ar) sizeof(ar)/sizeof(*ar)
#define LENROWs(mat) sizeof(mat)/sizeof(*mat)
#define LENCOLs(mat) sizeof(*mat)/sizeof(**mat)
#define rep(i,x,y) for(ll i=x;i<y;i++)
#define repI(i,x,y) for(ll i=x-1;i>... | true |
c1de7491426efc5320d053c6e5d3493cebaccf36 | C++ | ninhngocnhi/C-Demo | /h2n-bai11.cpp | UTF-8 | 586 | 2.59375 | 3 | [] | no_license | #include <stdio.h>
#include <algorithm>
using namespace std;
int main() {
int n,m;
scanf ("%d%d",&n,&m);
int a[n],b[m];
for (int i=0;i<n;i++){
scanf ("%d",&a[i]);
}
for (int j=0;j<m;j++){
scanf ("%d",&b[j]);
}
sort(a,a+n);
sort(b,b+m);
for (int i=0;i<n;i++){
if (a[i]<b[0]){
printf ("%d ",a[i]);
}
... | true |
dac1483f40c8f495b3ae52135c1f8271f9c9a3c5 | C++ | CSCUC/CS1 | /9-17-19/1D.cpp | UTF-8 | 681 | 3.5 | 4 | [] | no_license | #include<iostream>
using namespace std;
int main() {
int num1, num2, num3, num4, num5, large, small;
cout << "Enter five integers: ";
cin >> num1 >> num2 >> num3 >> num4 >> num5;
large = num1;
small = num1;
if (num2 > large)
large = num2;
if (num3 > large)
large = num3;
if (num4... | true |
6657d0a98fec4464e2a5f5cce56a52d401371e62 | C++ | shlomor25/AP1_ex2_planes | /MyEmployee.h | UTF-8 | 714 | 2.625 | 3 | [] | no_license | //
// Created by shlomo Rabinovich 308432517 on 26/11/18.
//
#ifndef AP2_MYEMPLOYEE_H
#define AP2_MYEMPLOYEE_H
#include "interface.h"
#include "Collection.h"
class MyEmployee : public Employee
{
private:
int seniority;
int birthYear;
Jobs title;
string ID;
Employee* employer;
public:
MyEmplo... | true |
c6941a378ef17cd56bc36c538feb3267be8fa12e | C++ | rjxircgz/programming | /IT 211 - Data Structures/ProgrammingExercise3/MatrixOperations.cpp | UTF-8 | 2,233 | 2.796875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <conio.h>
#define p printf
void random(int arr[10][10], int row, int col)
{
srand(time(NULL));
int i,j;
for(i=0;i<row;i++)
{
for(j=0;j<col;j++)
{
arr[i][j]=(rand()%20)+1;
if(arr[i][j]<10)
p("0%d ",arr[i][j]);
else
... | true |
db1a10b8a58405d167586375a717ec6f53ba6ea0 | C++ | HaydenMarshalla/CPhysics | /Rebuild of cphysics/Rebuild of cphysics/src/JointToBody.cpp | UTF-8 | 2,376 | 2.828125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #include "CPhysics/JointToBody.h"
#include "CPhysics/Matrix2D.h"
JointToBody::JointToBody(Body* b1, Body* b2, real jointLength, real jointConstant, real dampening, bool canGoSlack,
const Vectors2D& offset1, const Vectors2D& offset2) :
Joint(b1, jointLength, jointConstant, dampening, canGoSlac... | true |
38a1bf1538135040c644c627430261c02a468c39 | C++ | rleboo/RSA-Encryption-Decryption | /encrypt.cpp | UTF-8 | 834 | 3.1875 | 3 | [] | no_license | // Program that encrypts user input using modPower
//
#include <iostream>
#include <fstream>
#include <math.h>
#include <fstream>
#include "numberTheory.hpp"
#include "ReallyLongInt.hpp"
//Uses modPower from numberTheory
using namespace std;
int main(int argc, char* argv[])
{
/* Input files and their order
... | true |
8f1d141da802a4316a9f8b216a9ffaa65e409cc6 | C++ | jsimpson9/win32proto | /Win32Proto1/Win32Proto1/Card.h | UTF-8 | 1,011 | 2.96875 | 3 | [] | no_license | #pragma once
#ifndef CARD_H
#define CARD_H
#include <windows.h>
class Card
{
private:
int _face;
int _suit;
bool _isFacedown;
static constexpr int CARD_WIDTH = 50;
static constexpr int CARD_HEIGHT = 100;
public:
Card(int face, int suit);
Card(int face, int suit, bool isFacedown);
void Paint(HDC hdc, ... | true |
a65fd4d0d3cd76e9173e17c5f457247a7d75c274 | C++ | nakajimakotaro/vulkanTest | /VulkanApplication.cpp | UTF-8 | 1,239 | 2.5625 | 3 | [] | no_license | //
// Created by nakajimakotaro on 17/11/06.
//
#include "VulkanApplication.h"
VulkanApplication::VulkanApplication() {}
VulkanApplication::~VulkanApplication() {}
std::unique_ptr<VulkanApplication> VulkanApplication::instance;
extern std::vector<const char*> layerName;
extern std::vector<const char*> instanceExtensi... | true |
e5e21b1035082a88c1bb1f73ebf00088716e91cf | C++ | ZackaryIngram/A1_IngramZackary | /GAME1017_ShooterExample/States.h | UTF-8 | 1,763 | 2.65625 | 3 | [] | no_license | #pragma once
#ifndef _STATES_
#define _STATES_
#include <SDL.h>
#include <vector>
#include "GameObject.h"
#include <iostream>
#include "SDL.h"
#include "SDL_image.h"
#include "SDL_mixer.h"
class State
{
public:
virtual void Enter() = 0;
virtual void Update() = 0;
virtual void Render();
virtual void Exit() = 0;
... | true |
fd4807f8fa2d2ef6b5425e2c223dff8eeac1fa5a | C++ | morgetai/Pacman | /Pacman/CheckBox.cpp | UTF-8 | 2,333 | 3.171875 | 3 | [] | no_license | /**
*************************************************************************************************************************
* @file Checkbox.cpp
* @author Hridin Andrii
* abgridin@gmail.com
* @date 13-March-2019
* @brief Implementation of the checkbox
**********************************... | true |
2b7984c970c96afcd1e0340a26ee0e290facadfc | C++ | phoenixperry/wellcome_forest | /libraries/AceRoutine/examples/HelloCoroutine/HelloCoroutine.ino | UTF-8 | 1,453 | 3.140625 | 3 | [
"MIT"
] | permissive | /*
* HelloCoroutine. Use 2 coroutines to print "Hello, World", the hard way.
* A 3rd coroutine spins away on the side, blinking the LED.
*/
#include <Arduino.h>
#include <AceRoutine.h>
using namespace ace_routine;
#ifdef LED_BUILTIN
const int LED = LED_BUILTIN;
#else
// Some ESP32 boards do not define LED_BUIL... | true |
abcc49e008528d2107f56e0e1e932c1366742314 | C++ | zerodarkzone/CppLoxLLVM | /src/Lox.hpp | UTF-8 | 1,025 | 2.71875 | 3 | [
"MIT"
] | permissive | //
// Created by juanb on 30/09/2018.
//
#ifndef CPPLOX_LOX_HPP
#define CPPLOX_LOX_HPP
#include <iostream>
#include <fstream>
#include <sstream>
#include "vm.hpp"
class Lox
{
public:
static void repl()
{
std::string line;
while (true)
{
std::cout << "> ";
std::getline(std::cin, l... | true |
20c8aaa5051818d890c6a3aafa7f1632c3d45a54 | C++ | jefferis/sequence-graphs | /libFMD/Test/ZipMappingSchemeTests.cpp | UTF-8 | 8,864 | 2.546875 | 3 | [
"MIT"
] | permissive | // Test the Zip MappingScheme
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
#include <iostream>
#include <ReadTable.h>
#include <SuffixArray.h>
#include "../FMDIndex.hpp"
#include "../FMDIndexBuilder.hpp"
#include "../util.hpp"
#include "ZipMappingSchemeTests.hpp"
// Register the fixture t... | true |
cf577b0e1948e5bb0c880e7532921a4dadaf55a1 | C++ | bheckel/code | /misc/c/mutex.cpp | UTF-8 | 2,861 | 3.296875 | 3 | [
"Apache-2.0"
] | permissive | //////////////////////////////////////////////////////////////////////////////
// Name: mutex.cpp
//
// Summary: Demo a POSIX mutex (mutual exclusion) that implements a simple,
// single, global lock. The goal is to avoid race conditions.
//
// A program has a data race if it is possible for ... | true |
ec088f4c3b1874b34b22f2de1b5302ad7e846327 | C++ | ymladeno/resmgr | /resmgr.sample/src/main.cpp | UTF-8 | 2,229 | 2.578125 | 3 | [] | no_license | #include "factory/CResourceMngFactory.hpp"
#include "CResourceManager.hpp"
#include "parser/CommandLine.hpp"
#include "Callback.hpp"
#include <exception>
#include <iostream>
#include <sstream>
#include <functional>
#define READ_WRITE_ACCESS 0x0666
int main(int argc, const char* argv[]) {
try {
res::parse... | true |
3bc216de1fd18e911b58a3610ae36c7dc9a419d2 | C++ | kmoza/cpp_workspace | /map_multimap/src/main.cpp | UTF-8 | 641 | 3.375 | 3 | [] | no_license | /*
* main.cpp
*
* Created on: 26-Dec-2013
* Author: kmoza
*/
#include<cstring>
#include<iostream>
#include<map>
#include<utility>
using namespace std;
int main()
{
map<int,string> Employees;
// 1) Assignment using array index notation
Employees[5234] = "Mike C.";
Employees[3374] = "Charlie M.";
Emplo... | true |
92509905e3ffd396d701cf82dcab5b4881d1ebeb | C++ | annasjiang/mini-maya | /assignment_package/src/mesh.h | UTF-8 | 752 | 2.578125 | 3 | [] | no_license | #ifndef MESH_H
#define MESH_H
#pragma once
#include "smartpointerhelp.h"
#include "face.h"
#include "vertex.h"
#include "halfedge.h"
#include "drawable.h"
#include "skeleton.h"
using namespace glm;
using namespace std;
class Mesh : public Drawable {
public:
// member vars
vector<uPtr<Vertex>> vertexList;
... | true |
35a76a66aea2b7015af40ed6f5d8504600c1f831 | C++ | anderfernandes/COSC_1337 | /lesson_5/question_4.cpp | UTF-8 | 1,445 | 3.53125 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <fstream>
#include <vector>
using namespace std;
int main()
{
vector <string>sentences;
string sentence;
// Loading input file into program
ifstream inputFile;
bool needFirstUpper = true;
// Opening file
inputFile.open("input.txt", ios::in);
string word;
// Loa... | true |
23722d01ec3b451d9957658f9e656e3923c60bd9 | C++ | mesyarik/cpp2021-test | /ref_underhood.cpp | UTF-8 | 765 | 3.28125 | 3 | [] | no_license | #include <iostream>
void f(int& r);
int main() {
int x = 0;
int* p = &x;
int& r = x;
int y = 1;
double d = 3.14;
std::cout << &x << ' ' << &p << ' ' << &y << ' ' << &d << '\n';
// memory layout:
// [x(4)][y(4)][ p(8) ][ d(8) ]
// Where is r? Nowhere!
f(x);
}
void f(i... | true |
178bcb879ce67b16c8f6a0d481524f5f6d5d16a8 | C++ | wechatplugin/MicroChat | /test/test/python_interface_base.cpp | GB18030 | 3,050 | 2.53125 | 3 | [] | no_license | #include "stdafx.h"
#include "python_interface_base.h"
CPythonBase::CPythonBase()
{
Init();
}
CPythonBase::~CPythonBase()
{
Py_Finalize();
}
PyObject * CPythonBase::ImportModule(LPCSTR szModuleName)
{
PyObject *pModule = PyImport_ImportModule(szModuleName);
if (pModule)
{
CPyModule *pPyModule = new CPyModu... | true |
41f8a80a70658e975076d1f9727ad44ef5e83f96 | C++ | jacking75/book_semina_samples | /Boost_20131105/Asio_02_Server/Session.cpp | UHC | 1,369 | 2.78125 | 3 | [
"MIT"
] | permissive | #include "Session.h"
void Session::PostReceive()
{
memset( &m_ReceiveBuffer, '\0', sizeof(m_ReceiveBuffer) );
m_Socket.async_read_some
(
boost::asio::buffer(m_ReceiveBuffer),
boost::bind( &Session::handle_receive, this,
boost::asio::placeholders::error,
boost::asio::p... | true |
3a005a23ab47244ad3c0b0d1cddbf9c442701ee6 | C++ | Tutkovics/Prog2_NHF | /Family.cpp | UTF-8 | 230 | 2.625 | 3 | [] | no_license | #include "Family.h"
void Family::printDatas() {
Movie::printDatas();
std::cout << "Korhatár: " << ageLimit << std::endl;
}
void Family::printToFile(std::fstream &os) {
Movie::printToFile(os);
os << ageLimit ;
}
| true |
ace54e3d162c3d2261fa765055ec0c01be8d1c3b | C++ | rodrigoaramos/Morphos | /Morphos/Container.cpp | UTF-8 | 1,291 | 2.96875 | 3 | [
"BSD-3-Clause"
] | permissive | #include "Container.h"
#include <algorithm>
using namespace std;
namespace geometry
{
Container::Container() : _mrect((Rect&)Rect()) // , _grrc((Rect&)Rect())
{
//
}
Container::Container(Rect& r) : _mrect(r) //, _grrc((Rect&)Rect())
{
//
}
Container::~Container()
{
//
}
const Container& Container... | true |
bfbe1019928e15fd45d237b1083d5f9fc3c9c2a8 | C++ | WhiZTiM/coliru | /Archive2/0f/9c43ada2a1f936/main.cpp | UTF-8 | 614 | 3.3125 | 3 | [] | no_license | #include <iostream>
#include <type_traits>
template <typename T>
inline constexpr std::remove_reference_t<T> &lvalue(T &&r) noexcept {
return static_cast<std::remove_reference_t<T> &>(r);
}
struct foo {
foo() {
std::cout << "*foo\n";
}
~foo() {
std::cout << "~foo\n";
}
... | true |
2ddcae0ea0f76abc19e881156be15c6ccccf9381 | C++ | AntonioHernandez28/CrackingTheCodingInterview | /Trees & Graphs/Problem4_9.cpp | UTF-8 | 2,512 | 3.671875 | 4 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
#define COUNT 10
struct TreeNode{
int data;
TreeNode* left;
TreeNode* right;
};
void print2DUtil(TreeNode *root, int space)
{
if (root == NULL)
return;
space += COUNT;
print2DUtil(root->right, space);
... | true |
a4f13162e29da913230a306ab2d662b26d2284a8 | C++ | gmoshkin/parcomp2 | /inc/point.h | UTF-8 | 2,639 | 3.265625 | 3 | [] | no_license | #ifndef __POINT_H__
#define __POINT_H__
#include <vector>
#include <iostream>
#ifndef WITHOUT_MPI
#include <mpi.h>
#endif
using std::ostream;
namespace Batcher {
struct Point
{
float coord[2];
int index;
Point(float x, float y, int i)
{
setX(x);
setY(y);
setIndex(i);
}
... | true |
5ef905536799ada1caffdb7d10c8e8fe4a30d405 | C++ | arrudamarcelo/interprocess_communication | /Code/CoreObjects/ClassSerialize.h | UTF-8 | 658 | 2.859375 | 3 | [] | no_license | #pragma once
#include <list>
#include <string>
#include <vector>
#define DELIMITER '&'
/*
* Abstract Class resposible for allow the serialization of classes.
* The classes to be serialized needs to implement the pure virtual methods.
*/
class Serializible {
public:
virtual std::string serialize() = 0;
virtual ... | true |
1b35d56e9c5e69521863cd8f49c80c2bccae0aba | C++ | trinhvo/ravaged-planets | /include/game/simulation/local_player.h | UTF-8 | 971 | 2.59375 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | #pragma once
#include <game/simulation/player.h>
namespace fw {
class colour;
}
namespace game {
/**
* There's only one local_player, and it represents, US, that is, the person who's playing this instance of the game.
*/
class local_player: public player {
private:
session::session_state _last_se... | true |
4267a55001a48e8a04f17d9377655109a85492ff | C++ | nikeorever/Cuiver | /IO/test/src/FileReadWriteTest.cpp | UTF-8 | 520 | 2.84375 | 3 | [] | no_license | #include "gtest/gtest.h"
#include "Cuiver/IO/FileReadWrite.h"
#include <string>
class DateConverterFixture : public ::testing::Test {
protected:
void SetUp() override {
file = new std::string;
*file = ".";
}
void TearDown() override {
delete file;
}
public:
std::string *f... | true |
a6987a6189c84cd7156e06804de556c4cd7bf485 | C++ | montsemsanz/git-exercise-01 | /src/yizongk.cpp | UTF-8 | 858 | 2.546875 | 3 | [
"MIT"
] | permissive | /*******************************************************************************
Title : yizongk.cpp
Author : Yi Zong Kuang
Created on : September 26, 2018
Description : Hello world and a fun fact printed to standard output
Purpose : To collaborate with CS-OSSD group
Usage ... | true |
c2c91846a2ff68220a24e652395e39e1c8d32a95 | C++ | ligand-lg/leetcode | /codingInterview/6_旋转有序数组最小数.cpp | UTF-8 | 848 | 3.015625 | 3 | [] | no_license | #include "../leetcode.h"
class Solution {
int help(const vector<int> &v, int b, int e) {
int m = (b + e) / 2;
if (v[b] < v[e]) return v[b];
if (v[m] > v[b]) return help(v, m + 1, e);
if (v[m] < v[e]) return help(v, b + 1, m);
return min(v[m], v[e]);
}
public:
int minNumberInRotateArray(vect... | true |
f910abcaf932242767e3a98d0b196becb1bbb610 | C++ | IsuruMS/Bankers-Algorithm-in-Cpp | /Bankers_Algorithm_in_cpp.cpp | UTF-8 | 3,717 | 3.359375 | 3 | [] | no_license | // C++ program to illustrate Banker's Algorithm
#include<iostream>
using namespace std;
int processes[100];
int avail[10];
int maxm[100][10];
int allot[100][10];
int need[100][10];
int safeSeq[100];
int work[10];
int request[10];
int n, m;
// calculates and store the need of each process in need[][]... | true |
d00c7d261c4dda95c486358fbd8d9b1d5bee08d4 | C++ | atom-chen/bubbleDragonSecond | /src/client/Classes/RainbowCharactor.h | GB18030 | 2,451 | 2.625 | 3 | [] | no_license | //*******************************************************************************
// : RainbowCharactor
// : <ʺӡ>
//-------------------------------------------------------------------------------
//ע :
//
//÷ : <>
//-------------------------------------------------------------------------------
// ... | true |
e9332d4910cf38f318f5e57ba54482444994e902 | C++ | LuuuuuG/TarenaNotes | /DMS1601/day03/thread.cpp | UTF-8 | 1,177 | 3.296875 | 3 | [] | no_license | #include <pthread.h>
#include <cstdio>
#include <iostream>
using namespace std;
class Thread {
public:
// 启动线程
void start (void) {
pthread_create (&m_tid, NULL, run, this);
}
private:
// 线程过程
static void* run (void* arg) {
return static_cast<Thread*> (arg)->run ();
}
// 线程任务
virtual void* run (void) = 0;
p... | true |
3edb5d59dc8ad75fa94a1cd0eb615c633b92b37c | C++ | dmamills/chipate | /chip8/main.cpp | UTF-8 | 7,354 | 2.859375 | 3 | [] | no_license | //
// main.cpp
// chip8
// Created by daniel mills on 2020-01-23.
// Copyright © 2020 daniel mills. All rights reserved.
//
// CHIP-8 SPEC DOC: http://devernay.free.fr/hacks/chip8/C8TECH10.HTM
#include <iostream>
#include <string>
const int STACK_SIZE = 16;
const int NUM_REGISTERS = 16;
const int MEM_SIZE = 4096;... | true |
ae53e27d69d2d25312d824126c2426ddae7116de | C++ | bssrdf/psychopath_cpp | /utils/low_level.hpp | UTF-8 | 870 | 2.5625 | 3 | [] | no_license | #ifndef LOW_LEVEL_HPP
#define LOW_LEVEL_HPP
#include <mmintrin.h>
namespace LowLevel {
static const int cache_line_size = 64;
template <typename T>
inline void prefetch_L1(T* address) {
constexpr int lines = (sizeof(T)/cache_line_size) + ((sizeof(T)%cache_line_size) == 0 ? 0 : 1);
for (int i = 0; i < lines; ++i) ... | true |
1649bc767b9e585d88ca579a626d4c9e55e2aa0c | C++ | EthanGriffee/SoftwareDev | /assignment5/part1/bench.cpp | UTF-8 | 6,685 | 2.859375 | 3 | [] | no_license | #include "modified_dataframe.h"
#include "parser.h"
#include "array.h"
#include "string.h"
/*******************************************************************************
* Rower::
* A Rower that only wastes time, used to show that it is faster
*/
class ReallyDumbRower : public Rower {
public:
size_t sum;
... | true |
92b275c1756f7aee26ce8df2e598b03a40be70ce | C++ | wwlong/cpp_study | /class_learn.cpp | UTF-8 | 3,157 | 3.90625 | 4 | [] | no_license | /*
学习封装,继承,多态
人
学生,老师
*/
//
#include <iostream>
#include <cstring>
using namespace std;
//
class person {
// private:
public:
char person_name[128];
char person_sex[8];
int person_age;
person();
~person();
void set_person_info(const char *name,... | true |
8cf552e194be41a2c4ebb98ca27c74a62ec8be05 | C++ | antoniojkim/CML | /core/CML/Functions/TensorOps/TensorMultiplication.h | UTF-8 | 2,906 | 3.0625 | 3 | [] | no_license | #ifndef __CML_FUNCTIONS_TENSOROPS_TENSOR_MULTIPLICATION_H__
#define __CML_FUNCTIONS_TENSOROPS_TENSOR_MULTIPLICATION_H__
#include "TensorOps.h"
namespace cml {
template<typename T>
std::vector<tensor<T>> matmul_backward(std::vector<tensor<T>>& params, std::vector<tensor<T>> output){
#ifdef DEBUG
using... | true |
1098afacf1a6ddc0ba4c624a0141d0ce305ffbc1 | C++ | AlexLai1990/Leetcode_-_- | /min_heap.h | UTF-8 | 3,688 | 3.453125 | 3 | [] | no_license | #ifndef MINHEAP_H
#define MINHEAP_H
#include "Vector_temp.h"
#include <assert.h>
template<class T>
class MinHeap {
public:
MinHeap();
~MinHeap();
void Append(T); // automatic shift up
T GetRoot() ;
T LowestKeyNode();
void ShiftDown(); // reorder new root after use and change
void print_out();
bo... | true |
97cae45d1f68ab90c2d15b8efd014e2f2502ba3b | C++ | andrewkatson/TheBTeam | /include/Towers/NotATower.hpp | UTF-8 | 1,083 | 2.546875 | 3 | [] | no_license | #pragma once
/*
* A stand in for a tile without a tower
* @author Andrew Katson
*/
#include "RangeTower.hpp"
#include "../Projectiles/CheesePizzaProjectile.hpp"
class NotATower : public RangeTower{
public:
NotATower(shared_ptr<TextLoader> textLoader, shared_ptr<EventManager> eventManager, shared_ptr<TextureLoade... | true |
0f3262884912e7cdccd06887e246de2cb0f55820 | C++ | ZhukDI/Zhuk | /1 semester/6.b)main.cpp | UTF-8 | 1,579 | 3.84375 | 4 | [] | no_license | /*b)В программе объявлен массив А целых элементов (размер массива 10).
Пользователь вводит массив c клавиатуры. Потом распечатываем массив.
Вводим число N < 10. Затем удаляем N-ый элемент массива (сдвигая остальные элементы).*/
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
void initialization... | true |
67246e50415facbcb0cf268ef82b2d7a9e70421e | C++ | Kawser-nerd/CLCDSA | /Source Codes/CodeJamData/10/01/15.java | UTF-8 | 1,463 | 2.84375 | 3 | [] | no_license | package codejam2010.qualification;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
public class ProblemA {
public static void main(String[] args) {
BufferedReade... | true |
3fbe962c7e908e1ce69798f3663089f8ea72d8af | C++ | Prelly95/Warman_Code | /Drive_Train/Hall_Sense_Test/Hall_Sense_Test.ino | UTF-8 | 397 | 2.859375 | 3 | [] | no_license |
#define POT 10 // analog pin used to connect the potentiometer
#define MOTOR 10
int val; // variable to read the value from the analog pin
void setup() {
pinMode(POT, INPUT);
// pinMode(MOTOR, OUTPUT);
Serial.begin(9600);
}
void loop() {
val = digitalRead(POT);
// val = analogRead(POT);
// val = map(v... | true |
4bb200af1773d76c8caa808aab121ce59acf3300 | C++ | achen889/Warlockery_Engine | /Engine/Networking/ConnectionSocket.cpp | UTF-8 | 9,273 | 2.890625 | 3 | [
"MIT"
] | permissive | //==============================================================================================================
//ConnectionSocket.cpp
//by Albert Chen Jan-14-2016.
//==============================================================================================================
#include "ConnectionSocket.hpp"
#include... | true |
caadb4d18d3c549777f5924348884884354f7b2c | C++ | acc-cosc-1337-fall-2019/acc-cosc-1337-fall-2019-Fortress117 | /src/homework/02_decisions/decisions.cpp | UTF-8 | 1,691 | 3.765625 | 4 | [
"MIT"
] | permissive | #include "decisions.h"
#include <iostream>
//write include statement for decisions header
//Write code for function get_grade_points that accepts a string letter_grade and returns
//the grade_points for as follows:
//given grade "A" returns 4
//given grade "B" returns 3
//given grade "C" returns 2
//given grade "D" r... | true |
94b6a0f4b2bb5b5d2380a107cb910c745131a542 | C++ | 37947538/Young3_7 | /Classes/GameBLL/RewardEquipBLL.cpp | UTF-8 | 3,972 | 2.515625 | 3 | [] | no_license | //
// RewardEquipBLL.cpp
// Zombie3_4
//
// Created by jl on 15/7/28.
//
//
#include "RewardEquipBLL.h"
#include "EnemyBase.h"
#include "GameBLL.h"
#include "GameLayer.h"
#include "APScatterAction.h"
#include "DropGold.h"
#include "DropObject.h"
#include "DropEquip.h"
#include "EnemyModel.h"
#include "EquipmentLoca... | true |
c4aa816e18ac2d65f93bde8d7407a8e6a22d42f4 | C++ | RumRaisins/ProjectEuler | /ProjectEuler/ProjectEuler/3_600851475143的素数.cpp | UTF-8 | 756 | 2.59375 | 3 | [] | no_license | #include"ReadText.h"
using namespace std;
int main() {
//long long int n = 600851475143;
//int *isPrime = new int[0x7fffffe]();
//for (int i = 2; i < n; i++) {
// if (!isPrime[i]) {
// isPrime[++isPrime[0]] = i;
// if ( n % i == 0) {
// //cout << i<<" ";
// n = n / i;
// cout << n<<" ";
... | true |
342b3b48713e4be79fc2595855f1a16bb2d88677 | C++ | GillesAnneSophie/ProjetCPPBanque | /src/CompareEventPriority.h | UTF-8 | 345 | 2.703125 | 3 | [] | no_license | /*
* @author Anne-Sophie GILLES
*/
#ifndef PROJECT_COMPARE_EVENT_PRIORITY_H
#define PROJECT_COMPARE_EVENT_PRIORITY_H
#include "Event.h"
class CompareEventPriority{
public:
/**
* Compare events priority
* @param e1 Event
* @param e2 Event
* @return Int - 0 or 1
*/
int operator() (Ev... | true |
9eb6990a05009a87ee2b72d8bb3bf13db663346b | C++ | cocteautwins/SIRIUS-develop | /src/Density/generate_rho_radial_integrals.cpp | UTF-8 | 4,229 | 2.515625 | 3 | [
"BSD-2-Clause"
] | permissive | #include "density.h"
namespace sirius
{
/** type = 0: full-potential radial integrals \n
* type = 1: pseudopotential valence density integrals \n
* type = 2: pseudopotential code density integrals
*/
mdarray<double, 2> Density::generate_rho_radial_integrals(int type__)
{
runtime::Timer t("sirius::Density::ge... | true |
7a53903644bfb5b4f369e1ffb45bfa01bf837e51 | C++ | zacharytay1994/GPPAssignment2 | /DirectXFramework/Rail.h | UTF-8 | 1,092 | 2.84375 | 3 | [] | no_license | #pragma once
#include "Entity.h"
class Rail : public Entity
{
public:
enum class Direction {
Vertical,
Horizontal,
RTopCurved,
RBottomCurved,
LBottomCurved,
LTopCurved
};
private:
Direction direction_ = Direction::Horizontal;
bool is_ghost_ = false;
public:
Rail(const std::string& image, std::shared... | true |
d6090e99b440d9b1b119514cce579b8700900336 | C++ | mashroormamun/interviewbits | /Largest Number/main.cpp | UTF-8 | 556 | 3.5625 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
bool comp(int i, int j) {
string a = to_string(i);
string b = to_string(j);
return (a + b) > (b + a);
}
string largestNumber(const vector<int>& AA) {
vector<int> A(AA.begin(), AA.end());
sort(A.begin(), A.end(),... | true |
0f17fc703b3881d91b917ff54eeacea7de4ebe46 | C++ | GIacial/Pokemon | /TestPokemon/Pokemon/Statut/statut_paralysie.cpp | UTF-8 | 494 | 2.5625 | 3 | [] | no_license | #include "statut_paralysie.h"
Statut_Paralysie::Statut_Paralysie(PokemonInterface &cible) : AbstractStatut("Paralysie",cible)
{
}
Statut_Paralysie::~Statut_Paralysie() throw (){
}
bool Statut_Paralysie::effect(){
bool attaqueOK = rand()%100 > COEF_ATT_POSSIBLE;
if(!attaqueOK){
emit sendMsg("La "+th... | true |
d299a5fd8687285b2441eb7035a5e74e0e271339 | C++ | Lukasz-Madry/TestRepos | /chesstestuntlanslatenotfinaldonttouch/chesstestuntlanslatenotfinaldonttouch/Board.h | UTF-8 | 670 | 2.5625 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
#include "ClassChess.h"
#include"Pawn.h"
#include"Knight.h"
#include"Bishop.h"
#include"Rook.h"
#include"Queen.h"
#include"King.h"
class Board
{
public:
Piece*** board;
void Start();
void PerformMove();
void Show(... | true |
04d30ce56a40be233776bde082e3d957ef795f33 | C++ | SeanCST/Algorithm_Problems | /LeetCode/031_下一个排列.cpp | UTF-8 | 783 | 3.21875 | 3 | [] | no_license | class Solution {
public:
void nextPermutation(vector<int>& nums) {
int i = 0, j = 0;
int n = nums.size();
for(int k = n - 1; k >= 1; k--) {
// nums[j...n-1] 递减, nums[i] < nums[j]
if(nums[k - 1] < nums[k]) {
i = k - 1;
j = k;
... | true |
db6d1fddafc738fc256db6c7f711a07d40e2ed8a | C++ | tiozo/Training | /vnoj/nkguard.cpp | UTF-8 | 2,709 | 2.75 | 3 | [
"MIT"
] | permissive | #include<bits/stdc++.h>
using namespace std;
#define nd second
#define st first
typedef vector<vector<int>> vii;
class graph {
private:
queue<pair<int,int>> s;
vector<vector<int>> check;
vector<pair<int,int>> ke{{-1,-1},{0,1},{0,-1},{1,0},{-1,0},{1,1},{-1,1},{1,-1}};
int res = 0;
int high = 0;
publi... | true |
a65f4d01afb064f92cd5026ed52528a24ea7aa95 | C++ | Azrrael-exe/FingerPrint-Handler | /C++/src/test.cpp | UTF-8 | 487 | 2.921875 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stddef.h>
#include <string.h>
#include <iostream>
#include <fstream>
int test(unsigned char** d, unsigned int* s){
unsigned char* val = (unsigned char*)malloc(10);
for(int i = 0; i<10; i++){
val[i] = 'A';
}
*s = sizeof(char[10]);
*d = ... | true |
f61c1f48c7efca964932356ec2df96194a24b897 | C++ | mahdi7najafi/DataStructure | /DataStructure/Source.cpp | UTF-8 | 22,239 | 3.703125 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <fstream>
#include <sstream>
using namespace std;
class room {
public:
int length;
int initial;
// Enum class for different types of rooms
enum class roomType { main_hall, exam_hall, lecture_room, tutorial_room, design_studio, meeting_room };
// struct
struct n... | true |
8ffe029caafe80f8ed4409a02b34b7fc09b69ecf | C++ | 264aayush/my-cpp-codes | /kmp.cpp | UTF-8 | 1,230 | 2.546875 | 3 | [] | no_license | #include <bits/stdc++.h>
#define loop(i,a,b) for(int i=a;i<b;i++)
typedef long long ll;
using namespace std;
void lps(int arr[],string str){
int n=str.length();
int j=0;
for(int i=1;i<n;i++){
if(str[i]==str[j]){
arr[i]=j+1;
j++;
}
else{
if(j>0){
... | true |
7cb32f86961461117972bfc255da6f92c4843888 | C++ | tranphuquy19/Digital-Signal-Processing | /XLTHS001.cpp | UTF-8 | 935 | 2.75 | 3 | [] | no_license | #include<stdio.h>
void InputSignal(float a[], int &nH0, int nH)
{
printf("Nhap tin hieu: \n");
for(int i=0; i<nH; i++)
{
scanf("%f", &a[i]);
}
printf("n0 tai phan tu thu may (n0 > 0): ");
scanf("%d", &nH0);
}
void ShowSignal(float a[], int nH0, int nH)
{
for(int i=0; i<nH; i++)
{
printf("%.3f ", a[i]);... | true |
d2b1086cb19ea75c3294bd33284ce78f6579157e | C++ | aslupin/task-problemset | /codeforces/cpp/Magic Spheres.cpp | UTF-8 | 680 | 2.640625 | 3 | [] | no_license | #include <stdio.h>
int spheres[3][3];
int spheres_cpy[3];
int check_i(int i){
spheres[0][i] = spheres[0][i]-2;
if(i != 2) // position isn't 2 (last position) because last have not next
spheres[0][i+1] += 1;
else spheres[0][i-1] += 1;
if(spheres[0][i] != spheres[1][i])
check_i(i);
else return 0;
}
main(){
for... | true |
1932bcd3a90fd02df3be28750d0764abe2b3a0f0 | C++ | 15831944/cstd | /include/net/net_impl.inl | WINDOWS-1252 | 15,556 | 3.1875 | 3 | [] | no_license | /*%
* WARNING: Don't even consider trying to compile this on a system where
* sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
*/
/*
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
* Returns strlen(src); if retval >= siz... | true |