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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
85340e2da5a36734c5874b6d08c6f9c9a470015b | C++ | soundforascene/Art-CodeProject1.0 | /src/demoParticle.cpp | UTF-8 | 4,852 | 3.046875 | 3 | [] | no_license | #include "demoParticle.h"
//------------------------------------------------------------------
demoParticle::demoParticle(){
// Im guessing this corisponds to mode 3?
attractPoints = NULL;
}
//------------------------------------------------------------------
void demoParticle::setMode(particleMode newMode)... | true |
f575bb16a484399e4106a8f2400429577776e7a9 | C++ | wpd550/Boost- | /Caption04/ppTool/ppTool/main.cpp | UTF-8 | 3,261 | 3.046875 | 3 | [] | no_license | //
// main.cpp
// ppTool
//
// Created by wudong on 2019/1/11.
// Copyright © 2019 wudong. All rights reserved.
//
#include <iostream>
#include <boost/noncopyable.hpp> //不可拷贝类
#include <boost/version.hpp>
#include <vector>
#include <string>
class do_not_copy: boost::noncopyable
{
public:
int a =10;
};
//tem... | true |
5d7e24db0ec21eade39c7c194552c075895bc2bf | C++ | alexandraback/datacollection | /solutions_5738606668808192_1/C++/letsRock/c_large.cpp | UTF-8 | 2,010 | 3.03125 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
int N, J;
int c = 0;
unsigned long long e[11];
using namespace std;
unsigned long long mod_exp (unsigned long long n, unsigned long long e, unsigned long long mod)
{
if(e == 0) return 1;
if(e == 1)
{
return (n % mod);
}
else
{
... | true |
26a9b037d69f46b0e940f9fb3efa7680da330b7b | C++ | hychen-naza/Arduino | /Electronic_dice/Electronic_dice.ino | UTF-8 | 1,510 | 3 | 3 | [] | no_license | int button_pin = 2;
int random_value;
int LED_pins[9] = {3, 4, 5, 6, 7, 8, 9, 10, 11};
void setup() {
// put your setup code here, to run once:
for(int i = 0; i < 9; i++){
pinMode(LED_pins[i], OUTPUT);
}
pinMode(button_pin, INPUT);
Serial.begin(9600);
}
void loop() {
int button_state = digitalRead(but... | true |
b08ea219143c3ad042bc5e4a346f1102539e83f8 | C++ | mnive93/GUI-Game-C- | /database/db.cpp | UTF-8 | 1,408 | 2.75 | 3 | [] | no_license |
#include "db.h"
#include<iostream>
#include <mysql_connection.h>
#include <driver.h>
#include <cppconn/exception.h>
#include<stdio.h>
#include <iostream>
using namespace std;
using namespace sql;
/**
* Singleton pattern for database to have only one connection open
*/
MySQLDB* MySQLDB::s_instance = NULL;
MySQLDB... | true |
9585a8445664e1cf60664cf9782ddd677db3738b | C++ | cnclabs/codes.tpr.rec | /src/optimizer/pair_optimizer.h | UTF-8 | 1,322 | 2.546875 | 3 | [
"MIT"
] | permissive | #ifndef PAIR_OPTIMIZER_H
#define PAIR_OPTIMIZER_H
#include <stdlib.h>
#include <cmath>
#include <iostream>
#include <vector>
#define SIGMOID_TABLE_SIZE 1000
#define MAX_SIGMOID 8.0
class PairOptimizer {
private:
void init_sigmoid();
public:
// constructor
PairOptimizer();
// ... | true |
8c78e6c1417af0316aecb72743c7838148812a61 | C++ | senior-cpp-developer/GraphProject | /src/SeriousGraphTools/Graph/Edge.h | UTF-8 | 954 | 3.109375 | 3 | [] | no_license | #ifndef GRAPHPROJECT_EDGE_H
#define GRAPHPROJECT_EDGE_H
#include "Node.h"
namespace SeriousGraphTools {
class Edge {
Node* from;
Node* to;
double weight;
bool isBi_;
public:
Edge(Node* from, Node* to, double weight, bool isBi)
: from(from), to(to), weight(w... | true |
ec62350b69c92882c9c640d4b8e92ae2b0da2cf1 | C++ | troe88/baly | /src/Daemon.cpp | UTF-8 | 3,817 | 2.640625 | 3 | [] | no_license | /*
* Daemon.cpp
*
* Created on: May 3, 2015
* Author: dmitry
*/
#include "Daemon.h"
#include "ConfigReader.h"
#define EVENT struct inotify_event *
std::vector<std::string> Daemon::dir;
std::map<int, std::string> Daemon::_in_dir;
int ftw_handler(const char *name, const struct stat *status, int type) {
if (... | true |
96f36464d26ae7719d1ee677a63d9a281120f252 | C++ | Jordan-Betcher/CPPAssignment2 | /Assignment2/src/OrderedLinkedList.h | UTF-8 | 3,513 | 3.8125 | 4 | [] | no_license | //============================================================================
// Name : OrderedLinkedList.h
// Author : Jordan Betcher
// Date : 10/23/2017
// Description : OrderedLinkedList a LinkedList that inserts based on comparative operators
//=============================================... | true |
b586293d8bc115078db9e393fe79b7b1d11b56f5 | C++ | AngheloAlf/2020-1_ProgCompetitiva | /clases/08/52C/52C.cpp | UTF-8 | 4,559 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <sstream>
#include <cmath>
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define TAMANO(n) std::exp2l(std::ceil(std::log2l(n+1))+1)
void construir_arbol(std::vector<long long> &arbol, const std::vector<long long> &datos, size_t izquierda, size_t derecha, size_t pivote){
... | true |
719ea5cccea7c6d5b3874bf8d7846b8df2cc04e2 | C++ | devvsda/gargantua | /src/com/devsda/gargantua/asignments/2/64.cpp | UTF-8 | 640 | 3.453125 | 3 | [
"MIT"
] | permissive | #include<iostream>
using namespace std;
void printPermutationRecur(char *s1, char *answer, int length, int index) {
for(int i = 0; i <= length; i++) {
answer[index] = s1[i];
if(index == (length)) {
printf("%s\n", answer);
}
else
printPermutationRecu... | true |
f9395a437041e2efd1e0b2a453ae16ddcf824a9a | C++ | NOVACProject/NOVACProgram | /UserSettings.h | UTF-8 | 1,159 | 2.578125 | 3 | [] | no_license | #pragma once
#include "Common/Common.h"
/**
The class <b>CUserSettings</b> stores the preferences for the
current user.
This can be e.g. the unit to use on the flux.
*/
class CUserSettings
{
public:
// ----------------------------------------------------------------
// ---------------... | true |
e483f0803260704fa1d6e2cf3d9fd6a5e20f7aee | C++ | Subsystems-us/Starship | /Starship_tilt.ino | UTF-8 | 3,864 | 3.15625 | 3 | [] | no_license | // This program calibrates the accelerometer and then
// Acts as a tilt sensor to show the relative angle
// in the X and Y axis directions.
// Map the Arduino pins to the Starship functions
#define shift_data 3 // Data for the LED shift registers
#define shift_clk 4 // Clock for the LED shift registers
#defi... | true |
10638265897d9cc4e1a256f9c31c8188b054c285 | C++ | Jato30/IDJ | /src/Bullet.cpp | UTF-8 | 1,333 | 2.8125 | 3 | [] | no_license | #include "Bullet.hpp"
Bullet::Bullet(float x, float y, float angle, float speed, float maxDistance, std::string sprite, float frameTime, int frameCount, bool target) : GameObject(){
sp = Sprite(sprite);
sp.SetFrameTime(frameTime);
sp.SetFrameCount(frameCount);
box = Rect(x, y, sp.GetWidth(), sp.GetHeig... | true |
3530512d4dd5284978c2200c16c17cade56f7d2f | C++ | bdchatham/OSU | /CS165/Final Project/Maze/main.cpp | UTF-8 | 12,330 | 3.328125 | 3 | [] | no_license | /**********
** Program: Final Project
** Author: Aryan Aziz
** Description: Maze game with some extra features!
** Input: Various
** Output: Various
**********/
/**********
** Re-Evaluation Sections
** Not sure if the items I want re-evaluated can be, but if it's possible please look into the following:
** Week 4 Assi... | true |
e15ec7cda477742c40ad54a351fe3a2e22ec6671 | C++ | DongDaYo/My-Data-Structure | /Data Structure/Data Structure Project/Exercise - DFSTraverse to find loop.cpp | GB18030 | 1,096 | 2.765625 | 3 | [] | no_license | #include "MGraph.cpp"
bool visited[MaxVertexNum];
int connect = 0;
int connectivity[MaxVertexNum] = { 0 };
MGraph<char> graph(DG);
map<char, int> mp;
int loop = 0;
bool back = false;
template<typename T>
void DFS(MGraph<T>& graph, int i) {
visited[i] = true;
connectivity[i] = connect;
for (int j = graph.firstneighb... | true |
db403c037db62261fda4fa1d35745577bf8ced9d | C++ | Gouravsingh21/DSA-Cpp | /arry2d/transpose.cpp | UTF-8 | 550 | 3.859375 | 4 | [] | no_license | // create a 2 D array and make transpose of it.
#include<iostream>
#include<conio.h>
using namespace std;
void transpose(int arr[3][3]){
for(int i;i<3;i++){
for(int j;j<3;j++){
cout<<arr[j][i];
}
cout<<endl;
}
}
int main(){
cout<<"Enter the number of row and colounm"<<endl;
// cin>>row>>col;
int arr[3][... | true |
eea65999dd69b726e1cb350799e54032dd608db9 | C++ | JhoonGranados/SQL-2019-08 | /desktop/final/Funciones/Ejercicio2/main.cpp | UTF-8 | 391 | 3.671875 | 4 | [] | no_license | #include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int multiplicacion(int numero)
{
int mul = numero * 2;
return mul;
}
int main(int argc, char** argv)
{
int n;
cout<<"ingrese un numero: ";
cin>>n;
cout<<"el numero "<<n... | true |
b8b2a6397f6c6d7285b991b2e0f49a113d98b614 | C++ | Archipel/cdWt | /CDWObject.h | UTF-8 | 3,749 | 2.8125 | 3 | [] | no_license | /*
* WObject.cpp
*
* Created on: 25-nov.-2014
* Author: thomas
*/
#include <Wt/WObject>
namespace Wt {
class CDWObject{
protected:
WObject* wobject;
public:
CDWObject(WObject* wobject = 0): wobject(wobject) {}
virtual ~CDWObject(){
delete wobject;
}
/*
* Unique id's
... | true |
9565d2f361c5b979a847596f366f6bf018139612 | C++ | rajesh-06/lab10 | /lab10_q3.cpp | UTF-8 | 1,612 | 4.65625 | 5 | [] | no_license | /* Q3.Create a class for rectangle that stores data of length and breadth and has two functions : area() and perimeter(). Write a program that uses this class to create two rectangles (rectangle objects) of user inputted length and breadth. Compare the areas and perimeter of the those rectangles.*/
//include library
#... | true |
93855ad7400ee9b598c55ce7c5cfdf950afe0fc3 | C++ | mwcorley79/MikeCorley | /lecture27/code/thread_demos/ThreadDemo1.cpp | UTF-8 | 1,774 | 3.125 | 3 | [] | no_license | ///////////////////////////////////////////////////////////////////////////////////
// Name : ThreadDemo1.cpp
// Author : Jim Fawcett
// Version : 1.0
// Description : Simple demo of threads and locks
//============================================================================
// Compiler command: g++... | true |
5aabbb454688efc20321e837c697900875bdc291 | C++ | wzj423/OI | /luogu/聪明的质检员.cpp | UTF-8 | 1,887 | 2.8125 | 3 | [] | no_license | /**
聪明的质检员
Luogu P1314
*/
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
using namespace std;
typedef long long LL;
const int MAXN=200010;
L... | true |
9556212eedffed5f7e261cad9d42a9d6bafa9329 | C++ | zeroslope/BZOJ-code | /BZOJ/2956 模积和.cpp | UTF-8 | 1,009 | 2.53125 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;
const LL MOD = 19940417;
template<class T>inline void Read(T& x){
x=0; bool flag=0; char ch=getchar();
while(ch> '9' || ch< '0'){ if(ch=='-'){ flag=1; ch=getchar(); break; } ch=getchar();}
while(ch>='0' && ch<='9'){ ... | true |
e326dd168bb4abbeb9cf79050ffa7f0b9e2f2a40 | C++ | EFanZh/Archived | /Visual Studio/Misc/LeetCode OJ/213. House Robber II/Solution.h | UTF-8 | 986 | 3.296875 | 3 | [] | no_license | #pragma once
class Solution
{
template <class T>
static int robHelper(T first, T last)
{
if (first == last)
{
return 0;
}
else if (first + 1 == last)
{
return *first;
}
int prev2 = *(last - 1);
int prev1 = max(*(last -... | true |
db4f73d6496be352503ae07a5d7387fe7b37f5f5 | C++ | sakanof/CGE | /Project/Components/SME/Include/Vector.h | UTF-8 | 4,602 | 3.078125 | 3 | [] | no_license | #ifndef SME_Vector_H
#define SME_Vector_H
#include <vector>
#include <list>
#include <string>
// Math Engine Includes
#include "Definitions.h"
namespace SME
{
namespace Vector
{
class SIMPLE_MATH_ENGINE_API Vec2
{
public:
union
{
struct { float x; float y; };
struct { float r; float g; };
s... | true |
f6109007a6c2ebca71e4c353b52da7037547ce85 | C++ | greybinhoe/PA1415-Programvarudesign | /Project1/Project1/Map.h | UTF-8 | 469 | 2.828125 | 3 | [] | no_license | #ifndef MAP_H
#define MAP_H
#include "Point.h"
#include "Tile.h"
#include "Item.h"
#include <string>
class Map
{
private:
Tile tileMap[120][25];
int sizeX = 120;
int sizeY = 25;
public:
Map();
~Map();
Item& pickUpItem(int y, int x);
bool checkPos(int y, int x);
void rowToCharArray(char * charArray, int row... | true |
994f244d601a0c1a439796d1ab359a475b7b1285 | C++ | scen/libembryo | /logger.h | UTF-8 | 1,124 | 2.546875 | 3 | [
"MIT"
] | permissive | //
// libembryo
//
// Copyright Stanley Cen 2013
// Released under the MIT License
//
#ifndef libembryo_log_h
#define libembryo_log_h
#include <boost/format.hpp>
#include <iostream>
#include <fstream>
#include <string>
using boost::format;
namespace embryo
{
class logger
{
public:
enum logflags... | true |
86354f1a8c4e5e6f63ed5ef12e441428a2bf637c | C++ | CryptoLover705/Game_Physics | /Vector3.hpp | UTF-8 | 3,095 | 3.53125 | 4 | [] | no_license | #include <initializer_list>
#include <cmath>
class Vector3
{
public:
double v[3];
public:
Vector3();
Vector3(double x, double y, double z);
double &operator[](int index);
double operator[](int index) const;
Vector3 operator*(double scale) const;
Vector3 o... | true |
42a1877d247efc9d01696be9c9479172a963bac8 | C++ | jizecn/my_humanoid_robot | /src/actionDecision/include/EventActionPair.h | UTF-8 | 1,197 | 3.171875 | 3 | [] | no_license | #ifndef __EVENT_ACTION_PAIR_H__
#define __EVENT_ACTION_PAIR_H__
#include <vector>
#include "SinglePartEvent.h"
#include "ActionCommand.h"
class EventActionPair
{
public:
EventActionPair()
{
}
~EventActionPair()
{
}
void setEventKey(SinglePartEvent &key)
{
this->key = key;
}
boo... | true |
1a885a258a56fe3b098f2e0dd3ee025d122a9481 | C++ | RicardoSoz/Estructuras | /NodoFila.cpp | UTF-8 | 547 | 2.640625 | 3 | [] | no_license | #include "NodoFila.h"
#include <iostream>
using namespace std;
NodoFila::NodoFila() {
dato = 0;
sig = NULL;
}
NodoFila::NodoFila(int _dato) {
dato = _dato;
sig = NULL;
}
NodoFila::NodoFila(int _dato, char _caracter) {
dato = _dato;
caracter = _caracter;
sig = NULL;
}
int NodoFila::g... | true |
6ec5fe11c64d8eee967ac4b16d1c2221fb1f00e9 | C++ | Thecarisma/serenity | /AK/Tests/TestHashMap.cpp | UTF-8 | 2,649 | 3.359375 | 3 | [
"BSD-2-Clause"
] | permissive | #include <AK/TestSuite.h>
#include <AK/String.h>
#include <AK/HashMap.h>
TEST_CASE(construct)
{
typedef HashMap<int, int> IntIntMap;
EXPECT(IntIntMap().is_empty());
EXPECT_EQ(IntIntMap().size(), 0);
}
TEST_CASE(populate)
{
HashMap<int, String> number_to_string;
number_to_string.set(1, "One");
... | true |
1f2f68ff4f55c7a9dca16affcf6459e48dbc0479 | C++ | sharkprince/tank-game | /src/models/block.cpp | UTF-8 | 2,306 | 3.140625 | 3 | [
"MIT"
] | permissive | #include "block.h"
#include "../const/rotation.h"
Block::Block(sf::Texture *texture, sf::Vector2f position, bool isBreakable, bool isSoft, bool isDeep) {
Sprite = new sf::Sprite();
Sprite->setTexture(*texture);
Sprite->setPosition(position.x, position.y);
Sprite->setTextureRect(sf::IntRect(0, 0, BLOCK_... | true |
037100e034254179fb86fe93035371a100731290 | C++ | sheirkahn/RCAS | /RCAS/RCASSession.cpp | UTF-8 | 2,848 | 2.625 | 3 | [] | no_license | #include "RCASSession.h"
#include <QFile>
#include <QJsonArray>
RCASSession::RCASSession ()
{
mModified = false;
}
void RCASSession::writeToJson (QJsonObject& json)
{
json["session_id"] = mID;
json["name"] = mAssessorName;
json["date"] = mSessionDate;
QJsonArray candidateArray;
foreach (RCASC... | true |
f6a47f26ed76e1a131c25a6b3a44228d2b7fa7c2 | C++ | JMikeJacob/roots-project-1 | /main.cpp | UTF-8 | 2,927 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include "polynomial.h"
#include "rootfinder.h"
#include "misc_functions.h"
using namespace std;
#define MAX_ORDER 20
using namespace std;
bool g_fileExists = true;//global var for existence of text file
void getpoly(string fileName, polynomial& Poly)
{
if... | true |
222fc49c7293498e19f649512d0fc645a70fef0b | C++ | metaphysis/Code | /UVa Online Judge/volume012/1234 RACING/program.cpp | UTF-8 | 1,575 | 2.734375 | 3 | [] | no_license | // RACING
// UVa ID: 1234
// Verdict: Accepted
// Submission Date: 2018-02-12
// UVa Run Time: 0.060s
//
// 版权所有(C)2018,邱秋。metaphysis # yeah dot net
#include <bits/stdc++.h>
using namespace std;
const int MAXV = 10010, MAXE = 100010, INF = 0x7fffffff;
struct edge {
int from, to, cost;
bool operator<(const e... | true |
8c3dfa2f3a11586d6d403e6607c739283610e3a0 | C++ | nikku599/competitiveProgramming | /cpp/Counting even or odd.cpp | UTF-8 | 3,392 | 3.5 | 4 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
struct node {
int num_of_odd , num_of_even;
};
void buildTree (int* arr, node* tree, int start, int end, int tree_node) {
if (start == end) {
if (arr[start] % 2 == 0) {
tree[tree_node].num_of_even = 1;
tree[tree_node].num_... | true |
3ea7e8be883fb86d85875e0bfcb0afd8e7d15364 | C++ | bystc/SomeExercisesAboutC | /用嵌套循环写个小程序.cpp | UTF-8 | 381 | 2.703125 | 3 | [] | no_license | #include<stdio.h>
int main()
// char ch='$';
// int i,j;
// for(i=0;i<4;i++){
//
// for(j=0;j<8;j++)
// printf("%c",ch);
// printf("\n");
// return 0;
{
char a;
int i;
printf("Please input a string end by #:");
for(i = 1; (a = getchar()) != '#'; i++)
{
printf("%c--%d\t",a,a);
if(i%8 ... | true |
8c5ea0ba24f107e824d71c6e165daf80faeee038 | C++ | fevralkolesnikova/studio | /storage.cpp | UTF-8 | 1,793 | 2.671875 | 3 | [] | no_license | #include "storage.h"
#include <QDebug>
Storage::Storage(QWidget *parent) :
QDialog(parent) {
ui.setupUi(this);
connect(ui.pushButton, SIGNAL(clicked()), this, SLOT(changeMaterials()));
connect(ui.pushButton_2, SIGNAL(clicked()), this, SLOT(deleteMaterial()));
connect(ui.pushButton_3, SIGNAL(clicked()), this, SLOT(c... | true |
ad9cbba8ebe14235b949e8e82e1650625bf8161d | C++ | Plypy/Lifestyle | /Usaoj/fence8.cpp | GB18030 | 2,428 | 2.734375 | 3 | [] | no_license | /*
ID : jake1994
PROG : fence8
LANG : C++
*/
// .........
//
//
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("fence8.in");
ofstream fout("fence8.out");
const int MAXN = 51;
const int MAXR = 1024;
int size[MAXN];
int backup[MAXN];
int len[MA... | true |
eb136e62fc6b9c28fef491257e5f71144921f92c | C++ | cunkoutangtou/Leetcode-Cpp | /二叉树/交换节点.cpp | UTF-8 | 2,096 | 3.53125 | 4 | [] | no_license | 给定数组b为n*2的数组,如果其中的每对元素不存在父子或者祖孙关系,则交换。
class Solution {
public:
unordered_map<int, TreeNode*> mp;
unordered_map<int, int> fa;
bool judge(TreeNode* a, int val){
if(!a) return false;
if(a -> val == val) return true;
return judge(a -> left, val) || judge(a -> right, val);
}
boo... | true |
5a4522293cb4eff7a2e3b4afd8fb0ec6299f6939 | C++ | sauravgupta2800/MyCodingPractice | /miscellaneous/jan1-2.cpp | UTF-8 | 945 | 2.8125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll t;
cin>>t;
while(t--)
{
ll bob=0,alice=0,common=0,i=0,n,b,a,item;
vector<ll> v;
cin>>n>>b>>a;
for(i=0;i<n;i++)
{
cin>>item;
v.push_back(item);
if... | true |
27b32a9608d5f0b95828789b413f139e2625941e | C++ | Aradhana-Singh/DSA_CPP | /TwoPointers/2SUM_Closest_16.cpp | UTF-8 | 1,064 | 3.59375 | 4 | [] | no_license | /* Given an array nums of n integers and an integer target,
find three integers in nums such that the sum is closest to target. Return the sum of the three integers.
You may assume that each input would have exactly one solution.*/
class Solution {
public:
int threeSumClosest(vector<int>& nums, int target) {
... | true |
f9d921e4568a595f59efbb6364382e7ec2171e0c | C++ | Mart95777/CppLinux | /general/copycontrol/unable_copyconstr.cpp | UTF-8 | 502 | 3.15625 | 3 | [] | no_license | // unable to generate default
#include <iostream>
class Base
{
public:
int n;
Base(int n =1) : n(n) {}
Base(const Base& b) : n(b.n) {}
};
class Deriv : public Base
{
};
class Deriv2 : public Deriv
{
public:
Deriv2() : Deriv() {}
private:
Deriv2(const Deriv2&);
};
int main()
{
Base b1(3);
Base b2(b1)... | true |
31b34836755d537888e0aaba5f1094dfd2818fd9 | C++ | thiagofigcosta/miniPearlInterpretor | /interpreter/command/IfCommand.cpp | UTF-8 | 519 | 2.890625 | 3 | [] | no_license | #include "IfCommand.hpp"
#include <cassert>
IfCommand::IfCommand(IfHead* cond, Command* then, int line)
: Command(line),cond_(cond),then_(then),else_(nullptr){
}
IfCommand::IfCommand(IfHead* cond, Command* then, Command* elsecmd,int line)
: Command(line),cond_(cond),then_(then),else_(elsecmd) {
}
IfCommand:... | true |
b052605f785883e52d954af14e83f763fd3ad0ee | C++ | Nikhil12321/codes | /longest_palindromic_subsequence.cpp | UTF-8 | 1,185 | 3.140625 | 3 | [] | no_license | #include<iostream>
#include<string>
using namespace std;
int maxi(int a, int b){
if(a>b)
return a;
return b;
}
string longestPalindrome(string str) {
int l, i, j, n;
n = str.size();
int ans[n][n];
int max = -1111;
int posl = 0;
int maxl = 1;
for(i=0; i<n; i++){
a... | true |
57d36bf4560467af3701ef6c486fd0aa919ad7c1 | C++ | dantswain/rhubarb | /sample_client.cpp | UTF-8 | 618 | 2.546875 | 3 | [
"MIT"
] | permissive | /*
* sample_client.cpp - shows simple usage of rhubarb client socket
*
* compiling:
* *nix/OS X: g++ sample_client.cpp -o sample_client
*
* Copyright (c) 2011 Daniel T. Swain
* See the file license.txt for copying permissions
*
*/
#include <stdio.h>
#include "clients/rhubarbSocket.h"
int main(in... | true |
0f50e6f8eb014aa2c9ff1d44e257688afc76daac | C++ | Amrut182/data-structures | /linkedList.cpp | UTF-8 | 1,032 | 4.21875 | 4 | [] | no_license | //Linked list with 3 nodes
//Printing the values of 3 nodes
//Printing the value of node at given index
//Printing the index of given value after searching
#include<bits/stdc++.h>
using namespace std;
class Node {
public:
int data;
Node* next;
};
void printList(Node *n) {
while(n) { //n != NULL
cout << n -> data... | true |
a474ef120844fc1440d018274a2c3aee466d6757 | C++ | ryankall/find_max_of_function | /main.cpp | UTF-8 | 794 | 3.203125 | 3 | [] | no_license | /*
* File: main.cpp
* Author: Ryan Kallicharran
*
* Created on April 23, 2015, 8:06 PM
*/
#include <cstdlib>
#include <iostream>
#include <math.h>
#define ESP .01
using namespace std;
//function
double F(int x){
double function = -(x*x) -10;
return function;
}
void findMaxofFunction(int a, int b, int... | true |
1c141e48656a690ba773afddcdf90187d7888fcf | C++ | AppCrashExpress/DA-labs | /DA-lab-2/max_tree.cpp | UTF-8 | 10,121 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <unistd.h>
bool equal(const char *str1, const char *str2){
if(str1 == nullptr || str2 == nullptr){
return false;
}
int i = 0;
while(str1[i] != '\0' && str2[i] != '\0'){
if(str1[i] != str2[i]){
return fals... | true |
eabe9e8ad698fb166b66104b755521e12ce45239 | C++ | aebraryucel/Data-Structures-and-Algorithms-C | /GRAPHS2/Graph2.cpp | ISO-8859-9 | 13,346 | 3.234375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define CAPACITY 999
struct AdjListNode //adj listelerindeki dm
{
int id;
struct AdjListNode* next;
};
struct AdjList //adj listesi
{
struct AdjListNode *head;
int id; //hangi id ye ait listenin tutulduu
}... | true |
7d6f5b4f2fcae4da0f9e1f6c392e62e8e1aafdd4 | C++ | kinasmith/ASRA | /hampshite_demo/src/sensor/sensor.cpp | UTF-8 | 3,674 | 2.75 | 3 | [] | no_license | /**
* Currently the EEPROM is really front loaded.
* The time address is overwritten the most, and
* the high addresses will never be used.figure out a way to balance the data load!
*/
#include <Arduino.h>
#include <SPI.h>
#include <Wire.h>
#include "SHT2x.h" //https://github.com/misenso/SHT2x-Arduino-Library
#incl... | true |
33cebeeb1d90aabd9dd2dd3c94d362b4b9cc294d | C++ | ABX9801/Data-Structures | /pointers/char_arr2.cpp | UTF-8 | 323 | 3.375 | 3 | [] | no_license | #include<iostream>
using namespace std;
// A functions that takes in a character pointer as an argument
// A call-by-reference type function
void print(char* C){
int i=0;
while(*(C+i)!='\0'){
printf("%c",*(C+i));
i+=1;
}
}
int main(void){
char* C = "Anurag";
print(C);
return 0... | true |
8b2e65a2428c7e356fcdc46def26ffa7e96dabed | C++ | AOS-Group-1/coen383 | /assignment3/concert.h | UTF-8 | 683 | 2.953125 | 3 | [] | no_license | #ifndef ASSIGNMENT3_CONCERT_H
#define ASSIGNMENT3_CONCERT_H
#include "customer.h"
typedef struct {
bool assigned;
Customer *customer;
} Seat;
class Concert {
private:
static Concert *instance;
// Private Constructor so that no objects can be created
Concert();
Seat *seats[10][10]{};
pthread_m... | true |
d95cd98f19412570d2ca5d40cf4621f79f4cf836 | C++ | wyc25013/leetcode | /79_Word_Search/79.cpp | UTF-8 | 2,078 | 3.375 | 3 | [] | no_license | #include <vector>
#include <string>
#include <iostream>
using namespace std;
class Solution {
public:
bool exist(vector<vector<char> >& board, string word) {
int row = board.size();
int col = board[0].size();
vector<vector<bool> > map;
for(int i = 0; i < row; i++){
vector<bool> tmp(col,false);
map.pu... | true |
0409b9f7befec8e523c98aff2b2364f7b38a257c | C++ | jinseongbe/cpp_study | /CPP_52(정적다차원배열_MultiDimensionalArray)/CPP_52/main.cpp | UTF-8 | 2,427 | 3.765625 | 4 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
//2차원 array
const int num_rows = 3;
const int num_columns = 5;
for(int row = 0; row < num_rows; ++row)
{
for(int col = 0; col < num_columns; ++col)
{
cout << '[' << row << ']' << '[' << col << ']' << '... | true |
cb1a3e74349a2fe7cdd65ce343fbeb5b64563aa8 | C++ | SergeiNA/yamr | /test_utils.cpp | UTF-8 | 1,591 | 2.828125 | 3 | [] | no_license | #define BOOST_TEST_MODULE min_prefix
#include "utils.hpp"
#include <iostream>
#include <sstream>
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_SUITE(min_prefix)
BOOST_AUTO_TEST_CASE(test_class_MinPrefix)
{
std::vector<std::string> input {"a","a","a",
"ab","ab",
... | true |
7d8f50057373937d13cc32cf11ebceab9ad83682 | C++ | TJ95/cs488f19 | /cs488/A3/JointNode.cpp | UTF-8 | 2,207 | 3.015625 | 3 | [] | no_license | // Fall 2019
#include "JointNode.hpp"
using namespace glm;
#include <algorithm>
//---------------------------------------------------------------------------------------
JointNode::JointNode(const std::string& name)
: SceneNode(name)
{
m_nodeType = NodeType::JointNode;
}
//----------------------------------------... | true |
dafc670d139ba7d49604ecd7c6372c650575315f | C++ | vynaloze/FoP-assignment | /FundOfProgr.cpp | UTF-8 | 1,203 | 3.203125 | 3 | [] | no_license | #include "stdafx.h"
#include "Person.h"
#include "DataBase.h"
int main()
{
DataBase dataBase = DataBase();
cout << "-----------------------------------------------------------" << endl
<< "Fundamentals Of Programming - Assesment: \"Database program\".\nCreated by Piotr Pawluk." << endl
<< "--------------------... | true |
f5a5b2bc74dc9587a4b70451b0f7742ccbcf8ce3 | C++ | cjdao/stl_example | /ex08/ex08-04.cpp | UTF-8 | 1,215 | 3.484375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <cassert>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;
template <typename T>
class less_with_count: public binary_function<T,T,bool> {
public:
less_with_count():counter(0),progenitor(0) {}
less_with_count(less_with_count<T> &x):coun... | true |
8f670df48bbae237397c782f168452b8a93b156c | C++ | 2203juan/algorithm_workshops | /c++/general/cppPanama/1.cpp | UTF-8 | 683 | 3.75 | 4 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
double get_sueldo(double horas_trabajadas, double valor_hora){
double saldo = 0;
if (horas_trabajadas > 40){
saldo += (40*valor_hora);
horas_trabajadas -= 40;
saldo += (horas_trabajadas*(2.0*valor_hora));
}
else {
saldo += horas_trabajadas*valor_hora;
}
... | true |
5b12731841fce358b9683269f13bfe15a4b885ec | C++ | Juliyo/LastBullet | /Desarrollo/BulletTest/BulletTest/Motor/BasicSceneNode.cpp | UTF-8 | 2,455 | 2.625 | 3 | [] | no_license |
#include "BasicSceneNode.h"
#include <GraphicEngine.h>
#include <Util.h>
BasicSceneNode::BasicSceneNode(TModel* node) :
m_node(node)
{
}
BasicSceneNode::~BasicSceneNode()
{
//m_node->removeNode();
//m_node = nullptr;
//m_node->removeNode();
//delete m_node;
}
void BasicSceneNode::setTexture(const std::string... | true |
bb92a5bb9d7a25ecba16cd6337db93769c8b2968 | C++ | gitcollect/backdoorCppCrossPlateform | /src/core/cli/Interface.cpp | UTF-8 | 4,484 | 2.796875 | 3 | [] | no_license | //
// Created by mfranc on 18/09/15.
//
#include "Interface.h"
Interface::Interface(int argc, const char** argv) {
this->setFlagIsValidOptions(
this->setArgc(argc)
.setArgv(argv)
.initProgramOptions()
);
}
/**
* Initialize programm option from CLI with C++ Boost lib
... | true |
82feae985179f3af16c5292e7dd577ee94849642 | C++ | toksn/TINYTRAIN_2D | /TINYTRAIN_2D/Spline_CatmullRom.h | UTF-8 | 1,820 | 2.640625 | 3 | [] | no_license | #pragma once
#include "Spline.h"
namespace tgf
{
namespace math
{
class Spline_CatmullRom : public Spline
{
public:
// catmull rom type
// see http://www.cemyuksel.com/research/catmullroparam_/catmullrom.pdf for more info
enum class CatmullRomType
{
Uniform, // uniform is faster, can introduce... | true |
b039d4b75e2eda7842b85567b61acd898cd8601d | C++ | Yunying/Leetcode.cpp | /189_Rotate_Array.cpp | UTF-8 | 335 | 2.75 | 3 | [] | no_license | class Solution {
public:
void rotate(vector<int>& nums, int k) {
if (nums.size() == 0 || nums.size() == 1){
return;
}
k = k%nums.size();
for (int i=0; i<k; i++){
int tmp = nums.back();
nums.pop_back();
nums.insert(nums.begin(),tmp);
... | true |
517da3c9e10757400d23b62625e6907b4939e746 | C++ | johnvtan/Algorithms | /school/spring-2017/algorithms/project-3/grid.cpp | UTF-8 | 3,565 | 3.65625 | 4 | [] | no_license | // Mary Forde
// John Tan
// Project 3
#include"grid.h"
// This file implements the grid class
using namespace std;
grid::grid(const char* filename)
//constructs a grid from the given file
{
ifstream myFile;
myFile.open(filename);
if(!myFile.is_open())
{
throw fileOpenError(filename);
}
if(myFile.is_op... | true |
b1837506d52855da5d7217de2f4751504f37de5a | C++ | MarshallSCPT/aniware-internal | /aw-internal/shared/stack_frame/stack_frame.hpp | UTF-8 | 767 | 2.78125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #pragma once
struct stack_frame_t
{
address_t m_fp;
address_t m_ret;
stack_frame_t( ) = default;
stack_frame_t( void* ret ) : m_fp{} { setup( uintptr_t( ret ) ); }
stack_frame_t( uintptr_t ret ) : m_fp{} { setup( ret ); }
~stack_frame_t( ) = default;
void setup( uintptr_t ret )
{
m_fp = address_t( ret - si... | true |
5d75d5a32a5cc3c6abc6b27c7be9ffb213121c0c | C++ | rezanour/randomoldstuff | /Main/Shooter1/ContentPipeline/taskmanager.h | UTF-8 | 1,485 | 2.65625 | 3 | [] | no_license | #pragma once
enum class TaskType
{
None = 0,
Texture,
World,
};
struct ContentTask
{
ContentTask(TaskType type, _In_z_ const wchar_t* source, _In_z_ const wchar_t* dest) :
Type(type), Source(source), Dest(dest)
{}
std::wstring Source;
std::wstring Dest;
TaskType T... | true |
687aa3a598bebd07e32107d68a0edb88cb1c6220 | C++ | yayankov/Projects | /Object-oriented-programming-Personal-project/OOP_Shop_19-20_fn62357_g1_d4-Final/User.cpp | UTF-8 | 555 | 3.1875 | 3 | [] | no_license | #include "User.h"
#include <iostream>
#include <limits>
#include <cstring>
using namespace std;
#define _CRT_SECURE_NO_WARNINGS
User::User()
{
cart = Cart();
}
void User::addToCart(Product* product) {
cart.addToCart(product);
}
void User::removeFromCart() {
std::cout << "Enter Product number to remove from cart: "... | true |
2ad253a448512138b7b68fd3e2275f053ea326ad | C++ | Nonoreve/OpenGLScene | /src/Shader.cpp | UTF-8 | 4,914 | 2.8125 | 3 | [] | no_license | #include "Shader.h"
#include "rendering/renderer.h"
#include <glm/gtc/type_ptr.hpp>
#include <cstdarg>
Shader::Shader() : m_programID(0), m_vertexID(0), m_fragID(0) {
}
Shader::~Shader() {
glDeleteProgram(m_programID);
glDeleteShader(m_vertexID);
glDeleteShader(m_fragID);
}
Shader* Shader::loadFromFiles(FILE* ver... | true |
f658a36fa855cc32c168c2463edc788f76e280bf | C++ | Krentin018/Tut2-Fraction | /Fractions.h | UTF-8 | 361 | 2.515625 | 3 | [] | no_license | #pragma once
class Fractions
{
public:
int numer;
int denom;
int num;
Fractions();
~Fractions();
void setNumer(int);
void setDenom(int);
Fractions Fractions::add(Fractions &a);
Fractions Fractions::subtract(Fractions &a);
Fractions Fractions::multiply(Fractions &a);
Fractions Fractions::divide(Fractions ... | true |
26ef91562d167dd595d2febc4abd0745acfc6c06 | C++ | rkalyankumar/bplustree | /bplustree.cpp | UTF-8 | 18,139 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | /**
* Copyright 2014-15 Kalyankumar Ramaseshan
*
* 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 ... | true |
1ad6c1fc7cf4bf0e70ab4141e6130bd6ceb661f4 | C++ | chris3will/Learn_the_data_structure_in_a_stupid_way | /软件包/软件包/hash_table.h | GB18030 | 6,059 | 3.828125 | 4 | [] | no_license | #ifndef __HASH_TABLE_H__
#define __HASH_TABLE_H__
// ɢбģ
template <class ElemType, class KeyType>
class HashTable
{
protected:
// ɢбĵݳԱ:
ElemType *ht; // ɢб
bool *empty; // Ԫ
int m; // ɢб
int p; // ij
// ģ:
int H(KeyType key) const; // ɢкģ
int Collision(KeyType key, int i) co... | true |
04d11dfd09c19c99dc9f4c2518a9c0653ed3cf50 | C++ | aniketnk/scapegoatTree | /include/iterators.hpp | UTF-8 | 2,970 | 3.1875 | 3 | [] | no_license | #pragma once
#include "scapeGoatTree.hpp"
template <class T>
class scapeGoatTree<T>::Iterator
{
private:
Node<T> *node_it_, *root;
public:
using iterator_category = bidirectional_iterator_tag;
using value_type = T;
using difference_type = int;
using pointer = T *;
using reference = T &;
explicit Iterator(Node<... | true |
086137b2d8bc680484b3ddf7bcefd618cb17b6b1 | C++ | Borwe/PlayListPlayer | /handlers/handlers.h | UTF-8 | 2,707 | 3.296875 | 3 | [] | no_license | #ifndef HANDLERS_H
#define HANDLERS_H
#include <iostream>
#include <vector>
#include <string>
#include <boost/filesystem.hpp>
#include <map>
#include <memory>
#include <cassert>
#include <algorithm>
namespace Handlers
{
using FilePath=boost::filesystem::path;
using FilesVector=std::vector<boost::filesystem::p... | true |
847e955d2b50729cb8b5fd1c9f736932997301e0 | C++ | hushhw/LQOJ | /BASIC/BASIC-25 回形取数.cpp | GB18030 | 1,316 | 3.546875 | 4 | [] | no_license | /*
ȡؾıȡǰȡѾȡת90ȡһʼλھϽǣ¡
ʽ
һ200m, nʾкСmÿnʾ
ʽ
ֻһУmnΪȡõĽ֮һոָĩҪжĿո
3 3
1 2 3
4 5 6
7 8 9
1 4 7 8 9 6 3 2 5
3 2
1 2
3 4
5 6
1 3 5 6 4 2
*/
#include <iostream>
#include <string>
using namespace std;
int main(){
int m,n;
cin>>m>>n;
int a[201][201];
for(int i=0; i<m; i++){
for(int j... | true |
bd18fdc1a969b83e26696be3c01df9f67d154aac | C++ | Dakosia/Cpp | /Homework/OOP hw/InvoiceItem.h | UTF-8 | 421 | 2.765625 | 3 | [] | no_license | #pragma once
#include <string>
#include <iostream>
class InvoiceItem
{
private:
std::string id;
std::string desc;
int qty;
double unitPrice;
public:
InvoiceItem();
InvoiceItem(std::string, std::string, int, double);
~InvoiceItem();
std::string getID();
std::string getDesc();
int getQty();
void setQty(int);
... | true |
604de7c1fcd87bd9ed5de0076e28e749878a5820 | C++ | ksuzu46/atcoder | /abc148/c.cpp | UTF-8 | 279 | 2.59375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll gcd(ll a, ll b)
{
if(a % b == 0)
return b;
return gcd(b, a % b);
}
int main()
{
ll a, b;
cin >> a >> b;
ll res = (a * b) / gcd(a, b);
cout << res << "\n";
return 0;
}
| true |
765512d78f468332a753e1e40a2b85738c0aa65a | C++ | Ivanmartinezperez/nestmc-proto | /src/fvm_cell.hpp | UTF-8 | 22,402 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | #pragma once
#include <algorithm>
#include <iterator>
#include <map>
#include <set>
#include <string>
#include <vector>
#include <algorithms.hpp>
#include <cell.hpp>
#include <event_queue.hpp>
#include <ion.hpp>
#include <math.hpp>
#include <matrix.hpp>
#include <mechanism.hpp>
#include <mechanism_catalogue.hpp>
#inc... | true |
0f68c2e992c940ba5705ccbd789fd62cbf29ec01 | C++ | ENTRAE/pruebasC | /area_circ.cpp | WINDOWS-1250 | 414 | 3.140625 | 3 | [] | no_license | /* Programa: rea de una circunferencia (Solucin 1) */
#include <conio.h>
#include <stdio.h>
int main()
{
float area, radio;
printf( "\n Introduzca radio: " );
scanf( "%f", &radio );
area = 3.141592 * radio * radio;
printf( "\n El %crea de la circunferencia es: %.2f", 160, area );
print... | true |
55c4c6c57b3f28b98bf6720c521c04ccd54545ee | C++ | AnthonyJr/Misc-C-Programs | /l4p3.cpp | UTF-8 | 549 | 3.625 | 4 | [] | no_license | #include <iostream>
using namespace std;
double average(double& totAl, doublet& nog)
int main(){
int numOfGrades;
double grade, total;
total = 0;
cout << " hello, enter the number of grades: " << endl;
cin >> numOfGrades;
for (int i = 0; i < numOfGrades; i++){
cout << " enter a numeric grade 1-100: " << endl;
... | true |
3b15fceadd849b2c14a58e2306023e758b3e603c | C++ | G00nza/TP2 | /src/BaseDeDatos.h | UTF-8 | 12,634 | 3.046875 | 3 | [] | no_license | #ifndef _BASEDEDATOS_H
#define _BASEDEDATOS_H
#include "Registro.h"
#include "Restriccion.h"
#include "Tabla.h"
#include <utility>
#include <list>
#include <string>
#include <map>
#include "linear_map.h"
#include "linear_set.h"
#include "string_map.h"
#include "utils.h"
using namespace std;
/**
* @brief Una base ... | true |
06cf7f9f1addb6e55c76b4bc5e789d104a893b10 | C++ | danyfel80/pooAvancee | /TD6/POO-TD6/src/Fish.cpp | UTF-8 | 1,159 | 3.375 | 3 | [] | no_license | /*
* Fish.cpp
*
* Created on: Oct 31, 2018
* Author: daniel
*/
#include "Fish.h"
#include <sstream>
using namespace std;
Fish::Fish(string name, bool female, int x, int y, int depth) :
Animal(name, female, x, y) {
cout << "Fish: default constructor" << endl;
this->depth = depth;
}
Fish::Fish(const Fi... | true |
c0742c01d198d57e2005e10825df820a7e720b83 | C++ | doctorrokter/qdropbox | /src/qdropbox/QDropboxUpload.cpp | UTF-8 | 2,431 | 2.59375 | 3 | [] | no_license | /*
* QDropboxUpload.cpp
*
* Created on: Dec 27, 2017
* Author: doctorrokter
*/
#include "../../include/qdropbox/QDropboxUpload.hpp"
#include <QFile>
#include "../../include/qdropbox/QDropbox.hpp"
QDropboxUpload::QDropboxUpload(const QString& path, const QString& remotePath, QObject* parent) : QObject(paren... | true |
0549a30a2441b0992d05dec8b2811e0b7a9638b1 | C++ | fgolubic/Oblikovni | /Lab2.4/DistributionTester.cpp | UTF-8 | 750 | 3.1875 | 3 | [] | no_license | #include "DistributionTester.h"
#include<iostream>
#include<sstream>
#include <string>
DistributionTester::DistributionTester(std::initializer_list<int> percentiles):percentiles_(percentiles)
{
}
std::string printSequence(std::vector<int> const& distr)
{
std::ostringstream stream = std::ostringstream();
for (... | true |
704532b0a29f91c6dc855a4935a627b0dec03c01 | C++ | CODECITM/1010_Game | /1010_Game/CheckBox.h | UTF-8 | 2,819 | 3.0625 | 3 | [
"MIT"
] | permissive | #ifndef __CHECK_BOX__
#define __CHECK_BOX__
#include "Button.h"
struct SDL_Texture;
template <class Ret, class... Args>
class CheckBox : public Button<Ret, Args...>
{
public:
//Constructor
template<class Ret, class... Args> CheckBox(Ret(*action)(Args...), bool* value, fPoint center, SDL_Rect spriteList[3], SDL_Tex... | true |
1f9cfde860030c1218d38d519a73b0337e46d9a6 | C++ | mkvarner/mv2504740 | /Hmwk/Assignment 4/Indiv. Problems/Problem11/main.cpp | UTF-8 | 1,342 | 3.46875 | 3 | [] | no_license | /*
* File: main.cpp
* Author: Megan Varner
*
* Created on July 11, 2014, 8:43 PM
* Predict population growth
*/
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int organisms = 0.0;
int days_multiply = 0;
float increase = 0.0;
cout << "Ent... | true |
953016d8d0ce316b1457dbb160c126f9d8d36fe0 | C++ | TimeVShow/PAT | /1009.cpp | UTF-8 | 950 | 2.703125 | 3 | [] | no_license | #include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
typedef struct{
int num;
double sum;
}node;
node a[13];
node b[13];
double c[2003];
int n,m;
void input(){
scanf("%d",&n);
for(int i = 0;i < n;i++){
scanf("%d%lf",&a[i].num,&a[i].sum);
}
scanf("%d",&m);
f... | true |
24917e6246fbc72f2883fe3000e38ff30bc8d5c6 | C++ | Yash-YC/Source-Code-Plagiarism-Detection | /gcj/dataset/zuko92/5631989306621952/1/extracted/A.cpp | UTF-8 | 1,617 | 3.453125 | 3 | [] | no_license | #include <cstdio>
#include <cmath>
#include <vector>
#include <cstdlib>
#include <string>
struct node
{
char ch;
node* next;
};
void Print(node ** first)
{
if (*first == NULL)
{
return;
}
node * temp = *first;
while (temp->next != NULL)
{
printf("%c", temp->ch);
temp = temp->next;
}
printf("%c", temp-... | true |
0ee8ed26cc2402072a2b861b2e4e40bfd4af14a9 | C++ | kkemppi/TIE-courses | /Ohjelmointi 2/student/11/library_system/loan.cpp | UTF-8 | 1,257 | 3.09375 | 3 | [] | no_license | #include "loan.hh"
#include "library.hh"
#include "book.hh"
#include "person.hh"
#include "date.hh"
#include <map>
#include <iostream>
#include <memory>
#include <utility>
Loan::Loan(Date* today, Person *borrower_id,
Book *book_title, int renew_count):
due_date_(new Date(today->getDay(), today->getMonth... | true |
c3e4dc396be099dfca6846fbaf83945aa3474842 | C++ | aa0674118/HW5-2 | /6.37/source/main.cpp | UTF-8 | 308 | 3.078125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#define SIZE 3
int max(int a[], int n)
{
if (n == 1) { return a[0]; }
else
{
int x;
x = max(a, n - 1);
if (a[n-1] > x) { return a[n-1]; }
else { return x; }
}
}
int main()
{
int a[SIZE] = { 8,4,6};
printf("%d",max(a,SIZE));
system("pause");
return 0;
}
| true |
37f5745424748a7100965be9eff24ac95180d5b6 | C++ | MochHudda-TI-A-A2-1900106/UTS_DASAR_PEMROGRAMAN | /Bab 2/Tipecast.cpp | UTF-8 | 159 | 2.671875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
char Kar = '*';
cout << "Nilai ASCCI "<< Kar << " adalah " << (int) Kar << endl;
return 0;
} | true |
aa9327b32b35fe84db10afc689a6010c8a2d5b5b | C++ | iTXCode/Review | /Test/static/static.cc | UTF-8 | 449 | 3.265625 | 3 | [] | no_license | #include<iostream>
using namespace std;
class A{
public:
A(){
}
void Add(){
cout<<"Add()"<<endl;
}
static void Sum(){
cout<<A::i<<endl;
//cout<<A::a<<endl;//静态成员函数不能访问非静态的成员变量
//Add(); //不能调用非静态的成员函数
}
static int i;
private:
int a;
};
int A::i=1;
i... | true |
f6ffdc57620f98bc7ef2a819dc13c967bfd0510a | C++ | polluxlabs/ispyarduino | /v.07_i_spy.ino | UTF-8 | 12,802 | 2.75 | 3 | [] | no_license | long roundTime = 10000; // Time for player to find the color
// include the library code:
#include <LiquidCrystal_I2C.h>
// define pins for color sensor
#define S0 6
#define S1 7
#define S2 9
#define S3 8
#define sensorOut 10
long currentTime; //elapsed time in round
long startTime = millis(); //start time of round... | true |
5f76630d40cb680fc36eb4f4e382a219cac740a7 | C++ | ArgentumHeart/mipt-1st-term | /midterm-exam/08_ping.cpp | UTF-8 | 1,113 | 3.171875 | 3 | [] | no_license | #include <iostream>
const int MAX_N = 1001;
struct link {
int x,y;
int ping;
};
link arr[MAX_N] = {};
int max_ping;
int min_ping[MAX_N] = {};
int M, N;
void read_link(int index ) {
link temp = {};
std::cin >> temp.x >> temp.y >> temp.ping;
arr[index] = temp;
}
void step (int current) {
for ... | true |
41575e996ad9cf3e7a39a1116dbf5c94f91564c3 | C++ | u32744/Others | /C语言/20181123/1.cpp | GB18030 | 2,747 | 3.546875 | 4 | [] | no_license | #include <stdio.h>
#include <iostream>
using namespace std;
/*
bool xor(bool a,bool b);
bool find(int **matrix,int rows,int cols,int num);
bool xor(bool a,bool b){
return a&&!b || !a&&b;
}
bool find(int **matrix,int rows,int cols,int num)
{
if (!rows*cols)return false;//лΪ0
int x=rows-1,y=0;//½
if(*((int *)matri... | true |
03600de71e83c1c453f4b16b8ed132f05343ab84 | C++ | DavidHerel/PDV | /cv7/prob.cpp | UTF-8 | 5,688 | 2.96875 | 3 | [] | no_license | #include <chrono>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <immintrin.h>
#include <iostream>
// Pro ucely porovnani v nasem kodu pouzivame jednoduchou aproximaci
// funkce exp(x) - jak pro skalarni tak vektorizovanou verzi. Pokud
// byste chteli pouzit vyrazne presnejsi aproximaci, muzete vyuzit
... | true |
933f1ead18cd979f219c6b4da0af9e2cd4db3b65 | C++ | muon012/principlesAndPractices | /Chapter_4/exercise_7.cpp | UTF-8 | 2,579 | 4.46875 | 4 | [] | no_license | // Modify exercise 5 to accept spelled words as well as digits
// This program does not catch the errors.
#include<iostream>
#include<string>
#include<vector>
using std::cout;
using std::cin;
using std::endl;
using std::vector;
using std::string;
int return_digit(string s, vector<string> words){
for(int i = 0; i... | true |
a0e9fba6b08a3a31b55b0991642ebafc0f4021ae | C++ | pkuwangh/leetcode | /p122_best_time_to_trade_stock_2/best_time_to_trade_stock_2.cc | UTF-8 | 1,503 | 3.796875 | 4 | [] | no_license | /* Say you have an array for which the ith element is the price of a given stock on day i.
*
* Design an algorithm to find the maximum profit.
* You may complete as many transactions as you like
* (ie, buy one and sell one share of the stock multiple times).
* However, you may not engage in multiple transactions a... | true |
01298a4bda53b57a6a92d5f23be8506927a71781 | C++ | deskmel/online-judge-for-sjtu | /1206.cpp | UTF-8 | 969 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include <string.h>
using namespace std;
int stack[40000];
int stack1[40000];
int top1=-1,top2=-1;
char tmp[10000];
int main(int argc, char const *argv[])
{
for (int i=0;i<40000;i++)
stack[i]=-1;
bool flag=true;
while (cin>>tmp)
{
if (strcmp(tmp,"begin")==0)
{
stack[++top1]=0;
}
els... | true |
313d0510ce96f33f197415b8152229f9c83929db | C++ | CarlosBravo00/CPlusPlusProjects | /Deportivo/Cancha.h | UTF-8 | 1,733 | 3.25 | 3 | [] | no_license | #ifndef CANCHA_H_INCLUDED
#define CANCHA_H_INCLUDED
class Cancha:public Servicio{
public:
Cancha();
Cancha(double costo,int maxpers, string deporte, string clave, int tiempoMax,char tipo);
double getCostoXHr();
int getCantMaxPers();
string getDeporte();
void setCostoXHr(double costo);
void ... | true |