text stringlengths 8 6.88M |
|---|
// Copyright (c) 2012-2017 The Cryptonote developers
// Copyright (c) 2018-2023 Conceal Network & Conceal Devs
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <boost/program_options.hpp>
#include <boos... |
/*
* @Author: Jin
* @Date: 2020-11-14 20:17:42
* @Last Modified by: Jin
* @Last Modified time: 2020-11-17 19:21:06
*/
#include <windows.h>
#include <stdint.h>
#define internal static // function is local to the file
#define local_persist static // persist, retain the value
#define global_variable static // Not pre... |
#include "Elemento.h"
#include <string>
#include <iostream>
using std::endl;
using std::string;
Elemento::Elemento(){
}
string Elemento::toString(){
return "Es un elemento";
}
string Elemento::getClass(){
return "Clase base";
}
|
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
#define eps 1e-8
#define pi acos(-1.0)
using namespace std;
typedef long long L... |
#pragma once
#include <boost/variant.hpp>
#include <cef/cef_render_handler.h>
#include <cef/cef_v8.h>
#include <functional>
#include <string>
#include <unordered_map>
#include <vector>
struct JSNullRaw
{};
typedef std::function<CefRefPtr<CefV8Value>(CefRefPtr<CefV8Value> object, const CefV8ValueList& arguments)> JS... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2011 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
/*
Cross-module security manager: Plugin model
Lars T Hans... |
#include <iostream>
using namespace std;
int binarySearch(int A[], int l, int r, int x){
if(l<=r){
int mid = l + (r-l)/2;
if(A[mid] == x)
return mid;
if(A[mid]>x)
return binarySearch(A, l, mid-1,x);
return binarySearch(A, mid+l, r, x);
}
return -1;
}
|
// Copyright (c) 2011-2017 The Cryptonote developers
// Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs
// Copyright (c) 2018-2023 Conceal Network & Conceal Devs
//
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.... |
#include "Client.h"
#include "Core.h"
QByteArray Client::outputBuffer() const
{
return outputBuffer_;
}
void Client::setOutputBuffer(const QByteArray &outputBuffer)
{
outputBuffer_ = outputBuffer;
}
QByteArray Client::inputBuffer() const
{
return inputBuffer_;
}
void Client::setInputBuffer(const QByteArray &inpu... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2012 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser.
** It may not be distributed under any circumstances.
*/
#ifndef CSS_H
#define CSS_H
#include "modules/style/css_media.h"
... |
//
// GnIProgressBar.h
// Core
//
// Created by Max Yoon on 11. 7. 15..
// Copyright 2011년 __MyCompanyName__. All rights reserved.
//
#ifndef __Core__GnIProgressBar__
#define __Core__GnIProgressBar__
#include "GnInterface.h"
class GnIProgressBar : public GnInterface
{
public:
enum ePlayPlag
{
... |
//
// 121_ Best Time to Buy and Sell Stock.cpp
// leetcode
//
// Created by Xujian CHEN on 5/20/20.
// Copyright © 2020 Xujian CHEN. All rights reserved.
//
class Solution {
public:
int maxProfit(vector<int>& prices) {
int maxPrft = 0;
if (prices.size() == 0) return maxPrft;
in... |
#define DAC_CS 5
#include <SPI.h>
#include <SimpleCLI.h>
SimpleCLI cli;
Command cmdSetv;
SPISettings spi_settings(20e6, MSBFIRST, SPI_MODE0);
void dac_write(uint16_t value) {
if(value>4095) value = 4095;
value |= 0b0011000000000000;
SPI.beginTransaction(spi_settings );
digitalWrite(DAC_CS, LOW);
SPI.trans... |
#pragma once
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include "Transaction.h"
using namespace std;
class PhyPlanNode {
//物理计划树节点
private:
vector<string> parameters;//参数
vector<string> additions;//附加内容
public:
PhyPlanNode* left;
PhyPlanNode* right... |
#ifndef NEURAL_NODE_GROUP_CPU_H
#define NEURAL_NODE_GROUP_CPU_H
#include <memory>
#include <vector>
#include "utility/types.h"
#include "neural_network/NeuralNetworkConfiguration.h"
class NeuralNodeGroupCpu
{
public:
static std::shared_ptr<NeuralNodeGroupCpu> create(const NeuralNodeGroupConfiguration& configuration... |
/*******************************************************************************
* filename: C_HighComplexityPatternInitialiser.cpp
* description: Implementation of 'HighComplexityPatternInitialiser' class
* author: Moritz Beber
* created: 2011-01-18
* copyright: Jacobs University Bremen. All rights ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2006 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Jan Borsodi
*/
#ifndef SCOPE_PROTOCOL_SERVICE_H
#define SCOPE_PROTO... |
//------------------------------------------------------------------------
// Author: Mr. Lynn Barnett
// Student ID: *20360727
// E-Mail: barnettlynn@gmail.com
// Course: CMSC 2613, Programming II
// CRN: 21256, Spring, 2014
// Project: p03
// Due: February 14, 2014
// Account: tt044
//--------------------------... |
#pragma once
#include <iostream>
#include "myUtils.h"
#include "LQP_main.h"
#include "Antispoofing.h"
using namespace std;
Mat frame, frame_copy_resized;
extern cv::String WINDOW_NAME;
extern int NumMaxFrame;
extern float normWidth, normHeight;
extern int window_width;
extern int window_height;
ex... |
/*
* Created December 2020
* Author: Luke Sequeira
*
* Copyright (c) 2020 Luke Sequeira
*
* Data Source: http://yann.lecun.com/exdb/mnist/
*
*/
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cstring>
#include <tuple>
typedef unsigned char ubyte;
typ... |
#include <SD.h> // Standard SD Card Library
#include <OneWire.h> // Temperature Probe
#include <DallasTemperature.h> // Temperature Probe
#include <LiquidCrystal.h> // LCD Screen
// Pin Instantiation:
const int tempPin = 2;
const int probePin = A0;
const int usbDigOutput = 10;
// Sampling Paramters:
const... |
// Copyright (c) 2020 Giannis Gonidelis
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <pika/iterator_support/tests/iter_sent.hpp>
#include <pika/iterator_suppor... |
class Solution {
public:
int strStr(string haystack, string needle) {
if ( needle == "" ) //空则返回0
return 0;
int hlen = haystack.length();
int nlen = needle.length();
int i,j;
for(i=0;i<hlen;i++){
for(j=0;j<nlen;j++)
if(haystack[i+j]... |
#include "../include/DtFecha.h"
#include <iostream>
DtFecha :: DtFecha(){
}
DtFecha :: DtFecha(int dia, int mes, int anio){
if ((dia > 31) || (dia < 1) || (mes > 12) || (mes < 1) || (anio < 1900)){
throw std::invalid_argument("Fecha no válida.");
}
else{
this->dia = dia;
this->mes = mes;
this->a... |
#include <iostream>
#include <vector>
#include <fstream>
using namespace std;
vector<int> answer;
vector<vector<int>> a;
vector<int> w;
void rev(int k, int s) {
if (a[k][s] == 0)
return;
if (a[k - 1][s] == a[k][s]) {
rev(k - 1, s);
} else {
rev(k - 1, s - w[k]);
answer.pus... |
#include "stdio.h"
#include "conio.h"
void main (void)
{
int n, la[5];
int max=0, loc=0;
clrscr();
printf("\n\nEnter values = ");
for (int k=0; k<=4; k++) {
scanf("\n\n%d",&la[k]);
if(max < la[k]){
max=la[k];
loc=k;
}
}
printf ("\n\nMaximum value is %d and location is %d as... |
#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
#include <glad/glad.h>
#include <iostream>
#include "Application/Application.h"
#include "Application/Input.h"
int main(void)
{
GLFWwindow* window;
if (!glfwInit())
return -1;
window = glfwCreateWindow(Application::WIDTH, Application::HEIGHT, "Hello World", NULL,... |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL
// -I /home/gael/Coding/LinearAlgebra/CSparse/... |
//
// NSGA_II.hpp
// GA
//
// Created by Tom den Ottelander on 03/02/2020.
// Copyright © 2020 Tom den Ottelander. All rights reserved.
//
#ifndef NSGA_II_hpp
#define NSGA_II_hpp
#include <stdio.h>
#include <list>
#include "SimpleGA.hpp"
class NSGA_II : public SimpleGA {
public:
NSGA_II(FitnessFunction * fit... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2010 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#include "core/pch.h"
#ifdef SELFTEST
#include "modules/dom/sel... |
/* Copyright 2016 tgil All Rights Reserved */
#include "ui/ButtonPin.hpp"
using namespace ui;
using namespace sys;
using namespace hal;
ButtonPin::ButtonPin(int port, int pin, bool active_value) : Pin(port, pin) {
m_active_value = active_value;
}
bool ButtonPin::get_is_active() const {
return Pin::get_value() == m... |
#ifndef _NIHTTPD_H
#define _NIHTTPD_H 1
#include <nihttpd/socket.h>
#include <nihttpd/http.h>
#include <string>
#include <thread>
#include <list>
#include <memory>
#include <mutex>
#include <condition_variable>
namespace nihttpd {
enum class urgency {
debug,
low,
normal,
info,
high,
critical,
};
class ... |
#include <vector>
#include <iostream>
#include <algorithm>
#include "BinarySearch.h"
int main()
{
std::vector<int> v = {1, 2, 3, 4, 5, 6};
auto it = v.end();
int i = std::distance(v.begin(), it);
auto ret = BinarySearch(v.begin(), v.end(), 5);
if (ret.first == false)
{
std::cout << "5 is not in v\n";
}
else
... |
#include <stdio.h>
int sum(int);
int main()
{
int sd, num;
printf("\nEnter any number:");
scanf("%d",&num);
sd =sum(num);
printf("\n Sum of digits = %d",sd);
return 0;
}
int sum(int n)
{
if(n<10)
return(n);
else
return(n %1... |
#include "RotatedBMP.h"
|
#ifndef SORT_H
#define SORT_H
#include <QWidget>
#include "enter.h"
namespace Ui {
class Sort;
}
class Sort : public QWidget
{
Q_OBJECT
public:
explicit Sort(QWidget *parent = nullptr);
~Sort();
private slots:
void on_pushButton_clicked();
private:
Ui::Sort *ui;
};
#endif // SORT_H
|
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
using namespace std;
namespace Mahjong {
class MahjongPlayer {
public:
string _name;
int _point;
vector<MahjongTile*> _tile;
vector<MahjongTile*> _discardedTile;
vector<vector... |
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/app18.unoproj.g.uno.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Fuse.LayoutRole.h>
#include <Uno.UX.Property-1.h>
namespace g{namespace Fuse{struct Visual;}}
namespace g{namespace Uno{namespace UX{st... |
#include "../../headers.h"
#include "Log.h"
// I wanted to use ColorConsoleAppender and to be able to colorize some substrings inside the message differently as well.
// Certainly, all the color codes must be eliminated from the file logging.
namespace termcolor
{
// Forward declaration of the `_internal` namesp... |
#include "Scheme_values/Number.hpp"
#include "Environment.hpp"
#include "Scheme_values/Scheme_value.hpp"
Number::Number(float number) : number(number)
{
}
std::string Number::as_string() const
{
return std::to_string(number);
}
|
#include <game/editor.h>
#include <engine/input.h>
#include <core/render_context.h>
#include <game/assets.h>
#include <game/game_state.h>
#include <imgui/imgui.h>
#include <engine/debug_renderer.h>
void EditorState::init(RenderContext *render_context, Assets *assets) {
enabled = false;
was_enabled = false;
operatio... |
#include <iostream>
#include <stdexcept> // for std::runtime_error
#include "Date.hpp"
// Constructor.
// Can throw. Provides strong exception guarantee.
Date::Date(int day, int month, int year)
: day_(day), month_(month), year_(year)
{
check_valid_date(day, month, year);
}
// Helper function.
// Can throw. Provide... |
/**********************************************************************************************/
/**********************************************************************************************/
/**********************************************************************************************/
/////////////////LUCES
vo... |
#include "Hombre.h"
#include "Caja.h"
#include "Esfera.h"
#include "coche.h"
#include "cursor.h"
#include "tablero.h"
#include "piezas.h"
class Interaccion
{
public:
static void rebote(Hombre& h, Caja c);
static void Rebote(Esfera& e, Caja c);
static void rebotee(Esfera &e, Pared plat);
static void cho... |
#ifndef SPINLOCK_HH
#define SPINLOCK_HH
inline void spin_lock(volatile int *p) {
while(!__sync_bool_compare_and_swap(p, 0, 1)) {
while(*p) _mm_pause();
}
}
inline void spin_unlock(volatile int *p) {
__sync_synchronize();
*p = 0;
}
#endif |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-file-style: "stroustrup" -*-
*
* Copyright (C) 1995-2005 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#include "core/pch.h"
#include "modules/util/str.h"
#... |
#ifndef _SOULAPI_H
#define _SOULAPI_H
#include <Arduino.h>
#include <Vector>
#include <ArduinoJson.h>
#include <WiFi.h>
#include <HTTPClient.h>
#include <WiFiClientSecure.h>
#include <string>
using namespace std;
struct PsychologyDaily {
String classify;
string knowledge;
String id;
String created_a... |
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
int edge[1010][1010];
bool acc[1010][1010];
bool vis[1010];
void build(int a,int b)
{
acc[a][b]=true;
cin >> edge[a][b];
}
int main()
{int n,m,t,k,a,b,v,rec;
while (cin >> n >> m)
{cin >> t >> k;
memset(acc,0,sizeof(ac... |
/** @file
*****************************************************************************
* @author This file is part of libsnark, developed by SCIPR Lab
* and contributors (see AUTHORS).
* @copyright MIT license (see LICENSE file)
********************************************************************... |
#include<iostream>
#include<vector>
#include<algorithm>
#include<iterator>
using namespace std;
class Solution {
public:
vector<vector<int>> subsetsWithDup(vector<int>& nums) {
//基本思想:字典排序(二进制排序)子集,以字典序的顺序获得全部组合,第一个序为000,最后一个序为111,对应nums元素,vec[i]=1则将nums[i]加入cur
vector<vector<int>> res;
vector<int> cur;
vector... |
#include <iostream>
void imprimir(char[][12], int);
void recorrerLaberinto(char[][12], int, int, int, int);
int main()
{
const int tam = 12;
int const coordXinicio = 0, coordYinicio = 2, coordXfinal = 11, coordYfinal = 4;
char laberinto[][tam] = {
{'#', '#', '#', '#', '#', '#', '#', '#', '#', '#... |
#pragma once
#include <System.h>
namespace breakout
{
class PostProcessingSystem : public BaseSystem
{
public:
static EBaseSystemType GetType()
{
return EBaseSystemType::PostProcessing;
}
PostProcessingSystem()
: BaseSystem() {}
virtual ... |
//
// GStateUILayer.h
// Core
//
// Created by Max Yoon on 11. 7. 30..
// Copyright 2011년 __MyCompanyName__. All rights reserved.
//
#ifndef Core_GStateUILayer_h
#define Core_GStateUILayer_h
#include "GInterfaceLayer.h"
class GnITabCtrl;
class GnIListCtrl;
class GnITabPage;
class GnINumberLabel;
... |
#ifndef UTIL_H
#define UTIL_H
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_ttf.h>
#include <string>
class Util
{
public:
static SDL_Texture* loadTexture(std::string path, SDL_Renderer* renderer);
static SDL_Texture* loadTextureFromText(std::string text, SDL_Renderer* renderer, TTF_Font* font, SDL_Color... |
#include "sicarioClient.h"
SicarioClient::SicarioClient(std::string serverAddress, short port) {
conn = socket(AF_INET, SOCK_STREAM, 0);
memset(&connAddress, 0, sizeof(connAddress));
connAddress.sin_family = AF_INET;
connAddress.sin_port = htons(port);
inet_pton(AF_INET,serverAddress.c_str(),&connA... |
#ifndef LEFT_MOUSE_BUTTON_EVENT_HPP
#define LEFT_MOUSE_BUTTON_EVENT_HPP
#include "MouseEvent.hpp"
/*
* @author: Grzegorz Mirek
*/
class LeftMouseButtonEvent : public MouseEvent {
protected:
int getButtonDownCode() override;
int getButtonUpCode() override;
};
#endif |
// Copyright 2012 Yandex
#include <gtest/gtest.h>
#include <vector>
#include "ltr/utility/numerical.h"
#include "ltr/data/object.h"
#include "ltr/scorers/composition_scorers/linear_composition_scorer.h"
#include "ltr/scorers/linear_scorer.h"
#include "ltr/scorers/one_feature_scorer.h"
using ltr::Object;
using ltr::L... |
#include "GApp.h"
void GApp::onCleanup(void)
{
SDL_FreeSurface(test);
SDL_FreeSurface(display);
SDL_Quit();
} |
/*
* @Description:
* @Author: Ren Qian
* @Date: 2020-02-10 08:38:42
*/
#include "lidar_localization/mapping/loop_closing/loop_closing_flow.hpp"
#include "glog/logging.h"
#include "lidar_localization/global_defination/global_defination.h"
namespace lidar_localization {
LoopClosingFlow::LoopClosingFlow(ros::NodeHan... |
#include "lenet5_libtorch.hpp"
template <typename DataLoader>
void train(
size_t epoch,
Lenet5 &model,
torch::Device device,
DataLoader &data_loader,
torch::optim::Optimizer &optimizer,
size_t dataset_size)
{
model->train();
size_t batch_idx = 0;
for (auto &batch : data_loader)
{
au... |
/** Kabuki SDK
@file /.../Source/Kabuki_SDK-Impl/_G/Entity.h
@author Cale McCollough
@copyright Copyright 2016 Cale McCollough ©
@license Read accompanying /.../README.md or online at http://www.boost.org/LICENSE_1_0.txt
@brief This file contains the _2D.Vector_f interface.
*/
#i... |
#include "CppUnitTest.h"
#include "CppUnitTestAssert.h"
#include "../3XD_Lib/linear/vector.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
using namespace Z_3D_LIB_FOR_EGE;
namespace My3D_Lib_for_ege_UnitTest
{
TEST_CLASS(_vector_test)
{
public:
TEST_METHOD(vector_init) {
double _t1[4] = { 1... |
#include<bits/stdc++.h>
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)
#define INF ((1LL<<62)-(1LL<<31)) /*オーバーフローしない程度に大きい数*/
#define MOD 1000000007
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using pint = pair<int,int>;
const double PI = 3.14159265358979323846;
... |
// kth number in range [l, r] if it was ordered
struct node{
int val;
int l, r;
node(int a=-1, int b=-1, int c=0){
val=c;l=a;r=b;
}
};
node tree[8600010]; // 4*nlog(4*n) space = 8600010
int idx=0;
int build(int l, int r){
if(l==r)
return idx++;
int mid = (l+r)/2;
tree[idx... |
// Author: Miles Meacham
// Course: CS-1410-X01-deBry-Fall 2015
// Instructor: Professor deBry
// File: MyRectangle.cpp
// Date: 9/10/2015
// Contents: lab03 Assignment Rectangle Class
// I delcare that the following source code was written solely by me, or provided by the instructor.
// I understand that copying any... |
/************************************************************************/
/* File name : ViewDialog.cpp */
/************************************************************************/
/* Contents : 結果出力ダイアログ */
/* ... |
#include "pch.h"
#include "Model.h"
Model::Model()
{
nNumber = 10;
}
void Model::IncreaseNumber()
{
nNumber += 10;
}
const int Model::GetNumber()
{
return nNumber;
} |
#ifndef Hardware_h
#define Hardware_h
class Board {
public:
virtual void init();
static void assignMovablePin(byte reg, byte ofs, byte pin);
protected:
virtual void initSwitchMatrix();
virtual void initIOCON();
virtual void setupSysClock();
virtual void setupSysTick();
virtual void setupMRT(uint32_t hz);
};
cl... |
//此题目为prim算法模板题
//完全套模板即可,不再赘述
#include<cstdio>
#include<algorithm>
using namespace std;
const int MARX=2147483640;//最大值
int map[2010][2010];//邻接矩阵存边
int minn[2010];
bool f[2010];
int n,m,ans;
void prim();
int main()
{
scanf("%d%d",&n,&m);
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++)
... |
#include<bits/stdc++.h>
#define rep(i,n) for (int i =0; i <(n); i++)
using namespace std;
using ll = long long;
int main(){
int N;
cin >> N;
vector<int>A(N);
rep(i,N)cin >>A[i],A[i]--;
vector<int>B(N);
rep(i,N)cin >>B[i];
vector<int>C(N);
rep(i,N)cin >>C[i];
int ... |
#include "lib.hpp"
int get_answer_of_life(){
return 42;
}
|
#include<bits/stdc++.h>
using namespace std;;
int sumME(int array[], int len);
int smallest(int array[], int len);
int minayy(int array[], int len);
int main(){
int array[] = {3, 2, 5, 1, 7};
int len = 5;
cout<<minayy(array , len);
return 0;
}
int sumME(int array[], int len){
int sum = 0;
for (int i=0; i<len; sum... |
#include <iostream>
#include "functor.hpp"
using namespace std;
class Parrot {
public:
void Eat() {
cout << "tsk, knick, tsk...\n";
}
void Speak() {
cout << "oh captain, my captain!\n";
}
};
int main() {
// define a type: pointer to a member function of Parrot, taking no argumen... |
#include<iostream>
using namespace std;
//取字符串第一个'_'之前的内容
string split_head(string A){
int index;
index=A.find("_");
return A.substr(0,index);
}
int main(){
int a,b,i,j,k;
cout<<"输入文件A个数,含下划线"<<endl;
cin>>a;
string *A=new string[a];
cout<<"输入文件名"<<endl;
for(i=0;i<a;i++){
cin>>A[i];
}
cout<<"输入要比对的文件B个数... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "Weapon.h"
#include "Components/BoxComponent.h"
#include "MainPlayer.h"
#include "Engine/SkeletalMeshSocket.h"
#include "Components/SkeletalMeshComponent.h"
#include "Components/SphereComponent.h"
AWeapon::AWeapon()
{
CombatBox ... |
#include <QIntValidator>
#include <QKeyEvent>
#include "ippartlineedit.h"
CIpPartLineEdit::CIpPartLineEdit(QWidget *parent)
: QLineEdit(parent)
{
m_preEdit = NULL;
m_nextEdit = NULL;
this->setMaxLength(3);
//this->setFrame(false);
this->setAlignment(Qt::AlignCenter);
QValidator *validat... |
#ifndef BLOCTERNARYSELECTOR_H
#define BLOCTERNARYSELECTOR_H
#include "BlocComposite.h"
namespace BehaviourTree
{
/*
Composite bloc
Executes its second child if the first child returns success, the third child otherwise
Don't support InProgress (due to time rushing)
*/
class BlocTernarySelect... |
#ifndef TREEFACE_EVENT_H
#define TREEFACE_EVENT_H
#include "treeface/base/Common.h"
#include "treeface/base/Enums.h"
#include "treeface/event/Keyboard.h"
#include <treecore/IntTypes.h>
namespace treeface {
struct KeyboardEvent
{
ButtonUpDown button_action;
KeyButton button;
treecore::uint16 modifier;
}... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2012 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Niklas Beischer <no@opera.com>, Erik Moller <emoller@opera.com>
**
*... |
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 1e5;
int readInt()
{
bool minus = false;
int result = 0;
char ch;
ch = getchar();
while (true) {
if (ch == '-')
break;
if (ch >= '0' && ch <= '9')
break;
ch = getchar(... |
#include "test.hh"
using namespace tensor;
template <template <class> class Container>
void IteratorTests() {
Tensor<int32_t, 3, Container> tensor({2, 3, 4});
for (size_t i = 0; i < tensor.dimension(0); ++i)
for (size_t j = 0; j < tensor.dimension(1); ++j)
for (size_t k = 0; k < tensor.dimension(2); ... |
#include<vector>
#include<iostream>
using namespace std;
void mergeTwo(vector<int> &nums,int left,int mid,int right)
{
vector<int> tmp;
int i = left;
int j = mid + 1;
while(i <= mid && j <= right)
{
if(nums[i] <= nums[j])
{
tmp.push_back(nums[i++]);
}
... |
#include <stdio.h>
#include <iostream>
#include <math.h>
#include <algorithm>
#include <memory.h>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <string>
#include <string.h>
#include <vector>
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
const ld PI = acos(-1.)... |
#ifndef ENNEMY_H
#define ENNEMY_H
#include "character.h"
#include <SFML/Graphics.hpp>
using std::string;
class Enemy
{
private:
int life, dmg, speed, currentLife;
int state, cycle;
sf::Image image;
sf::Sprite sprite;
bool isDead;
public:
Enemy(sf::Vector2f position, int life, int dmg, int sp... |
#include<bits/stdc++.h>
using namespace std;
main()
{
int n, arr[5000], m;
printf("Print The Number: ");
while(cin>>n)
{
int carry, j, i, temp;
arr[0]=1;
m=1;
for(i=2; i<=n; i++)
{
int carry=0;
for(j=0; j<m; j++)
{
... |
#pragma once
#include <random>
template<class Type>
struct NormalDistributionGenerator
{
NormalDistributionGenerator(uint32_t seed, Type mean, Type std)
: m_mt(seed)
, m_normalDist(mean, std)
{}
Type operator()()
{
return m_normalDist(m_mt);
}
private:
std::mt19937 m_m... |
/*
Copyright (c) 2015-2022 Xavier Leclercq
Released under the MIT License
See https://github.com/ishiko-cpp/test-framework/blob/main/LICENSE.txt
*/
#include "TopTestSequence.hpp"
namespace Ishiko
{
TopTestSequence::TopTestSequence(const std::string& name)
: TestSequence(TestNumber(), name)
{
}
TopTe... |
#include <iostream>
#include <vector>
int main()
{
std::vector<char> vowels = new std::vector<char>('a', 'e', 'i', 'o', 'u');
std::cout << vowels[0] << "\n";
return 0;
}
|
//Write a C++ program to reverse a number.
#include<iostream>
using namespace std;
int main()
{
int a,b,n;
cout<<"Enter a number:";
cin>>a;
n=a;
while(a!=0)
{
b=b*10+a%10;
a=a/10;
}
cout<<"Reverse of "<<n<<" is "<<b;
} |
#include "../ringbuf/tsc_clock.h"
#include <boost/asio.hpp>
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics/stats.hpp>
#include <boost/accumulators/statistics/min.hpp>
#include <boost/accumulators/statistics/max.hpp>
#include <boost/accumulators/statistics/mean.hpp>
#include <bo... |
#include <stdexcept>
#include <string>
#include <SDL2/SDL_opengles2.h>
#include "engine/vertex_buffer.hpp"
vertex_buffer::vertex_buffer(const std::vector<float> &buffer) {
glGenBuffers(1, &this->buffer_id);
this->bind();
glBufferData(GL_ARRAY_BUFFER, buffer.size() * sizeof(float), buffer.data(), GL_STATI... |
#include "Debug.h"
Debug::Debug() {
file = new std::ofstream();
file->open("log.txt");
}
Debug::~Debug() {
delete file;
}
void Debug::write(std::string toWrite) {
*file << toWrite.c_str();
*file << "\n";
}
|
/*
Driver code for KS0107/S6B0107/SBN6400 compatible LCD drivers that are connected to an Arduino via serial interface.
*/
#include "Drivers/Arduino/KS0107Serial.h"
#include "Arduino.h"
#include <stdint.h>
#include <SPI.h>
#define KS0107_DD_DI_COMMAND 0
#define KS0107_DD_DI_DATA 1
#define KS0107_D... |
#include <new>
#include <unistd.h>
#if defined(__GLIBC__) && !defined(__UCLIBC__)
#include <execinfo.h>
#endif
#include "util/Backtrace.h"
using namespace std;
using namespace BeeeOn;
Backtrace::Backtrace(bool empty)
{
if (empty) {
#if defined(__GLIBC__) && !defined(__UCLIBC__)
m_backtrace_size = 0;
#endif
ret... |
#include<bits/stdc++.h>
using namespace std;
#define MasSize 100
typedef struct{
char data[MaxSize];
int length;
}SqString;
void StrAssign(SqString & s,char cstr[])
{
int i;
for (i = 0;data[i] != '\0';i++)
s.data[i] = cstr[i];
s.length = i;
}
int main()
{
char s[] = "";
return ... |
#include<bits/stdc++.h>
using namespace std;
#define Max 1000005
bool vis[Max];
bool prime[Max];
int num[Max];
char str[20];
bool sel[Max];
void IsPrime() {
prime[0]=prime[1]=0;
prime[2]=1;
for(int i=3; i<Max; i++)
prime[i]=i%2==0?0:1;
int t=(int)sqrt(Max*1.0);
for(int i=3; i... |
// Created on: 2000-08-21
// Created by: Andrey BETENEV
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 a... |
#include "stdafx.h"
#include "GameLog.h"
GameLog* GameLog::instans = nullptr;
GameLog::GameLog()
{
m_logs = new Log[m_logMax];
CVector2 pos = { -630,350 };
for (int i = 0; i < m_logMax; i++)
{
m_logs[i].font = NewGO<FontRender>(0, "fr");
m_logs[i].font->SetTextType(CFont::en_JPLog);
m_logs[i].font->DrawSha... |
#ifndef MENU_H
#define MENU_H
#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "SDL/SDL_ttf.h"
#include <fstream>
#include "CreaMapas.h"
using namespace std;
//seleccion 1 jugar
//seleccion 2 score
//seleccion 3 instrucciones
class Menu
{
public:
int seleccion;
bool terminar, instr, score;... |
#include <iostream>
#include <conio.h>
#include <stdlib.h>
#define MAX 5
using namespace std;
class SetOfStacks
{
private:
int arr[MAX][MAX];
int top[MAX];
int currentStack;
public:
SetOfStacks()
{
currentStack=0;
for(int... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.