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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
b72fa19339d276609022a24e5643440d889c78cb | C++ | Mistakx/Vending-Machine | /EDA Projeto 1/main.cpp | ISO-8859-1 | 2,153 | 3.296875 | 3 | [] | no_license | #include <iostream>
#include <stdlib.h>
#include <time.h>
#include <string>
#include "employee.h"
#include "client.h"
using namespace std;
int main(int argc, char* argv[]) {
locale::global(locale("English"));
srand(time(NULL));
string products_file_path = "";
string prices_file_path = "";
... | true |
f593ad244073a80c15b170a94ff370b211be25f2 | C++ | vgaudard/liu-tddd38-cpp-exercises | /mixed_exercises/exceptions/exceptions.cpp | UTF-8 | 540 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <stdexcept>
#include <cstdlib>
using namespace std;
class useless_exception : public logic_error
{
public:
useless_exception() : logic_error("I say wattouat!") {}
};
void recursive(int n)
{
if (n == 0)
throw useless_exception();
cout << "Allez, plus que " << n << endl... | true |
7bbe4b35c0e28b8f0df85c95c4b3e4b59cb9bc4f | C++ | st2662579/cis17a | /Hmwk/Assignment3/Problem11-14/main.cpp | UTF-8 | 1,589 | 3.71875 | 4 | [] | no_license | /*
* File: main.cpp
* Author: Seth Tyler
* Purpose: Calculate pay
* Created on March 26, 2018, 10:05 PM
*/
// System libraries
#include <iostream>
#include <string>
#include "Structures.h"
using namespace std;
int main() {
Worker worker;
int option;
float totalSalary;
while (true) {
c... | true |
85273144aad3b7b53c31a1f3309a1812edf6b6fc | C++ | Lee-DongWon/Baekjoon_Problems | /1012.cpp | UTF-8 | 1,134 | 2.90625 | 3 | [] | no_license | #include <iostream>
using namespace std;
void dfs(int N, int M, int y, int x, int **arr, int **visited) {
int dy[4] = { 1,-1,0,0 };
int dx[4] = { 0,0,1,-1 };
for (int i = 0; i < 4; i++) {
int ny = y + dy[i];
int nx = x + dx[i];
if (ny < 0 || ny >= N || nx < 0 || nx >= M)
continue;
if (... | true |
60ca4e90f9116a0c97f60bd66cc3b689b24b44d7 | C++ | Edwardlu0904/InterviewQuestion | /CheckStringAnagrams.cpp | UTF-8 | 1,374 | 3.953125 | 4 | [] | no_license | //
// Top 20 String Algorithm Questions from Coding Interviews
// (2) How to check if two Strings are anagrams of each other?
//
//
#include <iostream>
#include <map>
using namespace std;
int getIndex(char c) {
int charCount_index;
if ('a' <= c && 'z' >= c) {
charCount_index = (int)(c - 'a');
... | true |
9aa12d00cd3a02d417443d91315beeb8e708b482 | C++ | AlexHarker/FrameLib | /FrameLib_Objects/Filters/FrameLib_SVF.cpp | UTF-8 | 887 | 2.671875 | 3 | [
"BSD-3-Clause"
] | permissive |
#include "FrameLib_SVF.h"
using namespace FrameLib_Filters;
constexpr SVF::Description SVF::sDescription;
constexpr SVF::ParamType SVF::sParameters;
constexpr SVF::ModeType SVF::sModes;
// Filter Implementation
void SVF::operator()(double x)
{
// Compute all modes
hp = (x - (2.0 * r * s1) - (g * s1) -... | true |
35ecede4ad5773a787df1028562cb30d6ad99181 | C++ | Relics/Leetcode | /Work_leetcode/Contests/week 14/Sliding Window Median_Stomach_ache.cpp | UTF-8 | 1,686 | 2.6875 | 3 | [] | no_license | /*
* created by Stomach_ache
* Jan. 1, 2017
* runs in 118ms
*/
class Solution {
public:
typedef multiset<int>::iterator Iter;
Iter prev(Iter x) {
return -- x;
}
vector<double> medianSlidingWindow(vector<int>& nums, int k) {
int n = nums.size();
assert(n >= k);
... | true |
ed4b1f606043eb7187d467e53ddc5945f496c76b | C++ | nimish-dev/DSA-with-cpp | /linked list/sparse_polynomial_addition.cpp | UTF-8 | 5,464 | 4.1875 | 4 | [] | no_license | //Program to implement polynomial using linked list
#include<iostream>
using namespace std;
//Node class
//It will contain three slots named coefficient,exponent and the next node pointer
class node
{
public:
int coeff;
int exp;
node* next;
};
//Poly class
//To declare the polynomial cla... | true |
4160fff7af42e8c51eef99e4089f466b042ef1f3 | C++ | Altantur/algorithms | /basics/problem-35/code_cpp/max_diff_of_array_solution1.cpp | UTF-8 | 952 | 3.59375 | 4 | [
"MIT"
] | permissive | /**
@file max_diff_of_array_solution1.cpp
@author Altantur Bayarsaikhan (altantur)
@purpose Find 2 integers that have biggest difference
@version 1.0 08/11/17
*/
#include <iostream>
#include <fstream>
using namespace std;
int main(){
// ifstream test_file;
// Read from test files
// t... | true |
d1f2a89d868a399be55ba54e7135bbcdf0c4947b | C++ | McStasMcXtrace/NJOY21 | /src/njoy21/input/PURR/Card3/Temp.hpp | UTF-8 | 803 | 2.671875 | 3 | [
"BSD-2-Clause"
] | permissive | struct Temp {
using Value_t = std::vector< Quantity< Kelvin > >;
static std::string name(){ return "temp"; }
static std::string description() {
return
"The temp argument is a list of temperatures (in Kelvin) to which the\n"
"the unresolved resonances are produced.";
}
static bool verify... | true |
e62d281e04078dabc659ba5dc4ae2bf4c8451d48 | C++ | renlf/LeetCode | /Maximum_Product_Subarray.cpp | UTF-8 | 478 | 2.78125 | 3 | [] | no_license | #include <vector>
#include <algorithm>
using namespace std;
int maxProduct(vector<int>& nums) {
vector<vector<int>> dp(nums.size(), vector<int>(2));
dp[0][0] = nums[0];
dp[0][1] = nums[0];
int max_val = nums[0];
for (int i = 1; i < nums.size(); i++)
{
dp[i][0] = max(nums[i], max(nums[i] * dp[i - 1][0], nums[i... | true |
f5dd07f930ecee01e3dac9de5270861644b68c41 | C++ | kimdg1105/Algorithm_Solving | /BOJ/1913.cpp | UTF-8 | 1,258 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <cstring>
#define MAX 101
using namespace std;
int arr[1001][1001];
void snail(int n) {
int y = n / 2 + 1;
int x = n / 2 + 1;
arr[y][x] = 1;
int stamp = 2;
int move = 0;
while ( 1 ) {
move++;
for (int i = 0; i < move; i++) {
y = y - 1;
arr[y][x] = stamp;
stamp++;
... | true |
0a4aa2ebafe6901f9a73b1db1bf0280536fd68df | C++ | Lafayette-FSAE/PacManFirmware | /PacMan_CANOpen/Core1.cpp | UTF-8 | 33,386 | 2.75 | 3 | [
"MIT",
"GPL-2.0-only",
"Apache-2.0"
] | permissive | /**
* @file Core1.cpp
* @author Clement Hathaway (cwbh10@gmail.com)
* @brief The Code running on Core1 controlling much of the data processing
* @version 1.0
* @date 2020-04-13
*
* @copyright Copyright (c) 2020
*
*/
#include "Core1.h"
uint8_t cellFaults[16];
/**
* @brief A Callback triggered by the warnin... | true |
b5bfe58e636475fbbd1b9d8a21933a1c4a1d1bb4 | C++ | PrshntS/PREP | /BINARY TREES/lca.cpp | UTF-8 | 1,319 | 2.890625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define mx INT_MAX
#define mn INT_MIN
#define pb push_back
class Node
{
public:
int data;
Node* left;
Node* right;
Node(int n)
{
data = n;
Node* left = NULL;
Node* right = NULL;
}
};
Node* newn(int n)
{
Node* a = new Node(... | true |
3d1f0fdb117f953d1535dd405f7755e76e364940 | C++ | Zandriy/NeHe_SDL | /src/Sample_12.cpp | UTF-8 | 5,460 | 2.515625 | 3 | [] | no_license | /*
* Sample_12.cpp
*
* Created on: Feb 28, 2013
* Author: Andrew Zhabura
*/
#include "Sample_12.h"
GLfloat Sample_12::m_boxcol[COL_QTY][COORD_QTY]= {
{1.0f,0.0f,0.0f},{1.0f,0.5f,0.0f},{1.0f,1.0f,0.0f},{0.0f,1.0f,0.0f},{0.0f,1.0f,1.0f}
};
GLfloat Sample_12::m_topcol[COL_QTY][COORD_QTY]= {
{.5f,0.0f,0... | true |
b60d432dd05020edbff774005a39f53696e646b5 | C++ | SimiVoid/Student-Life-Simulator | /Student-Life-Simulator/src/Board.h | UTF-8 | 546 | 2.703125 | 3 | [] | no_license | #pragma once
#include "BoardField.h"
typedef std::vector<std::vector<BoardField>> BoardArray;
class Board {
const sf::Color& m_gridColor = sf::Color(41, 41, 41);;
sf::VertexArray m_boardGrid;
BoardArray m_fields;
uint16_t m_size;
void checkFieldPosition(const sf::Vector2i& position) const;
public:
explicit ... | true |
5286f126d732959343ec2abfd674ab79fb10cae7 | C++ | tamasferencz12/c-feladatok | /16.k.8.cpp | UTF-8 | 545 | 2.8125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
using namespace std;
int main()
{
string nev, elt;
unsigned short n;
float atlag, maximum;
ifstream file1;
ofstream file2;
file1.open("tanulok.in");
file2.open("tanulok.out");
file1 >> n;
for (unsigned int i = 1; i <= n; i++)
{
... | true |
ac1a8892384ac04c53484976232683e9ea26cb6c | C++ | ailyanlu1/leetcode-4 | /C++/220_Contains Duplicate III.cpp | UTF-8 | 843 | 3.03125 | 3 | [] | no_license | class Solution {
public:
bool containsNearbyAlmostDuplicate(vector<int>& nums, int k, int t) {
if (nums.size() == 0)
return false;
vector<node> vt;
for (int i = 0; i < nums.size(); i++)
vt.push_back(node(nums[i], i));
sort(vt.begin(), vt.end());
for (i... | true |
27514e9e7a9f7737752d729ee95a146d55292b7a | C++ | Rainboylvx/pcs | /luogu/1147/1.cpp | UTF-8 | 587 | 2.671875 | 3 | [] | no_license | #include<iostream>
#include<stdio.h>
#include<algorithm>
#include<set>
using namespace std;
const int maxn=2000000 + 5;
long long a[maxn];
int main()
{
long long n;
cin>>n;
for(int i=1;i<=n;i++) a[i]=a[i-1]+i;//前缀和
for(int i=1;i<=n;i++)
{
long long mid=a[i-1]+n;// 要找的那个数,显然比a[i-1] 大n
... | true |
d434b6a63238e84efc00e48f2332eac61a1cfccd | C++ | mevid93/8mulator | /include/chip8.hpp | UTF-8 | 5,993 | 2.9375 | 3 | [] | no_license | #ifndef CHIP8_HPP
#define CHIP8_HPP
#include <string>
#include <irrKlang.h>
class Chip8
{
public:
static const int MEMORY_SIZE = 4096; // size of the memory area
static const char REGISTERS_SIZE = 16; // number of registers
static const char STACK_SIZE = 16; // number of supported stack levels
... | true |
f43f6aec66e69c04aa9f4fb85df22b3bc84a88a4 | C++ | Zachary-Kramer/FMWS | /include/Types.hpp | UTF-8 | 869 | 3.234375 | 3 | [] | no_license | ///////////////////////////////////////////////////////////////////////////////
/// @file Types.hpp
/// @brief Defines various custom data types for ease-of-use
///////////////////////////////////////////////////////////////////////////////
#pragma once
#include <utility> // For std::size_t
#include <iostream> // ... | true |
4c186d9739f05e2ae039a5cf9843263e4768780a | C++ | LXGVENICE/my-webserver | /HttpResponse.hpp | UTF-8 | 842 | 2.578125 | 3 | [] | no_license | #pragma once
#include <string>
#include <unordered_map>
#include "HttpState.hpp"
#define PATH "/home/ubuntu/my-webserver/html"
#define CRFL "\r\n"
//enum HTTPMethod
//{
// GET, POST, DELETE, PUT, HEAD,
// INVAILD;
//}
class HttpResponse
{
public:
HttpResponse():keep_alive(true){}
bool parser(int ret,std::... | true |
9c537036524b837e8d2a96bb8b7a0ade57e30751 | C++ | bresearch/json | /jparser.h | UTF-8 | 935 | 2.703125 | 3 | [] | no_license | // A simple recursive descent JSON Object parser
// Author: Nurudeen Lameed
#include "jscan.h"
#include "jtypes.h"
class JParser
{
struct ParsingError : public std::runtime_error
{ParsingError(const char* what) : std::runtime_error{what} {}};
public:
using Member = std::pair<std::string, JValue*>;
JParser(... | true |
754e8b9d6f8e3099b2d2eeee0d2f31af7fb834b8 | C++ | overnew/CodeSaving | /GA_30.cpp | UTF-8 | 1,025 | 3.375 | 3 | [] | no_license | //https://www.acmicpc.net/problem/10610
//너무 깊게 생각함.
//30의 배수는 0이 있어야하고, 각 자리수들의 합이 3의 배수면 됨.(3의 배수의 특징)
//두 조건만 성립하면 0이 앞에 있기만 하면 30의 배수이기 때문에 그냥 내림차순으로 정리하면됨.
// 그리고 계속 num[i] = n[i] -'0'; 처럼 문자열에서 수를 가져올때 -'0'를 빼먹어서 오류가 나오니 조심하자
#include <iostream>
#include<string>
#include <algorithm>
using namespace std;
int num... | true |
10a8b0e4516f1ddfcd36a38df4ef57177f9df624 | C++ | itsss/SASA_Programming-I | /ProgrammingIClass/Homework/int2(HW)/(A) 경로 구하기1.cpp | UTF-8 | 1,759 | 3.359375 | 3 | [] | no_license | /*
경로 구하기 1
사이클이 없는 그래프 G의 한 정점에서 다른 정점까지 이동할 수 있는 경로는 1가지만 존재한다.
그래프 G와 시작정점 s, 도착정점 e를 입력받아 s로부터 e까지의 경로에 포함되는 정점들을 순서대로 출력하는 프로그램을 작성하시오.
<입력>
첫 줄에 정점의 개수 n(2<n<=10)과 간선의 개수 m(=n-1)이 입력된다.
둘째줄부터 인접한 2개의 정점이 m+1째 줄까지 입력된다.
마지막 줄에 시작정점 s와 도착정점 e가 입력된다.
단 정점은 1 이상의 정수로 표현되며, 비어있는 수는 없다고 가정한다.
5 4
1 2
1 3... | true |
5424469285cf7bcaf2dff304acb51ac9646d9b71 | C++ | HAW-MT-Jg2013/HAW_S14-PRP2 | /PRP2-A4/DataReader.cpp | UTF-8 | 1,338 | 2.875 | 3 | [] | no_license | //
// DataReader.cpp
// BScMech2-SoSe14-PRP2
//
// Created by Jannik Beyerstedt on 31.05.14.
// Copyright (c) 2014 Jannik Beyerstedt. All rights reserved.
//
#include "DataReader.h"
#include <fstream>
DataReader::DataReader () {
} // SOMETHING TO DO HERE ???
DataReader::~DataReader() {
if (rawData !=... | true |
40e4dac7ebf623420c4c561350f30e4b09633e7a | C++ | AndrewNomura/Virtual-Memory-Manager | /main.cpp | UTF-8 | 3,363 | 2.875 | 3 | [] | no_license | //
// main.cpp
// CPSC 351 Final Programming Project
//
// Created by Andrew Nomura on 4/27/19.
// Copyright © 2019 Andrew Nomura. All rights reserved.
//
#include <iostream>
#include <iomanip>
#include <cstddef>
#include <string>
#include <vector>
#include <fstream>
//#include "Hardware/MemoryManagementUnit.hpp... | true |
26286dc97497cae333b45e395f26265a1024036f | C++ | erleben/matchstick | /PROX/FOUNDATION/TINY/TINY/include/tiny_accessor.h | UTF-8 | 1,060 | 2.875 | 3 | [
"MIT"
] | permissive | #ifndef TINY_ACCESSOR_H
#define TINY_ACCESSOR_H
#include <cstddef> // Needed for size_t
namespace tiny
{
namespace detail
{
/**
* Accessor class.
* This class provides cast operations for type conversions.
*
* @tparam M The math base type that should be accessed.
*/
templ... | true |
9df55eea860f079e5e0ba62424ef7bffafa245f5 | C++ | hulian425/ACM-ICPC | /algorithm code/Computational Geometry/Jarcis March.cpp | UTF-8 | 1,463 | 3.234375 | 3 | [] | no_license | #include <algorithm>
#include <iostream>
using namespace std;
// Finding LTL
// 三点一线未解决
struct Point
{
int x;
int y;
bool extreme;
int succ;
};
int LTL(Point S[], int n) // n > 2
{
int ltl = 0; // the lowest-thrn-leftmost point
for (int k = 1; k < n; k++) // test all points
{
if (S[k].y < S[ltl].y || (S[k].y =... | true |
e6abc9a77d82db44327b50c45750ad9d2038a6c1 | C++ | pqrs-org/cpp-osx-chrono | /tests/src/chrono_test.hpp | UTF-8 | 1,402 | 2.640625 | 3 | [
"BSL-1.0"
] | permissive | #include <boost/ut.hpp>
#include <iostream>
#include <pqrs/osx/chrono.hpp>
void run_chrono_test(void) {
using namespace boost::ut;
using namespace boost::ut::literals;
"make_absolute_time_duration"_test = [] {
{
std::chrono::nanoseconds ns(256 * 1000000);
auto absolute_time_duration = pqrs::osx:... | true |
b9af237bea467197aae60a93b6238d56cb7c6b6b | C++ | sauravchaudharysc/InterviewBit-Solutions | /Arrays/Min Steps in Infinite Grid.cpp | UTF-8 | 854 | 3.75 | 4 | [] | no_license | /*One way to reach from a point (x1, y1) to (x2, y2) is to move
abs(x2-x1) steps in the horizontal direction and abs(y2-y1) steps
in the vertical direction, but this is not the shortest path to
reach (x2, y2). The best way would be to cover the maximum
possible distance in a diagonal direction and remaining in
hor... | true |
e77e3f121bb191fcabd565df0303d73d5274ed98 | C++ | AmbBAI/softrender | /softrender/softrender/texture2d.cpp | UTF-8 | 6,339 | 2.578125 | 3 | [
"Unlicense"
] | permissive | #include "texture2d.h"
#include "math/mathf.h"
#include "freeimage/FreeImage.h"
#include "sampler.hpp"
namespace sr
{
Texture2D::SampleFunc Texture2D::sampleFunc[2][AddressModeCount][AddressModeCount] = {
{
{
PointSampler::Sample < WarpAddresser, WarpAddresser >,
PointSampler::Sample < WarpAddresser, MirrorA... | true |
30cba863efac9f108b519b3ebf6475f7cad7d072 | C++ | thodorisGeorgiou/3D_texture_based_clustering | /Source_code/mitra_var_1.cpp | UTF-8 | 7,762 | 2.640625 | 3 | [] | no_license | #include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <pthread.h>
#include <iostream>
#include <thread>
#include <math.h>
#include "mitra_var_1.h"
MITRA_VAR_1::MITRA_VAR_1(int n_threads, float thres){
num_threads = n_threads;
threshold = thres;
}
void MITRA_VAR_1::distance_calculator(cv::Mat... | true |
e7a7950cde344fb33d8a07c1a2460fce4ed84628 | C++ | Yory-Z/Algorithm | /header/Parenthesis.h | UTF-8 | 3,880 | 3.609375 | 4 | [] | no_license | //
// Created by Yory on 2019/1/18.
//
#ifndef ALGORITHM_PARENTHESIS_H
#define ALGORITHM_PARENTHESIS_H
#include <string>
#include <stack>
#include <iostream>
using namespace std;
class Parenthesis {
public:
void testParenthesis();
void testGenerateParenthesis();
static void testLongestValidParentheses... | true |
dd4cfc9e0810ca8a69b72e3e28ad36c5192b5924 | C++ | pochi0701/cybele | /source/cbl_base64.cpp | UTF-8 | 2,408 | 2.828125 | 3 | [] | no_license | #include "stdafx.h"
// ==========================================================================
//code=UTF8 tab=4
//
// Cybele: Application SErver.
//
// cbl_base64.cpp
// $Revision: 1.0 $
// $Date: 2018/02/12 21:11:00 $
//
// ==========================================================================
static un... | true |
498d1f00e18d3f0756252094e3f00c8cbfd388ae | C++ | MohammedHassan98/Problem-Solving | /Anton and Letters/main.cpp | UTF-8 | 463 | 2.984375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <string.h>
using namespace std;
int main()
{
int count = 0;
string str ;
getline (cin, str);
for (int i = 0; i < strlen(str); i++){
bool appears = false;
for (int j = 0; j < i; j++){
if (str[j] == str[i]){
appea... | true |
c85c9de3bc36274866e7675b81434a1f47e29b11 | C++ | PranabSarker10/CPlusPlus | /86 to 110 IO/86 to 110.IO PROGRAMMING/109.IO CUSTOM INSERTER EXTRACTOR FINAL EXAMPLE.cpp | UTF-8 | 673 | 3.5625 | 4 | [] | no_license | ///IO CUSTOM INSERTER EXTRACTOR FINAL EXAMPLE
/**
Input:
3
Output:
*
***
*****
*/
#include<iostream>
using namespace std;
class triangle
{
public:
int n;
triangle(){}
triangle(int x){n=x;}
};
///output part:
ostream & operator << (ostream &stream, triangle t)
{
int i,j;
for(i=1;i<=t.n;i++)
... | true |
86baeb267671cb95a093270cf04b3d21aacd5a03 | C++ | minhduc462001/languageC | /nguyen to cung nhau.cpp | UTF-8 | 471 | 2.8125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int nguyento(int k){
if ( k<2) return 0;
for (int i = 2; i<= sqrt(k); i++)
if ( k % i ==0) return 0;
return 1;
}
int nguyentocungnhau(int x, int i){
int t;
t = __gcd(x,i);
if (t == 1) return 1;
return 0;
}
int main(){
int t;
cin>>t;
while(t--){
int x;
cin>>... | true |
b4bfcdce68c77090e070d48af6df0b557acdec4d | C++ | LouisLu78/My_Cbase | /CPP/mergeSort.cpp | UTF-8 | 2,022 | 3.1875 | 3 | [] | no_license | //Author: Guangqiang Lu
//Time: 20200504
//Email: gq4350lu@hotmail.com
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#define SIZEA 11
#define SIZEB 14
#define SIZEC 10000
void merge(int*, int, int, int, int*);
void mergeSort(int*, int, int, int*);
void mergeSort(int*, const int);
void printArray(int*, con... | true |
f8495cfe74f6c05d0ffaa43952e6d99b68f9fb1f | C++ | huangshenno1/algo | /soj/2014.cpp | UTF-8 | 845 | 2.96875 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
int cmp(const void *a, const void *b)
{
return (*(int *)a-*(int *)b);
}
int main()
{
int t,iCase;
scanf("%d",&t);
for (iCase=0;iCase<t;iCase++)
{
int rope[1010];
int n;
scanf("%d",&n);
int max=0;
for (int i=0;i<n;i++)
... | true |
35dea9b53e3065798de9c17a2943f4df61807042 | C++ | ManusiatamVan/AlPro2 | /LMS/Tugas/Tugas 4 TipeBentukLain/Typedef.cpp | UTF-8 | 196 | 3.03125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
typedef int integer;
integer num1, num2, sum;
cout<<"Masukkan Dua Angka : ";
cin>>num1>>num2;
sum=num1+num2;
cout<<"Total = "<<sum;
}
| true |
210fd8d49c3c68ab7b206f3d4f2732cb8df07508 | C++ | BioinformaticsArchive/hal | /api/inc/halColumnIterator.h | UTF-8 | 4,110 | 2.734375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | /*
* Copyright (C) 2012 by Glenn Hickey (hickey@soe.ucsc.edu)
*
* Released under the MIT license, see LICENSE.txt
*/
#ifndef _HALCOLUMNITERATOR_H
#define _HALCOLUMNITERATOR_H
#include <list>
#include <map>
#include <set>
#include "halDefs.h"
#include "halDNAIterator.h"
#include "halSequence.h"
namespace hal {
/... | true |
eac2e4671c7cf1a1c4c64d2e4c6b36bd366f745e | C++ | jb1361/Class-files-repo | /C343 Data Structures/CppDevSp17/L2P2/unittest1.cpp | UTF-8 | 8,712 | 2.9375 | 3 | [] | no_license | #include "stdafx.h"
#include "CppUnitTest.h"
#include "wrapper.h"
#include "IntegerSequence.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace L2P2
{
TEST_CLASS(UnitTest1)
{
public:
// -----------------------------------------------------------------------------------
// add
// ... | true |
21f4802fbe3261a1b8a1f48cadfd684622f73a5e | C++ | strengthen/LeetCode | /C++/761.cpp | UTF-8 | 2,961 | 3.15625 | 3 | [
"MIT"
] | permissive | __________________________________________________________________________________________________
sample 4 ms submission
class Solution {
public:
string makeLargestSpecial(string S) {
// like finding and reordering parenthesis sequences, recursively
if (S.empty()) return "";
vector<string>... | true |
daee9e45976ed9a20fd4f4facad994176f39d972 | C++ | DOOMSTERR/My_DSA_Learning | /Data Structures and Algorithm (C++)/Program and Codes/1_to_14_Programming_Topics_and_Questions/13_b_Reverse_of_a_number.cpp | UTF-8 | 487 | 3.21875 | 3 | [] | no_license | #include<iostream>
#include<cmath>
using namespace std;
int main(){
#ifndef ONLINE_JUDGE
freopen("Input.txt", "r", stdin);
freopen("Output.txt", "w", stdout);
#endif
cout << "Enter a no to be reversed" << endl;
int n;
cin >> n;
cout << n << endl;;
int last_digit, rev = ... | true |
0d9a400c03e89c347fbaf01d8d1eb7c311d1b28e | C++ | BrandonRTL/graph-alg | /include/Vectorgraph.h | UTF-8 | 1,655 | 2.765625 | 3 | [] | no_license | #ifndef __TGRAPH_H__
#define __TGRAPH_H__
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
class graph
{
public:
std::vector<int> adj;
std::vector<int> nums;
std::vector<float> data;
graph(std::string filename)
{
filename = "../../" + filename;
std::ifstream file... | true |
27d9a15cec1d672072ee3fdf1206a385bdb16baf | C++ | vandalo/Terraria | /2DGame/02-Bubble/02-Bubble/Skull.cpp | UTF-8 | 5,522 | 2.59375 | 3 | [] | no_license | #include <cmath>
#include <iostream>
#include <GL/glew.h>
#include <GL/glut.h>
#include "Skull.h"
#include "Game.h"
#define JUMP_ANGLE_STEP 4
#define JUMP_HEIGHT 40
#define FALL_STEP 0
#define M_PI 3.14159265358979323846264338327950288
enum SkullAnims
{
STAND_LEFT, STAND_RIGHT, MOVE_LEFT, MOVE_RIGHT
};
void Skull... | true |
8b77086b87cf50bbfc7f4dd817b666fb7537fab5 | C++ | Greenka2016/labs | /9/lab9.cpp | UTF-8 | 2,136 | 3.0625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <fstream>
#include <sstream>
using namespace std;
int n;
int main()
{
setlocale(LC_ALL, "Rus");
cout << "Введите кол-во строк: ";
cin >> n;
cin.ignore();
ofstream f1("F1.txt");
if (!f1.is_open())
{
cout << "Файл не открыт" << endl;
return 0;
}
... | true |
55c8e20316ccd42f9d9587c0c8b9b873a973b424 | C++ | anirudhsingla8/Coding_Problems_in_C--1 | /MonkandtheMagicalCandyBags.cpp | UTF-8 | 1,647 | 3.109375 | 3 | [] | no_license | //
// Created by aveorenzhio on 11/7/19.
//
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int length=0,heapsize;
void max_heapify(unsigned long long int arr[],int i)
{
int l=(2*i);
int r=(2*i+1);
int largest;
if(l<=heapsize && arr[l]>arr[i])
{
largest=l;
... | true |
666ffd6648a7f7137c9618970ad6fa1ec3f0a03a | C++ | mxbossard/laperco-capteurs | /poc_esp32_lora/PoC lora module/src/main.cpp | UTF-8 | 1,014 | 2.828125 | 3 | [] | no_license | #include <Arduino.h>
#include <U8x8lib.h>
#include <Wire.h>
#define GREENLED (25)
#define OLED_RESET U8X8_PIN_NONE
#define OLED_SDA (21)
#define OLED_SCL (22)
U8X8_SSD1306_128X64_NONAME_HW_I2C display = U8X8_SSD1306_128X64_NONAME_HW_I2C(OLED_SCL, OLED_SDA, OLED_RESET);
uint8_t col = 0;
void setup() {
// put your ... | true |
f148e0cdc2c490ee6807a1e0b688327fa486da7c | C++ | AcademyOfInteractiveEntertainment/AIEYear1Samples | /AI_FollowPath/PathFollower.h | UTF-8 | 716 | 3 | 3 | [] | no_license | #pragma once
#include <vector>
#include <glm/glm.hpp>
class PathFollower
{
public:
PathFollower();
void Update(float deltaTime);
void Draw();
void AddPoint(glm::vec2 point) { m_path.push_back(point); }
void SetPosition(float x, float y) { m_position.x = x; m_position.y = y; }
privat... | true |
8c92e4ceca820c9c9aed4b18a5fabb2591dcf14c | C++ | csimons1/CSCI4448 | /OOAD_HW2/Part C/main.cpp | UTF-8 | 842 | 2.59375 | 3 | [] | no_license | // Christian Simons
// CSCI4448 - Project 2
// Part C
#include <iostream>
#include <string>
#include <cstdlib>
#include <iomanip>
#include "Animal.cpp"
#include "Feline.cpp"
#include "Cat.cpp"
#include "Tiger.cpp"
#include "Lion.cpp"
#include "Pachyderm.cpp"
#include "Rhino.cpp"
#include "Elephant.cpp"
#include "Hipp... | true |
566e42a3bb901d6700b99bfbd225ab4eb0de9144 | C++ | FabianWiebe/competitive-programming | /4/exploration/solution.cpp | UTF-8 | 1,400 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <iterator>
#include <utility>
#include <unordered_set>
#include <fstream>
int main (void) {
std::ios::sync_with_stdio(false);
// std::ifstream in("largeSample.in");
// // std::streambuf *cinbuf = std::cin.rdbuf(); //save ol... | true |
f53429aac6ea83fd924bf72508b1dd8349d37ec8 | C++ | KevinPolez/Evolution | /src/Map.cpp | ISO-8859-1 | 3,032 | 3.484375 | 3 | [] | no_license | #include "Map.h"
#include "Seed.h"
Map::Map(int width, int height) : width(width), height(height), mapSize(width*height)
{
this->createGenerator();
int index;
for (index = 0; index < mapSize; index++)
{
data.insert(std::pair<int,int>(index,0));
}
}
Map::~Map()
{
}
void Map::createGenerat... | true |
2df84bf7d0124f9c89c56cdfb17c41287d050726 | C++ | OC-MCS/p2finalproject-01-andhartman | /game/Ship.h | UTF-8 | 325 | 2.5625 | 3 | [] | no_license | #pragma once
#include <iostream>
using namespace std;
#include <SFML/Graphics.hpp>
using namespace sf;
//class for the ship
class Ship {
private:
Sprite ship;
Texture shipTexture;
const float DISTANCE = 5.0;
public:
Ship(Vector2f);
void move();
Vector2f getPosition();
void setPosition(Vector2f);
Sprite& draw(... | true |
cab939b02105ac7842fb531017def21ac0dcf6f9 | C++ | yoonBot/Computer-Science-and-Engineering | /CSE3013: CSE Lab and Design 1/3. Introduction to C++ and OOP/Assignment/main.cpp | UTF-8 | 183 | 2.90625 | 3 | [
"MIT"
] | permissive | #include "Str.h"
using namespace std;
int main()
{
Str a("I'm a girl");
cout << a.contents();
a="I'm a boy\n";
cout << a.compare("I'm a a") << endl;
return 0;
}
| true |
d8d7b4167a1e4fef45866226f88276b6e2e58fbc | C++ | programmingNinja/Interview-questions | /WellOrderedPasswords/printPassword/printPassword.cpp | UTF-8 | 484 | 3.09375 | 3 | [] | no_license | // printPassword.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
void printPass(string digits, int startInd, string res,int length)
{
if(res.length() == 4)
{
cout<<res<<"\n";
res="";
}
if(startInd == length)
return;
printPass(digits, startInd+1, res+digits[s... | true |
29915f4890318d663918bf929de1c688c0438050 | C++ | studious-octo-doodle/Programming-Tutorial-in-C- | /5WorkingWithStrings.cpp | UTF-8 | 1,283 | 3.8125 | 4 | [] | no_license | #include <iostream> //configuration option so we can write our program
using namespace std; //configuration option
int main () //function... container...any lines we put in this container will get executed
{
string phrase = "Giraffe Academy";
cout << "hello"; //does not start a new line
cout << "my name i... | true |
8cd922b017e5ef4aa2a44cff1185d7d373b46601 | C++ | FatihBAKIR/fs | /src/src/disk_block_device.cpp | UTF-8 | 2,182 | 3.078125 | 3 | [] | no_license | //
// Created by Chani Jindal on 11/18/17.
//
#include <fs270/disk_block_dev.hpp>
#include <fcntl.h>
#include <unistd.h>
#include <stdexcept>
namespace fs
{
int disk_block_dev::write(disk_block_dev::sector_id_t id, const void *data) noexcept
{
auto ptr = reinterpret_cast<const char *>(data);
... | true |
4241b0e872019d8ecbe4b1f0233a9f5791d3a3ee | C++ | ccitllz/zertcore5 | /zertco5/utils/updatelist/DynamicList.h | UTF-8 | 3,492 | 2.78125 | 3 | [] | no_license | /*
* DynamicList.h
*
* Created on: 2015年8月7日
* Author: Administrator
*/
#ifndef ZERTCORE_UTILS_UPDATELIST_DYNAMICLIST_H_
#define ZERTCORE_UTILS_UPDATELIST_DYNAMICLIST_H_
#include <pch.h>
#include <utils/types.h>
namespace zertcore { namespace utils {
template <class Value, std::size_t Size... | true |
4314914ac0eda73f3a28ec7e05c0dfafa888e99f | C++ | nileshkulkarni/AI_lab | /logic/formula.cpp | UTF-8 | 3,000 | 3.203125 | 3 | [] | no_license | #include "formula.h"
void destroyAxiom1(formula *f){
//assert((f!=NULL) && (!f->leaf) && (f->rhs) && (f->lhs) && (f->rhs->leaf));
delete(f->rhs);
delete(f);
}
void destroyAxiom2(formula *f){
//assert((f!=NULL) && (!f->leaf) && (f->rhs) && (f->lhs) && (f->rhs->leaf));
delete((f->lhs)->rhs);
delete(f->lhs);... | true |
bd1815b211c6622298c2ab0f6ecfaf1ef6226cc3 | C++ | dlxj/doc | /lang/programming/cpp/src/main.cpp | UTF-8 | 3,800 | 2.75 | 3 | [] | no_license | #include<iostream>
#include<fstream>
#include<sstream>
#include<cstdlib>
#include "text_rank.h"
#include "sentence_rank.h"
#include "text_utils.h"
using namespace std;
int main(int argc, char *argv[])
{
if (argc != 5)
{
cout << "Usage: " << argv[0] << " <input_file> <choose_field> <method> <out_file>"... | true |
31643a025df46b12232d69a490dfaf13d0937571 | C++ | valbok/twitcher.exmpl | /api/ITwitcher.h | UTF-8 | 1,037 | 3.09375 | 3 | [] | no_license | /**
* @author VaL Doroshchuk <valbok@gmail.com>
* @package Twitcher
*/
#pragma once
#include <string>
#include <vector>
#include <stdint.h>
namespace twitcher {
using PostTexts = std::vector<std::string>;
using Topics = std::vector<std::string>;
/**
* The twitcher service interface.
*
* This allows adding an... | true |
600d4c00f838c47ecca7275f860e131263170a6b | C++ | smamir/oop-course | /Lab/Lab 2/621.cpp | UTF-8 | 3,214 | 3.515625 | 4 | [] | no_license | //Airline Reservations System
#include<iostream>
using namespace std;
int capacity[10] = {0};
int main()
{
int option,option2,total_seat=10,f=0,e=0;
while(total_seat>0)
{
cout<<"Please type 1 for 'first class'"<<endl;
cout<<"Please type 2 for 'economy'"<<endl;
cin>>option;
... | true |
40035c2fa2f9b5e6cf901c06b5fda768626ad1e1 | C++ | idleyui/leetcode | /solution/0297_Serialize_and_Deserialize_Binary_Tree.cpp | UTF-8 | 2,426 | 3.140625 | 3 | [] | no_license | #include "alg.h"
class Codec {
public:
// Encodes a tree to a single string.
string serialize(TreeNode *root) {
if (!root) return "";
queue<TreeNode *> q;
q.push(root);
string rt = "[";
TreeNode *next = nullptr, *last = root;
int level_size = q.size(), cnt = 0... | true |
0399d8ef588d5bb3f38197642bae34531455639a | C++ | AxeAndBlanka/algorithms | /WeightedGraph/src/allSP.cpp | UTF-8 | 2,020 | 3.125 | 3 | [] | no_license | // All-pairs shortest paths, Dijkstra's algorithm
/*#include <vector>
#include "SPT.cpp"
#include "DenseGraphWeight.cpp"
template <class T>
class allSP
{
public:
allSP(const SparseGraphWeight<T>& g) :
g(g), a(g.V())
{
for (int i = 0; i < g.V(); ++i)
a[i] = new SPT<T>(g, i);
}
Edge<T>* pathR... | true |
052415a49c7cbeca9978c734a0a3deed7870eae0 | C++ | AleksandraPaustovskaya/HomeWork | /первый сем/3.3/3.3/3.3.cpp | UTF-8 | 2,636 | 3.34375 | 3 | [] | no_license | //Найти наиболее часто встречающийся элемент в массиве быстрее, чем за O(n2 ).
//Если таких элементов несколько, надо вывести любой из них.
#include <stdio.h>
int partition(int array[], int lo, int hi)
{
int pivot = array[hi];
int i = lo;
for (int j = lo; j < hi; j++)
{
if (array[j] <= pivot)
{
int swap ... | true |
b6b2acbf6d0eceacb3222844224440c00bd30575 | C++ | Straw-b/Cpp_Code | /test0730/test0730/test.cpp | GB18030 | 4,891 | 3.84375 | 4 | [] | no_license | #include <iostream>
using namespace std;
#if 0
// Student俴һѧȺ
struct Student
{
// ԣѧĻϢ
char _name[20];
char _gender[3];
int _age;
char _school[20];
void SetStudentInfo(char name[], char gender[], int age, char school[])
{
strcpy(_name, name);
strcpy(_gender, gender);
_age = age;
str... | true |
cafcc24031951825cf8c57ec9a8118f5e1b62691 | C++ | olee12/uva_onlinejudge_solutions | /Codes/371 - Ackermann Functions.cpp | UTF-8 | 700 | 2.546875 | 3 | [] | no_license | #include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
long long int l,h;
long long int count=0,sum=0,i,j,k,max=0,n;
while(scanf("%lld %lld",&l,&h)==2 && l && h)
{
sum=0,max=0;
k=0;
if(l>h) l^=h^=l^=h;
for(i=l; i<=h; i++)
{
... | true |
e27d8ff69857da81fe2109d043c913b2dcb17ec2 | C++ | SvetlanaINBO318/labs | /laba6/main3.cpp | UTF-8 | 934 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
class Animal {
protected:
int age;
int nogi;
string food;
public:
Animal(int age,int nogi,string food) {
this->food=food;
this->age = age;
this->nogi = nogi;
}
virtual... | true |
1db8ec8d3b67c213c4a116601c3e6b7b6260d98b | C++ | colinxy/ProjectEuler | /Cpp/pe234.cpp | UTF-8 | 1,190 | 3.46875 | 3 | [] | no_license | /*
* poject euler 234: Semidivisible numbers
*
*/
#include <iostream>
#include <cmath>
#include "mathutil.h"
using namespace std;
using Mathutil::prime_under;
using Mathutil::sum;
const int64_t N = 999966663333L;
const int sqrtN = (int) sqrt(N);
int64_t subsum(int64_t p1, int64_t p2) {
int64_t p1_sq = p1*p... | true |
2027581f69a8a39af62dc08e8219c6ac56855b21 | C++ | L4WLI3T/Algorithm-Visualizer | /Home/ArrayHelper.cpp | UTF-8 | 461 | 2.9375 | 3 | [
"MIT"
] | permissive | #include "GL/freeglut.h"
#include "GL/gl.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <algorithm>
#include <iostream>
#include <unistd.h>
void randomizeArray(int* arr, int length)
{
for(int i = length - 1; i > 0; --i)
{
std::swap(arr[i], arr[rand() % (i+1)]);
}
}
void printArray(int* arr, ... | true |
0468f55a5ed831f590c8375e9f9ef91b34d21fc7 | C++ | vikrant1433/coding | /leetcode/maximum-product-of-word-lengths/maximum-product-of-word-lengths.cpp | UTF-8 | 731 | 2.921875 | 3 | [] | no_license | using namespace std;
#include <bits/stdc++.h>
#define LL long long
#define MOD (1000000000+7)
class Solution {
public:
int maxProduct(vector<string>& w) {
vector<bitset<26> > v(w.size());
for(int i=0; i< v.size(); i++) {
for(char c: w[i]) v[i].set(c-'a');
}
int a... | true |
85fc8dc0e99bbbab869695c0005274ca87047c82 | C++ | LeeSuHa98/kumoh-code | /kumoh-code-2017/C++/#1 알고리즘/자료구조/#6 Linked List/4 - 3. 이중 연결 리스트 (낫 헤더)/IoHandler.h | UTF-8 | 435 | 2.8125 | 3 | [] | no_license | #pragma once
#include "BookList.h"
class IoHandler
{
public:
IoHandler() {}
~IoHandler() {}
// operations for menu handling
int getMenu();
void putMenu();
// operations for getting & putting object
Book* getBook();
// operations for getting or putting simple value
int getInteger(string msg);
string getStrin... | true |
76a500404aa60764a0709ff4012d00b489ba1649 | C++ | WonderCsabo/RPN-calculator | /image.cpp | UTF-8 | 1,354 | 3.34375 | 3 | [] | no_license | /**Image loading from files, and drawing to screen.**/
#include "image.hpp"
#include <graphics.hpp>
#include <fstream>
using namespace genv;
using namespace std;
std::vector<std::vector<std::vector<Color> > > Image::imgs;
Image::Image(vector<string> filenames)
{
vector<vector<Color> > v; //temp matrix for the ac... | true |
a4e70f05c20674eb8b8d40318b2735c12090f854 | C++ | WSJI0/BOJ | /1000-9999/1240.cpp | UTF-8 | 1,161 | 2.625 | 3 | [] | no_license | //1240 노드 사이의 거리
#include <bits/stdc++.h>
using namespace std;
unordered_map<int, vector<int>> graph;
int cost[1001][1001];
int bfs(int a, int b){
queue<pair<int, int>> q; q.push(pair<int, int>(a, 0));
unordered_map<int, bool> visited;
visited[q.front().first]=1;
while(!q.empty()){
pair<int, ... | true |
0124fe05074734c60c18f14445d845905771d546 | C++ | songjihu/C_PTA | /B1022.cpp | UTF-8 | 523 | 2.578125 | 3 | [] | no_license | /*#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main() {
int n = 0;
int i = 0, j = 0;
long long x1 = 0, x2 = 0, r = 0;
int x3 = 0;
int answer[100000];
for (i = 0; i < 100000; i++) {
answer[i] = 0;
}
scanf("%lld%lld%d", &x1, &x2, &x3);
r = x1 + x2;
i =... | true |
5e82778c91a4203f44394df8e3986b35cc4297f3 | C++ | Lhw-686/Study | /数据结构/2_栈和队列/3_顺序队列.cpp | GB18030 | 2,342 | 3.90625 | 4 | [] | no_license | #include <iostream>
#define MAXSIZE 100
using namespace std;
typedef int ElemType;
typedef struct{
ElemType data[MAXSIZE];
int front;
int rear;
}Queue;
void InitQueue(Queue &Q){
Q.front = Q.rear = 0;
}
bool isEmpty(Queue Q){
return Q.front == Q.rear;
}
bool Push(Queue &Q, ElemType e){
if(Q.... | true |
9975f9cad0bc55a13556515634c8f78ae4c34095 | C++ | alantess/QtSimple | /integrate/signals/usr.h | UTF-8 | 1,304 | 2.875 | 3 | [
"MIT"
] | permissive | #ifndef USR_H
#define USR_H
#include <iostream>
#include <QObject>
#include <QString>
#include <QProperty>
#include <QDate>
class usr: public QObject
{
Q_OBJECT
//--> hide
Q_PROPERTY( QString name READ name WRITE setName NOTIFY nameChanged )
// We don't want to be able to change the age from QML, hen... | true |
cf3803e4b092104bef19ade1dc2c5ee343f099d9 | C++ | solecity/Flip_AndroidGame | /code/Credits_Scene.hpp | UTF-8 | 3,610 | 3.015625 | 3 | [] | no_license | /*
* MENU SCENE
* Copyright © 2020+ Mariana Moreira
*/
#ifndef CREDITS_SCENE_HEADER
#define CREDITS_SCENE_HEADER
#include <memory>
#include <basics/Atlas>
#include <basics/Canvas>
#include <basics/Point>
#include <basics/Scene>
#include <basics/Size>
#include <basics/Texture_2D>
#i... | true |
2a444ae0bd8daf62aab6caa0878e90721de76544 | C++ | VadosLight/interpreter | /executor.cpp | WINDOWS-1251 | 2,075 | 3 | 3 | [] | no_license | /*
Executor.cpp
, .
*/
#include "stdafx.h"
#include "executor.h"
#include "name_table.h"
#include "label_table.h"
#include "lexical_analizer.h"
#include "commands.h"
void register_commands() {
// name_table.cpp
NT.RegisterCommand("FOR",new CmdFor);
NT.RegisterCommand("GOTO",new CmdGoto);
... | true |
12edac0681bf3ddd881cab7327258b4ccc4be2fd | C++ | sunshinenny/Study-Practice | /大一实训-制作外卖系统-C语言/Search.cpp | GB18030 | 891 | 2.65625 | 3 | [] | no_license | #include"Type.h"
#include"Function.h"
//----------------------------------------------
int Search_o_ID(SqList L,string e)// Ųѯ
{
int i;int f=0;
for(i=0;i<L.length;i++)
{
if(e==L.elem[i].M.o_ID)
{PrintList(L,i);f=1;break;}
}
if(i==L.length&&f==0)
cout<<"ûд˶"<<endl<<endl;
return i;
... | true |
5a3add7508b8fbf6c5623574119bf937e68f8a0b | C++ | oliverxyy/gem5-source-code-learning | /src/mem/protocol/DMA_State.cc | UTF-8 | 1,771 | 2.9375 | 3 | [] | no_license | /** \file DMA_State.hh
*
* Auto generated C++ code started by /home/oliverxyy/program/gem5-stable/src/mem/slicc/symbols/Type.py:550
*/
#include <cassert>
#include <iostream>
#include <string>
#include "base/misc.hh"
#include "mem/protocol/DMA_State.hh"
using namespace std;
// Code to convert the current state to... | true |
7134711a51f78c115f8644a13f4413aecfe2eda4 | C++ | hihihippp/TimedText | /test/Text/TestStringBuilder.cpp | UTF-8 | 12,663 | 2.640625 | 3 | [
"BSD-2-Clause"
] | permissive | //
// Copyright (c) 2013 Caitlin Potter and Contributors
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, t... | true |
68cea9d1d65714f90f2d078ad35a4aa8b7f1d95e | C++ | tmothupr/tacitpixel | /include/tp/stack.h | UTF-8 | 5,270 | 2.9375 | 3 | [
"BSD-2-Clause",
"BSD-3-Clause",
"LicenseRef-scancode-public-domain"
] | permissive | /*
* Copyright (C) 1999-2013 Hartmut Seichter
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the fol... | true |
346c3ce9dd2567ef5784feb73d4e3566af0087e8 | C++ | hugo-maker/til | /sams_teach_yourself_cpp/lesson05/listing5_03.cpp | UTF-8 | 931 | 4.03125 | 4 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
cout << "Enter two integers:" << endl;
int num1 = 0, num2 = 0;
cin >> num1;
cin >> num2;
bool is_equal = (num1 == num2);
cout << "Result of equality test: " << is_equal << endl;
bool is_unequal = (num1 != num2);
cout << "Result of inequality test:... | true |
71cbab5f855d280de59d008f0dcfd759646e1dfe | C++ | gerardogtn/PracticaFinalSO | /RoundRobinScheduler.hpp | UTF-8 | 2,768 | 3.0625 | 3 | [] | no_license | // Copyright 2016
#ifndef ROUNDROBINSCHEDULER_H
#define ROUNDROBINSCHEDULER_H
#include <iostream>
#include <list>
#include "processComparison.hpp"
#include "SchedulerStep.hpp"
#include "Process.hpp"
class RoundRobinScheduler {
private:
const int quanta;
const int PROCESS_NUMBER;
double currentTime;
double w... | true |
db0a9e6e58e9833219e80a86ac7e7fc9dcc287b1 | C++ | hudvin/lightroom-mintaka | /lr-qt/untitled/csvreader.cpp | UTF-8 | 898 | 2.59375 | 3 | [] | no_license | #include "csvreader.h"
#include <pathutils.h>
#include <QFile>
#include <QDebug>
#include <QTextStream>
#include <QIODevice>
#include <QStringList>
CSVReader::CSVReader(){
}
void CSVReader::load(){
//QList<Entry> entries;
QString path = PathUtils::getAppTmpDir()+"/"+ENTRIES_FILE_NAME;
QFile inputFile(p... | true |
cddcc2c2f8fa65029103e9327a171b6a537560c8 | C++ | alaswell/CS253-FA17 | /PA3/Histogram.cpp | UTF-8 | 6,123 | 3.5625 | 4 | [] | no_license | #include <Histogram.h>
/*! \file Histogram.cpp: implements the Histogram class */
/// Evaluation operator.
/// Takes a Histogram and counts all instances of distinct strings
/// within the .histogram and stores them as a key_value_pair in the .map
void Histogram::Eval (Histogram& Hist) {
/* for each string in histog... | true |
4549a39ed362aaae734b3a1d7802bdfb8b2b2098 | C++ | hhYanGG/Acid | /Sources/Models/VertexModel.cpp | UTF-8 | 2,273 | 3.0625 | 3 | [
"MIT"
] | permissive | #include "VertexModel.hpp"
namespace acid
{
VertexModel::VertexModel(const Vector3 &position, const Vector2 &uv, const Vector3 &normal, const Vector3 &tangent) :
IVertex(),
m_position(position),
m_uv(uv),
m_normal(normal),
m_tangent(tangent)
{
}
VertexModel::VertexModel(const VertexModel &source) :
IV... | true |
e6393d3d1a8d435271d43a61342b6dddb4b96c5b | C++ | EdgarOlv/Arduino_Projects | /Teclado-Capacitivo/Teclado-Capacitivo.ino | UTF-8 | 1,387 | 2.859375 | 3 | [] | no_license | #include <CapacitiveSensor.h>
//Resistor ligando os pinos 4 e 2 (sender=2, receiver=3)
CapacitiveSensor sensor = CapacitiveSensor(2,7);
CapacitiveSensor sensor2 = CapacitiveSensor(2,4);
int buzzer = 11;
int SENSIBILIDADE = 900; //Frontreira que defini entre tocar ou nao
bool ligado = 0; //Indica se a lampada ... | true |
f4c6e163e3433483c2a54340f5bbe6f4248c73fb | C++ | xucheng1010/forest | /linux/3/sys_file.h | GB18030 | 1,082 | 3 | 3 | [] | no_license | #ifndef FOREST_SYS_FILE_H_
#define FOREST_SYS_FILE_H_
//װļIOϵͳãṩͬĶд
#include <fcntl.h>
#include <unistd.h>
#include "file_interface.h"
namespace forest
{
class SysFile : public FileInterface
{
public:
SysFile();
~SysFile();
public:
//ļ
virtual bool Open(const std::string& path);
//ļ
virtual b... | true |
1c242f384c6cf46ada587a5df10c9f7413ad7ceb | C++ | NeutralNoise/lol_script | /lolVM/fetch/fetch_mov.cpp | UTF-8 | 1,135 | 2.921875 | 3 | [
"MIT"
] | permissive | #include "fetch_mov.h"
#include "fetch_stack.h"
void fetchMovRegToReg(cpu * c) {
c->instruction.first = *(c->memory + c->pc + 1);
c->instruction.second = *(c->memory + c->pc + 2);
}
void fetchMoveRegToMem(cpu * c) {
c->instruction.first = *(c->memory + c->pc + 1);
c->instruction.second = *(uint32*)(c->memory + c-... | true |
404da9d9c96881491b20afe5ae2687315436c8e2 | C++ | GabrielEstevam/icpc_contest_training | /uri/uri_cpp/estruturas_e_bibliotecas/p1709.cpp | UTF-8 | 443 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include <sstream>
#include <string>
#include <stdlib.h>
#include <stdio.h>
#include <algorithm>
using namespace std;
int rec(int pos, int n, long long cont);
int main() {
int N;
while (cin >> N)
printf("%d\n", rec(2, N, 1));
return 0;
}
int rec(int pos, int n, long long cont) {... | true |
551d42cd6113bb0606826a5e86938d97bb4039cf | C++ | SentientCoffee/Primordial | /src/LevelLoader.cpp | UTF-8 | 5,906 | 2.640625 | 3 | [
"MIT"
] | permissive | #include "LevelLoader.h"
#include "Cappuccino/CappMacros.h"
#include "Cappuccino/HitBox.h"
#include <Cappuccino/PointLight.h>
#include <fstream>
#include <string>
LevelLoader::LevelLoader(const char* filename)
{
char tempName[256] = "";
bool moreFile = true;
FILE* file = fopen(filename, "r");
if (file == nullpt... | true |
d95cea99f8add45bae1702b078a209829ac7c464 | C++ | Syllllvia/MagicConch | /src/MagicConch/MTime.h | UTF-8 | 601 | 3.15625 | 3 | [
"MIT"
] | permissive | #pragma once
#include <time.h>
#include <Windows.h>
class MTime
{
public:
MTime(int y, int m, int d)
{
year = y;
month = m;
day = d;
}
static MTime to_MTime(std::string &ntime); //将如“2019.6.1”这样的合法输入转为时间类实例
std::string getTimeString(char segment = '.'); //将MTime转化为string语句,用于输出(默认分隔符为'.')
int rem... | true |
1cedf6f6556963bd24acd5a295e93dfd08c3c8dd | C++ | vhirtham/GDL | /gdl/base/tolerance.h | UTF-8 | 5,269 | 3.3125 | 3 | [] | no_license | #pragma once
#include "gdl/base/fundamentalTypes.h"
#include "gdl/base/simd/utility.h"
namespace GDL
{
//! @brief Class to check if two values are equal with a certain tolerance.
//! @tparam _registerType: Register type or data type for non sse types
//! @tparam _numComparedValuesSSE: Specifies how many values (s... | true |
b77d14ae7a5a454422e0a2421b095ec9e5bddbf9 | C++ | Akheon23/dcp | /examples/Tools.h++/rw7/manual/tmplcard.cpp | WINDOWS-1252 | 3,880 | 2.796875 | 3 | [] | no_license | /*
* This example is from the Tools.h++ manual, version 7
*
* Copyright (c) 1989-1999 Rogue Wave Software, Inc. All Rights Reserved.
*
* This computer software is owned by Rogue Wave Software, Inc. and is
* protected by U.S. copyright laws and other laws and by international
* treaties. This computer software ... | true |
7919c9c93f2b0adce13a80a6fc05aeb061de2341 | C++ | tito-kimbo/Online-Judge-Solutions | /AceptaElReto/EDA_AceptaElReto_215/EDA_AceptaElReto_215/Source.cpp | UTF-8 | 977 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <vector>
std::istream & operator>>(std::istream & in, std::vector<int> & v) {
int aux;
in >> aux;
while (aux != -1) {
v.push_back(aux);
in >> aux;
}
return in;
}
//BUILDING A TREE SHOULD BE EXTREMELY SIMILAR
void createPostOrder(std::vector<int> const& pre, std::vector<int> co... | true |
d31774f42524224fc54bce1dcfa8084ceb0c4752 | C++ | LazyShpee/IndieStudial | /IndieStudial/Sources/Vehicle.cpp | UTF-8 | 7,751 | 2.515625 | 3 | [] | no_license | #include "Vehicle.hpp"
#include <cstdio>
Vehicle::Car::Car(float x, float y, float heading) {
this->position = Vector::Vec2(x, y);
this->heading = heading;
this->absVel = 0.f;
this->yawRate = 0.f;
this->steer = 0.f;
this->steerAngle = 0.f;
this->smoothSteer = true;
this->safeSteer = true;
this... | true |