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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
d11c572a6dd9186be0b4bcc3bfd325c69e13cb15 | C++ | Ypostolov/Lafore_tasks | /ClasBookClient/ClasBookClient/ClasBookClient.cpp | UTF-8 | 2,200 | 3.640625 | 4 | [] | no_license |
class Book
{
char* booksName;
int booksIndex;
int abonentsIndex;
public:
Book()
{
booksName = "";
booksIndex = 0;
abonentsIndex = 0;
}
Book(char* inBooksName, int inBooksIndex)
{
booksName = inBooksName;
booksIndex = inBooksIndex;
abonent... | true |
82845ec0721f0aa7f67945e9918f428874ea39b0 | C++ | Jojendersie/Monolith | /tools/ComponentEditor/ComponentEditor/SceneManager.cpp | UTF-8 | 468 | 2.515625 | 3 | [] | no_license | #include "SceneManager.h"
SceneManager::SceneManager(QObject *parent):
QGLAbstractScene(parent),
m_rootNode(new QGLSceneNode(this))
{
}
SceneManager::~SceneManager(void)
{
delete m_rootNode;
}
QList<QObject *> SceneManager::objects() const
{
QList<QGLSceneNode *> children = m_rootNode->allChildren();
QL... | true |
a557d10d68e82c7bd5e9ea8ffb7eaa09c875b0a5 | C++ | Alaxe/noi2-ranking | /2019/solutions/A/NKM-VTarnovo/beatle.cpp | UTF-8 | 1,278 | 2.71875 | 3 | [] | no_license | #include <iostream>
using namespace std;
struct duska
{
int x;
int y;
int d;
};
duska k[10001];
int n,t,a[6001],maxy=0,br=0,p;
void init()
{
cin>>n;
for(int i=0;i<n;i++)
{
cin>>k[i].x>>k[i].y>>k[i].d;
if(k[i].y>maxy) maxy=k[i].y;
}
cin>>t;
for(int i=0;i<t;i++) cin>... | true |
3bc3801dbaa4f792bcb228b3381f948f2a9311c0 | C++ | Mrtony94/Smart-Home | /riego_probar/riego_probar.ino | UTF-8 | 748 | 2.671875 | 3 | [] | no_license | #define bomba 39
#define sensor_humedad A8
// cuanto mayor numero más seca estará la tierra
#define seco 700
void setup()
{
Serial.begin(9600);
pinMode(sensor_humedad, INPUT);
pinMode(bomba, OUTPUT);
}
void loop()
{
int SensorValue = analogRead(sensor_humedad); //coge una muestra de la humedad... | true |
d18b7d5e8419bf31c91aac3832ea18b259563b1b | C++ | gabriel-bri/ccufcqx | /3º semestre/Estruturas de dados avançada/codigos_professor/12_abril/avl.cpp | UTF-8 | 3,243 | 3.46875 | 3 | [] | no_license | #include <iostream>
#include "node.h"
#include "avl.h"
using namespace std;
// retorna a altura do nó.
// se a arvore for vazia ela tem altura 0
// caso contrario, retorna o valor que está no campo height
int avl_tree::height(Node *node) {
return (node == nullptr) ? 0 : node->height;
}
int avl_tree::balance(Node ... | true |
f2ff3c3d89e456be1267215d75d5cebde827c398 | C++ | Andrewpqc/pat_basic | /1049.cpp | UTF-8 | 416 | 3.0625 | 3 | [
"MIT"
] | permissive | /**
* 找规律 部分正确
**/
#include <iostream>
#include <iomanip>
using namespace std;
int main(void){
int count;
cin >> count;
float arr[count];
float sum = 0.0;
for (int i = 0; i < count; i++)
cin >> arr[i];
for (int i = 0; i < count; i++)
sum += arr[i] * (count - i) * (i + 1);
... | true |
888af103c6b0190a6b8887960643064f3589a8e4 | C++ | iblackcat/leetcode | /97_Interleaving_String.cpp | UTF-8 | 1,108 | 3.109375 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <stdlib.h>
bool isInterleave(char* s1, char* s2, char* s3) {
int len1 = strlen(s1);
int len2 = strlen(s2);
int len3 = strlen(s3);
if (len3 != len1+len2) return false;
bool *dp = (bool*)malloc(sizeof(bool)*(len1+1)*(len2+1... | true |
acc2cf7454d330fef5249daf624c63c7dd2d698d | C++ | RyanLebeau/UniOfWindsorWork | /YearThree/CPP/AOneRyanLebeau.cpp | UTF-8 | 642 | 3.375 | 3 | [] | no_license | /*
Ryan Lebeau
22/01/2018
Assignment One
COMP 3400
*/
#include <iostream>
#include <string>
using namespace std;
int main() {
string input;
bool inQuotes = false;
cout<<"Please enter a string:"<<endl;
getline(cin, input);
//loops through each character in the array
for(unsigned int i=0;i<input.length();i++){
... | true |
cc2fab6e3d2e0047eaa543dd4e76eb1cd5b41229 | C++ | brooksbp/snippets | /book.EOPI/5.2.cc | UTF-8 | 1,567 | 3.71875 | 4 | [] | no_license | // Write a function that takes an arithmetical expression in RPN
// and returns the number that the expression evaluates to.
// "3,4,*,1,2,+,+" -> "12,3,+" -> 15
// A,B,? where A and B are RPN expr and ? is an operation.
#include <iostream>
#include <string>
#include <stack>
using namespace std;
// My mistake was an... | true |
f3ab3bf6fa5b8818cf695caa3987342a66407f33 | C++ | ravi00ei51/cppos | /kernel/ipc/events/events.cpp | UTF-8 | 2,351 | 2.59375 | 3 | [] | no_license | #include "events.h"
#include "task.h"
#include "schedInfo.h"
events::events( void )
{
uint8_t i;
for( i = 0; i < MAX_NUMBER_OF_EVENT_NODES; i++ )
{
this->eventNodes[i].free = TRUE;
}
}
events::~events( void )
{
}
eventNodeType * events::eventAllocateEventNode( void )
{
uint8_t i;
even... | true |
e9d1990b9cb348d660d35407ad4a2546071ecf62 | C++ | Jeepee-Liu/cpp-course | /20160930/formatOutput/formatOutput.cpp | UTF-8 | 6,161 | 3.0625 | 3 | [] | no_license | #ifdef _FORMAT_OUTPUT_H
/********** public methods **********/
FormatOutput::FormatOutput() {
this->isFileDirSet = false;
this->dataSizeN[0] = 0;
this->dataSizeN[1] = 0;
} // Done & I don't know how to test it
bool FormatOutput::setFileDir(std::string dir) {
this->fileDir = dir;
std::ofstream fOut(dir);
if (!f... | true |
5168786a51742b2159c568996b5ef4e0ca8ffb8e | C++ | Sookmyung-Algos/2021algos | /algos_assignment/2nd_grade/최예헌_honi/week4/11650.cpp | UTF-8 | 484 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
struct num{
int x;
int y;
}v[100000];
bool compare(struct num a,struct num b){
if (a.x==b.x)
return a.y<b.y;
return a.x<b.x;
}
int main(){
cin.tie(0); cout.tie(0);
ios_base::sync_with_stdio(false);
int N;
cin>>... | true |
bc2a9386d069c482f559d3def14dac21cfce3a72 | C++ | boredomed/PhysicsEngine | /main.cpp | UTF-8 | 2,265 | 2.625 | 3 | [] | no_license | #include "SmartGL.h"
#include "Colors.h"
#include "Projectile.h"
#include "Momentum.h"
#include "Header.h"
#include "Fahad.h"
//MENU of simulations
class Simulations
: public Activity
{
ImageView background;
ImageView sim1, sim2, sim3, sim4;
Button Simulation1, Simulation2, Simulation3, Simulation4;
... | true |
f5a0f12550f5fe1695336ce2f7c62ac149b2c025 | C++ | mr-d-self-driving/HuskyControl | /husky_mpcc/src/types.h | UTF-8 | 2,633 | 2.625 | 3 | [] | no_license | // Define States of Husky
#ifndef MPCC_TYPES_H
#define MPCC_TYPES_H
#include "config.h"
namespace mpcc{
struct State{
double X;
double Y;
double th; // theta
double v; // linear velocity in x
double w; // angular velocity in z
double s;
double vs;
void setZero()
{
X = ... | true |
b1979b107deeb8c6af9679a3a4cd9ff1bfc0b39a | C++ | krishauser/KrisLibrary | /planning/KinodynamicPath.h | UTF-8 | 4,339 | 2.796875 | 3 | [] | permissive | #ifndef KINODYNAMIC_PATH_H
#define KINODYNAMIC_PATH_H
#include "EdgePlanner.h"
class KinodynamicSpace;
class ControlSpace;
class SteeringFunction;
typedef Vector State;
typedef Vector ControlInput;
/** @brief Stores a kinodynamic path with piecewise constant controls
*
* Must satisfy the property that milestones[i... | true |
b12a7c3d873c84019334b915fb93939111938f02 | C++ | Gavinxyj/Algorithm | /algorithm.cpp | GB18030 | 8,410 | 3.53125 | 4 | [] | no_license | #include<iostream>
#include<deque>
#include<math.h>
#include "algorithm.h"
template<class T>
Algorithm<T>::Algorithm()
{
}
template<class T>
Algorithm<T>::~Algorithm()
{
}
template<class T>
void Algorithm<T>::bubbleSort(T *array, int nLen, int (*fCompare)(const T *, const T *))
{
if(0 == ... | true |
30c45baa9f6d1ddede940c6425a42de049c2dd14 | C++ | prasoon16081994/CP-algorithmic-programming-database | /Code/WorkspaceB/C++ Files/CF/Practice/500_a.cpp | UTF-8 | 796 | 2.609375 | 3 | [] | no_license | /*input
8 4
1 2 1 2 1 2 1
*/
#include <bits/stdc++.h>
using namespace std;
#define ReadFile freopen("E:/Shreyans/Documents/Coding Workspace/STDINPUT.txt","r",stdin);
#define BoostIO ios_base::sync_with_stdio(false)
#define pii pair<int,int>
#define f first
#define s second
#define mp make_pair
#define endl '\n'
typede... | true |
609a29fc92ebb53d1f7227287096f5fbefc000ec | C++ | maxkidd/HonoursProject | /Classes/network_channel.h | UTF-8 | 1,436 | 2.875 | 3 | [
"MIT"
] | permissive | #ifndef _NETWORKCHANNEL_H_
#define _NETWORKCHANNEL_H_
#include <queue>
#include "network_message.h"
/**
Channel packet packs messages sent from the simulation layer
- Created from the connection packet
*/
class ChannelPacket
{
public:
// Serialize functions
template <typename Stream> bool Serialize(Stream& strea... | true |
f3ced3cb70d6da367e5a59f9c4a530b5914761b2 | C++ | Aman5613122/30-days-of-code | /Reverse vowels of a strting.cpp | UTF-8 | 936 | 3.296875 | 3 | [] | no_license | //leetcode questions
class Solution {
public:
string reverseVowels(string s) {
int i=0,l=s.size()-1;
char c[] = "aeiou";
bool ans=0;
while(i<l)
{
if(isVowel(s[i]) && isVowel(s[l]))
{
swap(s[i],s[l]);
l-... | true |
c62d39d402f301c3b2aacf9655f796aeb684bf17 | C++ | Andre2205p/Program-Grafica | /AlocacaoDinamicaArray_a/AlocacaoDinamicaArray/main.cpp | IBM852 | 1,114 | 3.609375 | 4 | [] | no_license | #include <iostream>
void func(int* ponteiro){
*ponteiro = 10;
std::cout << "ponteiro: " << *ponteiro << "\n";
}
void init(int * ptr, int tamanho){
int x,y, temp;
int * origem = ptr; //ponteiro para guardar a posiao inicial do ponteiro ptr
for( x = 0; x < tamanho; x++){
std::cout << "Digite um num... | true |
75897aa93e7b7d5e8831c66fbce6142d168aaed0 | C++ | coderdamin/PAT-Basic-Level-Practise | /C++/1019.cpp | GB18030 | 2,529 | 3.375 | 3 | [] | no_license | //
// һλֲȫͬ4λȰ4ְǵٰǵݼȻõ1ּ2֣õһµ֡
// һֱظǺܿͣСֺڶ֮Ƶ6174ҲKaprekar
// 磬Ǵ6767ʼõ
// 7766 - 6677 = 1089
// 9810 - 0189 = 9621
// 9621 - 1269 = 8352
// 8532 - 2358 = 6174
// 7641 - 1467 = 6174
// ... ...
// ָ4λдʾڶĹ̡
//ʽ
// һ(0, 10000)ڵN
//ʽ
// N4λȫȣһN - N = 0000ÿһһֱ6174Ϊ֣ʽעÿְ4λʽ
//1
//6767
//1
//7766 - 6677 = 1... | true |
eac3723770e01b5c605386134627487fcaf5c216 | C++ | ddurio/ProMage2 | /Engine/Code/Engine/Input/InputSystem.hpp | UTF-8 | 903 | 2.53125 | 3 | [] | no_license | #pragma once
#include "Engine/Core/EngineCommon.hpp"
#include "Engine/Input/Keyboard.hpp"
#include "Engine/Input/XboxController.hpp"
constexpr int MAX_CONTROLLERS = 4;
class WindowContext;
enum MouseEvent : int;
class InputSystem {
public:
void Startup( WindowContext* windowContext = nullptr );
void Shutdown... | true |
fb7696146c24c9d80d47b628c9bc30608ec4ab4a | C++ | smileHorse/C- | /ThinkingInC++/RTTI/CheckedCast/CatchBadCast.cpp | UTF-8 | 419 | 3.140625 | 3 | [] | no_license | #include <typeinfo>
#include "Security.h"
using namespace std;
int main() {
Metal m;
Security& s = m;
try {
Investment& c = dynamic_cast<Investment&>(s);
cout << "It's an Investment" << endl;
} catch(bad_cast&) {
cout << "s is not an Investment type" << endl;
}
try {
Bond& b = dynamic_cast<Bond&>(s);
c... | true |
929409a919469b5fb25792ff2725427199fb5231 | C++ | thegamer1907/Code_Analysis | /contest/1542538730.cpp | UTF-8 | 713 | 2.5625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin >> s;
char a = s[0];
char b = s[1];
int n;
string d;
vector < string > docs;
cin >> n;
bool check = 0;
for(int i = 0 ; i<n ; i++) {
cin >> d;
if(d ==... | true |
9b8d912041ba9607ef3d5bf11499abccefe3f958 | C++ | PacktPublishing/Beginning-Cpp-Programming | /Chapter02/calc.cpp | UTF-8 | 1,376 | 3.765625 | 4 | [
"MIT"
] | permissive | #include <iostream>
#include <string>
using namespace std;
void usage()
{
cout << endl;
cout << "calc arg1 op arg2" << endl;
cout << " arg1 and arg2 are the arguments" << endl;
cout << " op is an operator, one of + - / or *" << endl;
}
int main(int argc, char *argv[])
{
if (argc != 4)
{
... | true |
59cebabc55480d24b695223afb66ae1abf85276b | C++ | andre-jeon/cpp_pt2 | /Lesson 7/doWhileLoop.cpp | UTF-8 | 287 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main() {
int x = 5;
// do this
do {
// decreasing the value of x by 1
cout << x-- << endl;
}
// while x exsists
while (x);
string z;
getline(cin, z);
return 0;
} | true |
e24824c4c4182fcd18682a7c6ee42786307098f8 | C++ | tiandongpo/C-BasicSkill | /10.关联容器/2.9建立int和string的pair 赋值给vector/建立int和string的pair 赋值给vector/建立int和string的pair赋值给ector.cpp | GB18030 | 448 | 3.46875 | 3 | [] | no_license | #include<iostream>
#include<utility>//ʹеpair
#include<vector>
#include<string>
using namespace std;
int main()
{
pair<string,int> sipr;
string str;
int ival;
vector< pair<string,int> >pvec;
cout<<"enter a string and an iterget(ctrl+z to end):"<<endl;
while(cin>>str>>ival)
{
sipr = make_pair(str,ival);//pair
... | true |
d0ab0d9f76a332a0acc9cc6c09f17fe196568d53 | C++ | cardiffman/alloc | /gclisp.cpp | UTF-8 | 12,833 | 2.734375 | 3 | [
"MIT"
] | permissive | #include "alloc.h"
#include <stdio.h>
#include <iostream>
#include <vector>
#include <cstdlib>
#include <sstream>
#include <climits>
using std::cout;
using std::endl;
element Eval(element in);
extern element NIL;
/*element C(element s_exp){
return car(s_exp);
}*/
element interp_function(element ... | true |
68733ef6fff02a958412f9cdf46520dd9da32a6d | C++ | Alexbeast-CN/Notes2Cpp | /Notes/Functions/examples/arrfun1.cpp | UTF-8 | 625 | 4.03125 | 4 | [] | no_license | // arrfun1.cpp -- functions with an array argument
#include <iostream>
const int ArSize = 8;
int sum_arr(int arr[], int n); //prototype
int main(int argc, char const *argv[])
{
using namespace std;
int cookies[ArSize];
cout << "Please enter 8 numbers" << endl;
for (int i = 0; i < 8; i++)
... | true |
803c443197533851648ca96c96a7588feaf82528 | C++ | andrezszambrano/Taller1TP2 | /ControlaArchivo.cpp | UTF-8 | 3,803 | 2.65625 | 3 | [] | no_license | #include "ControlaArchivo.h"
#include "ManejaParticiones.h"
#include <iostream>
#include <utility>
#include <stdint.h>
#include <arpa/inet.h>
#include <cstdio>
#define ARCHIVO_INEXISTENTE -2
#define DOS_BYTES 2
#define UN_BYTE 1
#define CERO_BYTES 0
#define MAX_COLUMNAS 10
#define ERROR -1
#define EXITO 0
#define FIN_D... | true |
b13e142846487f040c6873092f9fb7ca799b5028 | C++ | Zandriy/NeHe_SDL | /src/Sample_03.h | UTF-8 | 601 | 2.640625 | 3 | [] | no_license | /*
* Sample_03.h
*
* Created on: Feb 21, 2013
* Author: Andrew Zhabura
*/
#ifndef Sample_03_H_
#define Sample_03_H_
#include "Sample.h"
class Sample_03 : public Sample
{
enum classConsts {
INIT_W = 640,
INIT_H = 480
};
public:
Sample_03();
virtual ~Sample_03();
virtual void reshape(int width, in... | true |
abd8d9212fb62efb3728696471952de9038baae0 | C++ | yeppymp/learn-cpp | /pyramid_if.cpp | UTF-8 | 912 | 2.984375 | 3 | [] | no_license | #include<iostream>
using namespace std;
main() {
int i, first_number;
for ( i = 5; i >= 1; i--) {
if (i == 5) {
for ( first_number = 1; first_number <= 5; first_number++ ) {
cout << i;
}
cout << endl;
} else if (i == 4) {
for ( first_number = 1; first_number <= 4; first_number++ ) {
... | true |
64bde189b9b333b988322d996f09ad33ae1cd638 | C++ | JordyLimaEng/computacao-grafica | /SDL2/Olá Mundo.cpp | ISO-8859-1 | 809 | 2.90625 | 3 | [] | no_license | #include <SDL2/SDL.h>
int main(int argc, char **argv)
{
//Inicializao
bool running = true;
//Gameloop
while(running)
{
///Logica
//Deteco de Evento
SDL_Event event;
while(SDL_PollEvent(&event))
{
switch(event.type)
{
case SDL_QUIT: //Caso saia
running = false;
break;
}
... | true |
65adab503a12a4fff6ac197c4c8cce3a319d55e8 | C++ | Gagerdude/raytracer | /models/RectangleXZ.h | UTF-8 | 635 | 2.5625 | 3 | [] | no_license | #ifndef RECTANGLEXZ_H
#define RECTANGLEXZ_H
#include "Model.h"
#include "Material.h"
#include "Ray.h"
#include "AxisAlignedBoundingBox.h"
class RectangleXZ: public Model{
public:
RectangleXZ();
RectangleXZ(double _x_min, double _x_max, double _z_min, double _z_max, double _y, Material* m);
... | true |
a4c58512d998dede50f51daccf16703ce809ce2b | C++ | diable201/Algorithms_and_Data_Structures | /informatics_2/matrix.cpp | UTF-8 | 837 | 2.828125 | 3 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int a[750][750];
int minimum[750], maximum[750];
int answer = 0;
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
cin >> a[i][j];
for (int i = 0; i < n; i++) {
minimum[i] ... | true |
30d36ed7b2f62e4b3c14b44ddb15ba2e924f809d | C++ | AvengineersVex/TowerTakeover-Competition-Code | /src/selector.cpp | UTF-8 | 2,432 | 2.953125 | 3 | [] | no_license | /*Notes
alliance variable:
0 - red
1 - blue
2 - skills
auton variable:
0 - purple
1 - gold
*/
#include "vex.h"
using namespace vex;
extern brain Brain;
extern brain::lcd Screen;
void pressedCallback();
void detectAlliance(int xPosIn, int yPosIn);
void autonSlector();
int gO... | true |
02ce36ad739ac35797fe599711b13ce52f0ef7cc | C++ | weijiaming2012/Cpp | /6-7.cc | UTF-8 | 502 | 3.640625 | 4 | [] | no_license | #include<iostream>
using namespace std;
void newLine();
void getInt(int& number);
int main()
{
int n;
getInt(n);
cout<<"Final value read in = "<<n<<endl
<<"End of demonstration.\n";
return 0;
}
void newLine()
{
char symbol;
do{
cin.get(symbol);
}while(symbol!='\n');
}
void getInt(int& number)
{
char ... | true |
1f37b21a87ff8a4c5b6da0b83963593f52514fdb | C++ | ia7ck/competitive-programming | /AtCoder/arc138/src/bin/a/main.cpp | UTF-8 | 1,068 | 2.515625 | 3 | [] | no_license | #include <cstdio>
#include <vector>
#include <tuple>
#include <algorithm>
#include "atcoder/segtree"
using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); (i)++)
int op(int a, int b) {
return max(a, b);
}
int e() {
return -1;
}
int main() {
int n, k;
scanf("%d%d", &n, &k);
vec... | true |
589c189d8b35246ea3de1b931f168897e139b645 | C++ | jonnylagos115/CIS22C | /lab01_JL/Currency.cpp | UTF-8 | 3,313 | 3.484375 | 3 | [] | no_license | // Implementation file for the Currency class
#include "Currency.hpp"
#include <iostream>
std::istream& operator>> (std::istream &in, Currency* &curr)
{
std::string note_n, coin_n;
int note_v, coin_v;
in >> note_n >> note_v >> coin_v >> coin_n;
if (note_n == "Dollar")
{
curr = new Dollar(note_n, note_v, coin_... | true |
3119d56ec989615ff6d0a17475ac06742520a7f8 | C++ | smeenai/llvm-project | /clang-tools-extra/test/clang-tidy/checkers/readability/braces-around-statements.cpp | UTF-8 | 15,037 | 2.84375 | 3 | [
"NCSA",
"LLVM-exception",
"Apache-2.0"
] | permissive | // RUN: %check_clang_tidy %s readability-braces-around-statements %t
void do_something(const char *) {}
bool cond(const char *) {
return false;
}
#define EMPTY_MACRO
#define EMPTY_MACRO_FUN()
void test() {
if (cond("if0") /*comment*/) do_something("same-line");
// CHECK-MESSAGES: :[[@LINE-1]]:31: warning: sta... | true |
256365ce9165b2208e368362b8f8ee5eb7c031d5 | C++ | Napol-Napol/Practice-algorithm | /plus.cpp | UTF-8 | 403 | 3 | 3 | [] | no_license | #include <iostream>
#include <string>
int res[11];
using namespace std;
void make(int n)
{
for (int i = 4; i <= n; i++)
res[i] = res[i-1] + res[i- 2] + res[i-3];
}
int main()
{
int cnt; string str = "";
cin >> cnt;
res[1] = 1; res[2] = 2; res[3] = 4;
for (int i = 0; i < cnt; i++)
{
int num... | true |
a117abbd4bb6658e00197f33aeb2131eac448b6a | C++ | blc1996/leetcode | /106.cpp | UTF-8 | 1,002 | 3.390625 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* buildTree(vector<int>& inorder, vector<int>& postorder) {
return helper(preor... | true |
bed4210a9d02eac77c2e7966f759837ff5f0249a | C++ | wangqinghe95/PAT-Code | /Advanced-C++/A1009.cpp | UTF-8 | 720 | 2.765625 | 3 | [] | no_license | #include<cstdio>
const int maxn = 2020; //前两个点过不了
double arr[maxn] = {0};
double mul[maxn] = {0};
int main()
{
int exp;
double coe;
int n;
scanf("%d",&n);
for(int i = 0; i < n; i++)
{
scanf("%d %lf",&exp,&coe);
arr[exp] = coe;
}
scanf("%d",&n);
for(int i = 0; i < n; i++)
{
scanf("%d %lf",&exp,&coe);
... | true |
b248b84ac957cefb3aaed261bacd32bd4eb571fb | C++ | lucianosz7/spoj-br | /MATRIZ2.cpp | UTF-8 | 492 | 3.078125 | 3 | [
"MIT"
] | permissive | /*
Resolucao:
Gerar uma matriz de acordo com a formula dada
e entao imprimir o valor da posicao a,b;
*/
#include <iostream>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
int a, b, p, q, n, r, s, x, y;
cin >> n;
cin >> p >> q >> r >> s >> x >> y;
cin >> a >> b... | true |
bca61b02506e8600395e7f4ba6d0140dc6509921 | C++ | HgScId/TFM | /TFM/ImgDatos.cpp | ISO-8859-1 | 33,340 | 3.109375 | 3 | [] | no_license | #include"ImgDatos.h"
#include<opencv2/core/core.hpp> // Libreras necesarias para usar OpenCV
#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
#include<assert.h>
#include<queue>
#include"EstructurasUsadas.h"
#define PI 3.141592653589793238463
imgDatos::imgDatos(cv::Mat& imagenRef, bool comp)... | true |
ce5ce78c67d9977447c53ffedbf4038d1d68ad53 | C++ | Smallsherlly/C-note | /day07/08notinher.cpp | UTF-8 | 388 | 3.125 | 3 | [] | no_license | #include <iostream>
using namespace std;
class A
{
private:
int m_a;
A(int a){m_a = a;}
A(const A& that){}
static A a;
public:
static A& getInstance()
{
return a;
}
void show()
{
cout << m_a << endl;;
}
friend class B;
};
A A::a(100);
class B:public A
{
public:
B(int a):A(a){}
};
int main()
{
A& a... | true |
b5c75ceb7ad5c6a932ec13c30e5b7b38723a4eee | C++ | CimpeanAndrei/Training | /Queue.c/main.cpp | UTF-8 | 1,253 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include "coada.h"
using namespace std;
int main()
{
coada Coada;
while(true)
{
int optiune;
int data;
cout<<"\n\n===============================\n";
cout<<"\t\tMENU\n";
cout<<"===============================\n";
cout<<"1. AfisCoada\n";
... | true |
88701eea0db2a087d6ca5fd5b39087cd87985122 | C++ | DuckMonster/SmallGame | /Game/src/Core/Standard/Array.h | UTF-8 | 7,684 | 3.5625 | 4 | [] | no_license | #pragma once
#include <cstring>
#include "Core/Memory/Allocator.h"
template<typename InType, typename InAllocator>
class ArrayBase
{
template<typename InOtherType, typename InOtherAllocator>
friend class ArrayBase;
public:
class Iterator
{
public:
Iterator(InType* data, uint32 index = 0) :
data(data), index... | true |
4345dd2376ad544babc20334a13f15d5c93ffde9 | C++ | ThatRadChad/BellingerChad_CIS_5_Fall2017 | /Homework/Assignment_2/Gaddis_8thEd_Chap3_Prob2_StadiumSeating/main.cpp | UTF-8 | 1,348 | 3.78125 | 4 | [] | no_license | /*
* File: main.cpp
* Author: Chad Bellinger
* Created on September 14, 2017, 2:12 PM
* Purpose: Stadium Seating
*/
//System Libraries
#include <iostream> //Input/Output Stream Library
#include <cmath>
using namespace std; //Standard Name-space under which System Libraries reside
//User Libraries
//Glob... | true |
175e42e117030141cde0043eb1341b439f6826eb | C++ | AndreyKulish/arduino | /main/sasha/Svarka/_4/_4.ino | UTF-8 | 797 | 2.65625 | 3 | [] | no_license | boolean flag = true;
void setup() {
pinMode(4,INPUT);
pinMode(5,INPUT);
pinMode(6,OUTPUT);
digitalWrite(6,LOW);
}
void loop() {
for ( int x = 0; x < 100; x++){
work();
}
delay(5000);// если нужно убрать паузу, удали это
}
void work(){
for( int i = 0; i < 5; i++){
if(digitalRead(5) == HIGH){
... | true |
8eacfd845fea26971f598d91a0772af71c731816 | C++ | perewodchik/contests | /#1/E/E.cpp | WINDOWS-1251 | 319 | 3.1875 | 3 | [] | no_license | #include <iostream>
using namespace std;
/* A B*/
int main()
{
int a,b;
int max;
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
cin >> a >> b;
if (a>b)
{
max = a;
}
else
{
max = b;
}
cout << max;
}
| true |
db890410504085c80b26de2d1a7e15bbf7771ed4 | C++ | IKholopov/shishkin_forest | /IR/Expressions/Temp.cpp | UTF-8 | 673 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | #include "Temp.h"
namespace IR {
namespace {
static int counter = 0;
}
Temp::Temp(std::string name, const Coords& coords, int uniqueId) :
Id(counter++),
localId(0),
name(name),
info(AI_Name),
unique(uniqueId != -1),
coords(coords)
{
if(unique) {
Id = uniqueId;
localId = u... | true |
75566206aa363336ff66b7bdac7a815bd52d521e | C++ | manohar2000/DSA_450 | /Graphs/CreatingaGraph.cpp | UTF-8 | 988 | 3.375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
template<typename T>
class Graph
{
public:
map<T, vector< pair<T,int> > > adjList;
void addNode(T a, T b,int weight, bool bidirec=false)
{
adjList[a].push_back(make_pair(b,weight));
if(bidirec) adjList[b].push_back(make_... | true |
38f85108aabf519b72db0d1ea318ffbe9dc3351b | C++ | pkchen1129/Cpp_interview | /k_in_a_group.cpp | UTF-8 | 1,334 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
bool distance_smaller_k (vector<int> p1, vector<int> p2, int k) {
double distance = (p1[0] - p2[0])*(p1[0] - p2[0]) + (p1[1] - p2[1])*(p1[1] - p2[1]) + (p1[2] - p2[2])*(p1[2] - p2[2]);
return distance <= k*k;
}
void graph_DFS (vec... | true |
2a952711805b1dd27c49793804d4c7b904bf67c1 | C++ | pawelskrzy/auto_diff | /AD.h | UTF-8 | 2,941 | 2.875 | 3 | [] | no_license | #pragma once
#include <boost/numeric/ublas/matrix.hpp>
#include <map>
#include <vector>
#include <memory>
#include <iostream>
#include <atomic>
#include <boost/container/flat_map.hpp>
namespace AD {
class ResultType
{
public:
typedef boost::numeric::ublas::matrix<float> matrix;
private:
public:
float m_c... | true |
49f46436af59e00eb0b71e7067986688f82770e8 | C++ | Nimor111/LuaCode | /src/ast/parser/parser.cc | UTF-8 | 6,807 | 3.078125 | 3 | [
"Apache-2.0"
] | permissive | #include "../../../include/parser/parser.h"
Parser::Parser(std::vector<Token> tokens)
: tokens_(tokens)
, at_(0)
{
}
std::vector<Stmt*> Parser::Parse()
{
try {
std::vector<Stmt*> statements;
while (!End()) {
statements.push_back(Declaration());
}
return stateme... | true |
58edb70c7308bf4f9b63867beddfe98a0d12d8cc | C++ | gdding/MARC | /src/utils/Utility.cpp | GB18030 | 7,927 | 2.671875 | 3 | [] | no_license | #include "Utility.h"
#include "kbhit.h"
#include "DirScanner.h"
#include "AppRunner.h"
bool Exec(const char* cmd)
{
return Exec(cmd, -1);
}
bool Exec(const char* cmd, int nTimeout)
{
string sCommand(cmd);
#if !RUN_APP_WITH_FORK
int nCmdRet = system(sCommand.c_str());
return true;
#else
CAppRunner runner;
time_... | true |
591315c128e82b645e64cba07b46da9f79b8611e | C++ | JakKopec/Algorithms-data-structures-and-numerical-methods | /Numerical-methods/Interpolacja Lagrangea/InterpolacjaLagrangea.cpp | UTF-8 | 1,894 | 3.203125 | 3 | [] | no_license | #include<iostream>
#include<fstream>
#include<string>
#include<stdlib.h>
using namespace std;
void interpolacja_lagrangea(void)
{
fstream file;
file.open("InterpolacjaLagrangea.txt",ios::in);
if(file.good()==false)
{cout<<"Blad pliku tekstowego!\n";}
string temp;
int ilosc_wezlow;
file>>i... | true |
1bb4295dea32aaa1a82f031b0e0b7d73ab54584a | C++ | stankogavric/Snake | /main.cpp | UTF-8 | 15,364 | 3.1875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <ctime>
#include <SDL2/SDL.h> // Glavna SDL biblioteka
#include <SDL2/SDL_ttf.h> // SDL biblioteka za prikaz teksta
using namespace std;
void renderPlayer(SDL_Renderer* renderer, SDL_Rect player, int x, int y, int scale, vector<int> tailX, vector<int> t... | true |
0dcf0ca78f0355017a4d07c5b78c27593552aaf3 | C++ | TheNsBhasin/CodeChef | /LUCKY5/main.cpp | UTF-8 | 328 | 2.765625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int t;
string str;
cin>>t;
while(t--)
{
cin>>str;
int counter=0;
for(int i=0;str[i];i++)
{
if(str[i]!='4' && str[i]!='7')
counter++;
}
cout<<counter<<endl;
}
retu... | true |
013b2ac91588245d80059d27fb38a1114d4dc68f | C++ | liangliangdeveloper/PTA_B_Problems | /B1014.cpp | UTF-8 | 1,160 | 2.828125 | 3 | [] | no_license | #include<stdio.h>
#include<string.h>
using namespace std;
char S1[100],S2[100],S3[100],S4[100];
int min(int a,int b){
if(a<b) return a;
return b;
}
int main(){
scanf("%s", S1);
scanf("%s", S2);
scanf("%s", S3);
scanf("%s", S4);
int len1 = min(strlen(S1),strlen(S2));
int len2 = min(strlen(S3),strlen(S4));
... | true |
8d4c92ff5e5dba3188af51ce8c04294fe062a7f4 | C++ | jpd002/Play--Framework | /src/layout/LayoutBaseItem.cpp | UTF-8 | 1,125 | 2.5625 | 3 | [
"BSD-2-Clause"
] | permissive | #include "layout/LayoutBaseItem.h"
using namespace Framework;
CLayoutBaseItem::CLayoutBaseItem(unsigned int preferredSize, unsigned stretch, const LayoutObjectPtr& object)
: m_preferredSize(preferredSize)
, m_stretch(stretch)
, m_object(object)
, m_key(-1)
{
SetRange(0, 0);
}
CLayoutBaseItem::CLayoutBa... | true |
e75749ef9a7a444d89868c9c5937836ca15473e2 | C++ | ZoranPandovski/al-go-rithms | /dp/Count_balanced_binarytree/cpp/balanced_trees.cpp | UTF-8 | 526 | 3.015625 | 3 | [
"CC0-1.0"
] | permissive |
// binary trees of height h.
#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
long long int countBT(int h) {
long long int dp[h + 1];
//base cases
dp[0] = dp[1] = 1;
for(int i = 2; i <= h; i++) {
dp[i] = (dp[i - 1] * ((2 * dp [i - 2])%mod + dp[i - 1])%mo... | true |
3fb3485b582482db8d3217c3c85943097ede0047 | C++ | lianvk/matrix_multiplication | /par1/par0/par0/par0/Source.cpp | UTF-8 | 788 | 3.21875 | 3 | [] | no_license | //#include <stdlib.h>
#include <chrono>
#include <iostream>
#define N 1000
void main()
{
typedef float elemtype;
static elemtype a[N][N];
static elemtype b[N][N];
static elemtype c[N][N];
for (int j1 = 0; j1 < N; j1++)
{
for (int j2 = 0; j2 < N; j2++)
{
a[j1][j2] = elemtype(rand());
b[j1][j2] = elemtyp... | true |
bfe79c3dab9594c32dad9c0e2225fd4d09c9f0d6 | C++ | jarble/transpiler | /translated_functions/cpp/prolog.cpp | UTF-8 | 2,149 | 3.390625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <vector>
#include <math.h>
namespace C_sharp{
namespace Convert{
template <class T> std::string ToString(T a){
return std::to_string(a);
}
}
}
namespace Python {
template <class T> void print(T a) {
std::cout << a << "\n";
}
template <class T> int abs(T a){
return st... | true |
fc80e95470c0feb7b12bdfd6a2e6a893e68f9ab8 | C++ | luqmanarifin/cp | /0-unclassified/lauk.cpp | UTF-8 | 882 | 2.71875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
map<string, int> num;
vector<string> parse(string s) {
vector<string> ret;
for(int i = 0; i < s.size(); ) {
while(s[i] == ' ' && i < s.size()) i++;
int j = i;
while(s[j] != '+' && j < s.size()) j++;
int to = j + 1;
j--;
while(s[j] == ' ' && j ... | true |
377dbf7db31f68044d61d07981bbff331c3a2dea | C++ | jasha64/jasha64 | /2012/day8(5-12)/图案与数字的结合.cpp | GB18030 | 315 | 2.828125 | 3 | [
"MIT"
] | permissive | //nӦͼ
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int N,i,j;
cin>>N;
for (i=1;i<=N;i++)
{
for (j=1;j<=N-i;j++) cout<<" ";
for (j=1;j<=2*i-1;j++) cout<<"*";
cout<<endl;
}
system("pause");
return 0;
}
| true |
c2a5270978f44342c5f38525f4e10ccaab5d9702 | C++ | Oneinone/SteveBase | /SteveBase/include/utility/PowerDraw.hpp | UTF-8 | 8,941 | 2.578125 | 3 | [
"MIT"
] | permissive | #pragma once
#include <misc/TypeAliases.hpp>
#include <vendor/imgui/imgui.h>
namespace SteveBase::Utility {
using namespace Misc;
struct PowerDraw {
struct StyleVar {
template<class Fn>
constexpr FORCEINLINE StyleVar(Fn &&fn, ImGuiStyleVar idx, float val) {
... | true |
b26ecf279fe85b342c3349df9059f3dd97162c32 | C++ | jxygzzy/Luogu | /P1111 修复公路.cpp | UTF-8 | 866 | 2.515625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int Set[1005];
struct code{
int x,y,z;
}codes[100005];
bool cmp(code a,code b)
{
return a.z<b.z;
}
int Find(int x){
return (Set[x]==x) ? x : (Set[x] = Find(Set[x]));
}
void Init(int cnt) { // 初始化并查集,cnt 是元素个数
for (int i=1; i<=cnt; i++)
Set[i]=i;
}
int... | true |
9ce15e59c9182a21bcb100f33f8a1586781c1070 | C++ | GuoZhiyong/OBD-II | /src/Adapter/helloworld/src/adapter/ecumsg.cpp | UTF-8 | 7,316 | 2.859375 | 3 | [] | no_license | /**
* See the file LICENSE for redistribution information.
*
* Copyright (c) 2009-2016 ObdDiag.Net. All rights reserved.
*
*/
#include <adapter_inc/adaptertypes.h>
#include <adapter_inc/ecumsg.h>
#include <utility_inc/algorithms.h>
using namespace util;
const int HEADER_SIZE = 3;
class EcumsgISO9141 : public E... | true |
08a85ff962655675e97e31d3db936a62373f82c0 | C++ | thomaslee0131/competitive-programming | /leetcode/weekly_162/1252.cpp | UTF-8 | 616 | 2.859375 | 3 | [] | no_license | class Solution {
public:
int cnt[50][50];
void add(int r, int c, int n, int m){
for(int i=0;i<n;i++){
cnt[i][c]++;
}
for(int i=0;i<m;i++){
cnt[r][i]++;
}
}
int oddCells(int n, int m, vector<vector<int>>& inds) {
for(auto& ind: inds){
... | true |
7688da6bb809cf622f1f3ecaa8160de015f1807f | C++ | kjlau0112/ringfile | /src/varint.cc | UTF-8 | 1,012 | 2.640625 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright (c) 2014 Ross Kinder. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "varint.h"
#include <math.h>
int Varint::Read(const void * buffer) {
value_ = 0;
for (int shift = 0; shift < 10; ++shift) {
uint8_t byte = *(... | true |
0964c8f149aa8a7a95767c9f287efb47d96eaa89 | C++ | RishabhDevbanshi/C-Codes | /Inverse-Number.cpp | UTF-8 | 693 | 3.125 | 3 | [] | no_license | //Problem Link : https://www.youtube.com/watch?v=dbk42TKwk4M
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ll n;
cin>>n;
string str = to_string(n); //int to string
vector<int> v;
for(char a : str)
{
int x = (int)a - 48; //char with numbers to int
... | true |
e16cd4c6c344ae836865cf5a6eeea9c3acb0414e | C++ | tomsksoft-llc/cis1-core-native | /include/os_interface.h | UTF-8 | 4,550 | 3.0625 | 3 | [
"MIT"
] | permissive | /*
* TomskSoft CIS1 Core
*
* (c) 2019 TomskSoft LLC
* (c) Mokin Innokentiy [mia@tomsksoft.com]
*
*/
#pragma once
#include <filesystem>
#include <string>
#include <memory>
#include <istream>
#include <boost/process.hpp>
#include "ifstream_interface.h"
#include "ofstream_interface.h"
#include "fs_entry_i... | true |
5d1f0597ce802d2f023c6de9f88e2286602f78c1 | C++ | areebbeigh/CompetitiveProgramming | /HackerEarth/magical_word.cpp | UTF-8 | 1,191 | 3.25 | 3 | [] | no_license | // https://www.hackerearth.com/practice/basic-programming/input-output/basics-of-input-output/practice-problems/algorithm/magical-word/
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
using namespace std;
bool isPrime(const int &n) {
if (n == 2) return true;
if (n == 1) return false;
... | true |
f92ecc18a0bd17e078113aed6fea1b069849f71d | C++ | johnsonjx/code_examples | /hello_world_josh.cpp | UTF-8 | 349 | 2.546875 | 3 | [] | no_license | /*I love creativity, art, and learning new things!
It's honestly super dope. I hope I can continue to grow and improve.*/
//Hmmm, these comments are getting lengthy. I should progress.
#include <iostream>
int main()
{
std::cout << "Hello, Uncle Jeremiah! Say, what's with this funny tasting driNkFKdsofads0[fsd......... | true |
ceae233ceee141bf19eca27246a0e93447bc5c91 | C++ | Metalhead33-Foundation/Haruka-Engine-GL-Reference | /audio/AudioPositioner.cpp | UTF-8 | 1,129 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | #include "AudioPositioner.hpp"
namespace Audio {
Positioner::Positioner(const sSource src)
: panner(Audio::PositionalPanner::createPositionPanner()),
unit(Unit::create(src))
{
panner->setInput(unit);
}
Positioner::Positioner(const Positioner& cpy, const sSource src)
: panner(Audio::PositionalPanner::createPositi... | true |
e84e0849d8b7ae8397a2e107c4c8e92f12adf977 | C++ | carlaMorral/raytracing-f01-1 | /Geometry/Triangle.cpp | UTF-8 | 2,054 | 3.09375 | 3 | [
"Apache-2.0"
] | permissive | #include "Triangle.h"
#include <iostream>
Triangle::Triangle(vec3 p1, vec3 p2, vec3 p3, float data) :Object(data) {
this->p1 = p1;
this->p2 = p2;
this->p3 = p3;
// Pla que conte el triangle
vec3 w = p3 - p2;
vec3 v = p2 - p1;
this->n = cross(w,v)/length(cross(w,v));
this->plane = mak... | true |
b33350ff58e9b6b7f6b875d076515398d9a9ccf8 | C++ | mberg-ConU/MBProjects2021 | /Graph_Proj/DGraph.h | UTF-8 | 993 | 2.984375 | 3 | [] | no_license | // M. Bergeron
// E. Bouskila
// DGraph.h
#ifndef DGRAPH_H
#define DGRAPH_H
#include <string>
#include "Graph.h"
#include <vector>
// definition of derived class DGraph
class DGraph : public Graph
{
private:
virtual void display(Person&, vector<bool>&); // private recursive function used in display functions
pub... | true |
3d4b039b1490ab407d46e2ccd70ca3af1f39ea9e | C++ | oroko123/JNPI | /zadanie6/rozwiazanie/helper.h | UTF-8 | 2,157 | 3.21875 | 3 | [] | no_license | #ifndef HELPER_H
#define HELPER_H
#include <string>
using Age = unsigned int;
using HealthPoints = unsigned int;
using AttackPower = unsigned int;
using Time = unsigned int;
class Status {
std::string monsName;
HealthPoints monsHealth;
size_t aliveCitizens;
public:
Status(const std::string &monsName,... | true |
34a48419e735841f60ffd6d9462b29af61712459 | C++ | punzoamh/C-Code | /inkisthw8_punzo.h | UTF-8 | 8,097 | 3.75 | 4 | [] | no_license | /**
CS219_HW4
inkisthw8__punzo.h
Purpose: Header File for linked list
@author Antonio M.H. Punzo
@version 1.0 5/5/2015
Compiled using g++ -o hw9 -Wall -Wextra CS219_Punzo/hw9/inkisthw8_punzo.h
*/
/**
* This header file will create the struct node,
* ->and class inkist for the program
* inkist wi... | true |
08a5b8538cbef74a9cf9bf453604e44b694b4d94 | C++ | pivovard/ZCU | /UPS/UPS_Scrabble_server-master/Game.h | UTF-8 | 784 | 2.59375 | 3 | [] | no_license | //
// Created by pivov on 25-Dec-16.
//
#ifndef UPS_SCRABBLE_SERVER_GAME_H
#define UPS_SCRABBLE_SERVER_GAME_H
#include "stdafx.h"
#include "Player.h"
class Game
{
public:
int id;
char matrix[15][15];
int PlayerCount;
int PlayerNext;
int PlayerOnTurn;
int PlayerDisconnected;
vector<Pl... | true |
ee8cd975e136682ebcd95d6731a09db86c7f3e87 | C++ | Flare-k/Programming | /자료구조/Project(part.2)/장서진_2017102832/프로젝트1/Application.h | UHC | 3,432 | 2.890625 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <windows.h>
#include "BestSorted.h"
#include "BestType.h"
#include "LyricList.h"
#include "LyricType.h"
#include "MusicSorted.h"
#include "MusicType.h"
#include "PlayQueue.h"
#include "PlayType.h"
#define ... | true |
d0565d90121587e4085411ec946302eecbef2c5f | C++ | srpatel/spellsmith | /Classes/ClickMe.cpp | UTF-8 | 1,492 | 2.546875 | 3 | [
"MIT"
] | permissive | //
// ClickMe.cpp
// Gems
//
// Created by Sunil Patel on 03/12/2017.
//
#include "ClickMe.hpp"
bool ClickMe::init(bool big) {
if ( !Layer::init() ) {
return false;
}
// Circles...
auto circle1 = LoadSprite("ui/circle.png");
circle1->setAnchorPoint(Vec2(0.5, 0.5));
addChild(circle1);
// auto circle2 = ... | true |
f5a59d12370252ba8ebb4a647936038e9fdf9966 | C++ | dibolek/TaskMan | /datastorage.cpp | UTF-8 | 4,324 | 3.09375 | 3 | [] | no_license | #include "datastorage.h"
DataStorage::DataStorage()
{
}
void DataStorage::userDataExport(User &usr)
{
vector<Event *> tmp = usr.getEventsVector();
Date datetime;
ofstream plik( usr.getFileName().c_str() );
plik << tmp.size() << endl
<< usr.getUserID() << endl
<< usr.getUserName() <<... | true |
4cbf468f1afb5f01bd955ad97059d9e38252753b | C++ | marc-hanheide/cogx | /scenarios/george/trunk/src/c++/components/Testing/statemachine.hpp | UTF-8 | 8,881 | 2.5625 | 3 | [] | no_license | /**
* @author Marko Mahnič
* @created April 2012
*/
#ifndef _TESTING_STATEMACHINE_HPP_4F7967EF_
#define _TESTING_STATEMACHINE_HPP_4F7967EF_
#include <castutils/Timers.hpp>
#include <cassert>
#include <stdexcept>
#include <memory>
#include <string>
#include <sstream>
#include <map>
#include <functional>
#include <m... | true |
3adec608fe6b88b6df8588ea3dde82d6a551779f | C++ | EliasJadon/MeshPlane | /src/mat.cpp | UTF-8 | 6,411 | 2.65625 | 3 | [] | no_license | #include "mat.hpp"
#include "string.h"
#include <stdlib.h>
void Mat3::h_pivot_decomp(int *p, int *q) {
int i,j,k;
int n=DIM;
int pi,pj,tmp;
real_t max;
real_t ftmp;
for (k=0; k<n; k++) {
pi=-1,pj=-1,max=0.0;
//find pivot in submatrix a(k:n,k:n)
for (i=k; i<n; i++) {
for (j=k; j<n; j++) {
... | true |
3fb012fc5be32caf52ba879887f1568eabdc2cd0 | C++ | TheOctan/Labs-in-cpp | /Basics of programming/Laba №9/Task 7/Task 7.cpp | UTF-8 | 358 | 3.3125 | 3 | [] | no_license | #include <iostream>
using namespace std;
void matrix(int side, char x)
{
for (int i = 0; i < side; i++)
{
for (int i = 0; i < side; i++)
{
cout << x << " ";
}
cout << endl;
}
}
int main()
{
int side; char x;
cout << "Input side the matrix "; cin >> side;
cout << "Input a simbol "; cin >> x;
matrix(si... | true |
3d7492e2262dc6dbfbc18828a5381d33e97b729b | C++ | CBE7F1F65/bc38ca3dff4f1fc5a94a5450ba9806c6 | /DES_GOBSTG/DES_GOBSTG/Header/VectorList.h | UTF-8 | 5,048 | 3.15625 | 3 | [] | no_license | #ifndef _VECTORLIST_H
#define _VECTORLIST_H
#include <windows.h>
#define VECLST_INDEXERROR 0xffffffff
template <class _Ty>
class VectorList
{
typedef VectorList<_Ty> _Myt;
public:
VectorList()
{
item = NULL;
valid = NULL;
}
VectorList(DWORD count)
{
item = NULL;
valid = NULL;
i... | true |
2565116f236558a07d30646cb8ecad138a8925c1 | C++ | shanta3220/UVA-Solutions | /Problems-solved-using-Queue/11034 - Ferry Loading IV.cpp | UTF-8 | 1,037 | 2.71875 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<queue>
using namespace std;
int main()
{
int t,l,m,size,i,sum,count;
string side;
bool true1;
queue<int> left;
queue<int> right;
cin>>t;
for (int j = 0; j < t; j++){
cin>>l>>m;
for(i=0; i<m; i++){
cin>>size>>side;
... | true |
ab4667216acdff5fef0b448e73a8ee67ff930b96 | C++ | Shtaiven/NailArt | /qip_win/MP/header/Matrix4.h | UTF-8 | 4,098 | 2.984375 | 3 | [] | no_license | // ======================================================================
// IMPROC: Image Processing Software Package
// Copyright (C) 2015 by George Wolberg
//
// Matrix4.h - 4x4 matrix class.
//
// Written by: George Wolberg and Gene Yu, 2015
// ======================================================================
... | true |
ff94eda02307a34dd167e50ff2026c5d090ce416 | C++ | vietjtnguyen/ucla-winter09-cs174a-opengl-engine | /Composite2Animator.h | UTF-8 | 694 | 3 | 3 | [] | no_license | #ifndef COMPOSITE_2_ANIMATOR_H
#define COMPOSITE_2_ANIMATOR_H
#include "Animator.h"
template <class T>
class Composite2 : public Animator< Vector2<T> >
{
public:
Composite2(Animator<T> a, Animator<T> b)
:Animator< Vector2<T> >()
,_a(a)
,_b(b)
{
}
virtual ~Composite2()
{
}
vir... | true |
83d07427ccc04bc8d8b2efe9120788d4d9ea49f6 | C++ | zhenghello/QTobj | /d190104_sshCan/Anyone/youLib/FtreeDateBase/timeSeqExplain.cpp | GB18030 | 5,397 | 2.640625 | 3 | [] | no_license | /* ļڽʱĹ
* ʱЭ timeSeq_TreeDb.dat УѾ̶
* ʱЭĴŹ
* item 1.ؼ֣2.
* itemŲݣǴitemĸûвûࣩ
* itemݣ1.գ2. 3.ͣ1ͨ 2ַƥݣƥ
* δitemݣ1.գ2.ΪƥʱIJؼ֣3.ؼֽ
* δδitem
*
*/
#include "timeSeqExplain.h"
#include <QFile>
#include<QDebug>
// timeSeq ļĹ̶
timeSeqExplain::timeSeqExplain(QWidget *parent):FtreeDabeBase(parent,"timeSeq")
{
}
// Э
// s... | true |
3ebee2fd9a1cef48721d8c8883a9f17a9fac7899 | C++ | jamesbertel/CS-311 | /CS311Progs/DemoPrograms/matrixVectorDemo.cpp | UTF-8 | 960 | 3.75 | 4 | [] | no_license | // CS311 Yoshii - matrix-vector demo
// Demonstrates a matrix containing a vector of chars
// in each slot.
// --------------------------------------------------------
#include <iostream>
#include <vector>
using namespace std;
void displayAll(vector<char> V)
{ cout << "[";
for (int i = 0; i < V.size(); i++)
cout ... | true |
fb894d73fcb59e577778acf6c82a0db240accba4 | C++ | NuriYuri/LiteRGSS | /ext/LiteRGSS/CShape_Element.h | UTF-8 | 1,414 | 2.546875 | 3 | [] | no_license | #ifndef CShape_Element_H
#define CShape_Element_H
#include <memory>
#include "ruby.h"
#include "CDrawable_Element.h"
class CShape_Element : public CDrawable_Element {
protected:
std::unique_ptr<sf::Shape> shape;
bool visible = true;
sf::RenderStates* render_states = nullptr;
public:
CShape_Element() = default;
vi... | true |
61cab354b67de35ee33beeaedf59e06dfb03a6df | C++ | AbhayaV2001/ADA_1bm18cs001 | /median_msort.cpp | UTF-8 | 1,236 | 3.5625 | 4 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
float median(int a[], int n)
{
if (n % 2 == 0)
return (float)(a[n / 2] + a[(n / 2 )- 1]) / 2;
else
return a[n / 2];
}
float findMedian(int a1[], int a2[], int n)
{
if (n <= 0)
return -1;
if (n == 1)
... | true |
addcb83f01b584736c64cfe60349f4e27a6c8cce | C++ | colinblack/game_server | /server/app/data/HeroPropertyManager.h | UTF-8 | 11,969 | 2.703125 | 3 | [] | no_license | /*
* HeroPropertyManager.h
*
* Created on: 2016-9-2
* Author: Ralf
*/
#ifndef HEROPROPERTYMANAGER_H_
#define HEROPROPERTYMANAGER_H_
#include "Kernel.h"
class HeroFightAttr
{
public:
HeroFightAttr();
void Clear();
void SetAttr(DemoHeroProperty attr, int val);
void AddAttr(DemoHeroProperty attr, int ... | true |
09b0a6306cb5ecb115c30ea3a37e2beba2d23543 | C++ | BigRoss/stickmanGame | /Stage2BaseCodeB/positioninterface.h | UTF-8 | 488 | 2.78125 | 3 | [] | no_license | #ifndef POSITIONINTERFACE_H
#define POSITIONINTERFACE_H
class PositionInterface
{
public:
PositionInterface();
PositionInterface(int x, int y);
~PositionInterface();
virtual void set_x(int x);
virtual void set_y(int y);
virtual void set_position(int x, int y);
virtual int get_x();
virt... | true |
09b323da6ab90f2e561ea4d90eaad3027521ba7f | C++ | AyushYadav/competetiveArchive | /hourglass.cpp | UTF-8 | 785 | 3.0625 | 3 | [] | no_license | #include <cstdio>
#include <cstdlib>
#include <iostream>
#define n 6
using namespace std;
int retCount(int arr[][n],int k, int l){ // Row count == k Column Count == l
int cnt=0;
//if(n>=3) return 0;
for(int i=k;i<(k+3);i+=2){
for(int j=l;j<(l+3);j++){
cnt+=arr[i][j];
}
}
//cout <... | true |
b2a9f365e97c9930f0f25d6cca37594ebedb2afc | C++ | aaroexxt/BikeOSMKII | /bikeOS/useless code/bigFont.cpp | UTF-8 | 11,746 | 3.0625 | 3 | [] | no_license | /*
Custom large numbers that look hot
Credit to Michael Pilcher, adapted by Aaron Becker
*/
//big font library
#include <Arduino.h>
#include "bigFont.h"
#include "bigFontChars.h"
#include <LiquidCrystal_I2C.h>
//Constant data declaration
int bigFont::writeString(String str, int xPos, int yPos) {
int strLen = str.... | true |