text
stringlengths
8
6.88M
#include <iostream> // 为了实现链式操作,将dest的地址也返回 char *strcpy(char *dest, const char *src) { if (dest == nullptr || src == nullptr) { return nullptr; } while ((*dest++ = *src++) != '\0'); return dest; } int main() { char src[7] = "source"; char dest[7]; strcpy(dest, src); std::cout ...
#pragma once #include "Vector2D.h" #include "ColorRGB.h" class casilla { public: void setCen(float x, float y); void vertices(); void dibuja(); int pos; Vector2D centro, A, B, C, D; void setColor(int r, int v, int a); ColorRGB color; };
#pragma once #include <string> using namespace std; class TextPosition { public: size_t const NPOS = string::npos; size_t line = NPOS; size_t col = NPOS; TextPosition() {}; TextPosition(size_t line, size_t col) { this->line = line; this->col = col; } friend bool operator< (const TextPosition& first, co...
#ifndef MAINWIDGET_H #define MAINWIDGET_H #include <QLabel> #include <QBoxLayout> #include <QString> #include <QTabWidget> #include <QComboBox> #include <QPushButton> #include <QTextEdit> #include <QMainWindow> //#include "MainWindow.h" #include "socketmanager.h" #include "json.h" #include "ReadThread.h" class Submi...
/* * Copyright 2016 Freeman Zhang <zhanggyb@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applic...
#include <iostream> #include <math.h> #include <algorithm> #include <deque> #include"LazyLoading.h" using namespace std; int main(int argc, char **argv) { lazy(); return 0; }
//Simple.cpp #include"Simple.h" int Simple::sStaticInt=0; //Initialize static data member Simple::Simple() { //Implementation of constructor } Simple::~Simple() { //Implementation of destructor } void Simple::publicMethod() { //Implementation of public method }
#include <iostream> #include "core/types.h" #include "core/shader.h" #include "core/platform.h" #define STRINGIFY(A) #A using namespace std; uint32_t g_screenWidth = 800; uint32_t g_screenHeight = 600; GLuint g_pointShader; GLuint g_solidShader; //-------------------------------------------------------- // Solid ...
#include <iostream> #include <vector> #include <unordered_map> #include <queue> #include <random> #include <algorithm> #include "BearLibTerminal.h" #include "globals.h" #include "rangen.h" #include "shapes.h" #include "compass.h" #include "room.h" #include "board.h" #include "shooting.h" #include "entity.h" #include "t...
#include <stdio.h> #include <iostream> #include <string> #include <stdlib.h> #include <string.h> using namespace std; void printBit(int value, int size) { bool temp[16]; for (int i = 0; i < size; i++) { temp[size - i] = value % 2; value /= 2; } for (int i = 1; i <= size; i++) { printf("%d", (int)temp[i]);...
// algorithm은 대회에서 사용 가능 // min_element 라는거 있음 잘 사용하셈;; #include<iostream> #include<cmath> #include<algorithm> #define FOR(i,s,e) for(int (i)=(s); (i)<(e);(i)++) using namespace std; const double PI = 3.141593; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int d[3]; int check; long lon...
#include "WorkQueue.h" WorkQueue::WorkQueue(){ } WorkQueue::~WorkQueue(){ }
#include "TileMap.h" TileMap::TileMap(std::wstring tilemapFilename) { TileMap::tilemapFilename = tilemapFilename; isometric = false; } TileMap::~TileMap(void) { } void TileMap::Init() { Entity::Init(); LoadTilemap((wchar_t*)tilemapFilename.c_str()); GenerateMapSystem(); } void TileMap::Update() { Entity:...
#ifndef WHEEL_HH #define WHEEL_HH class wheel { public: wheel(); void spin(); int getCurrentValue(); private: int currentValue; }; #endif // WHEEL_HH
// Problem statement: Given two integers dividend and divisor, divide two integers without using multiplication, division, and mod operator. class Solution { public: int divide(int dvd, int dvs) { if(dvd == 0) return 0; if(dvd <= INT_MIN && dvs == -1) return INT_MAX; if(dvd <= I...
#include <iostream> #include <vector> #include <map> #include <string> #include <bitset> #include <queue> #include <algorithm> #include <functional> #include <cstdio> using namespace std; #define MAX 3001 vector<int> prime(MAX); class MagicStonesStore { void makePrime() { bool isPrime = false; int cnt = 0; ...
#include "MonHoc.h" // Nếu có trả về true // Nếu không trả về false /* Hợp lệ là số nguyên khi: 1. Trong chuỗi không có ký tự gì khác số và khác '-' 2. Dấu '-' chỉ được có 1 dấu duy nhất nằm ở đầu chuỗi Trường hợp dấu "-" "5-": không hợp lệ "5-4": không hợp lệ "--5": không hợp lệ "-5": hợp lệ */ bool KiemTraLaSoNg...
#include "Terminator.h" Terminator::Terminator(string node_name) :Node(node_name) { } Terminator::Terminator(int node_id, string node_name, string node_value):Node(node_id, node_name, node_value) { } Terminator::~Terminator() { } set<string> Terminator::calFirstSet(set<string> called_stack ) { this->firstSet.inse...
#include <bits/stdc++.h> #include <tuple> using namespace std; class UnionNode { public: vector<int> parents; UnionNode(int parent) { parents.push_back(parent); } }; class Union { public: vector<int> rank; vector<int> parents; vector<int> setSize; int numSets; Union(int n)...
#include <boost/lexical_cast.hpp> #include <fstream> #include <iostream> #include <map> #include <string> #include <vector> class SingletonDatabase { std::map<std::string, int> capitals; // 1. Constructor is private! SingletonDatabase() { std::cout << "Initializing database" << std::endl; ...
#ifndef CLASSB_H #define CLASSB_H #include <QObject> #include <QString> class ClassB : public QObject { Q_OBJECT public: ClassB() : m_member("Hello B") { } public slots: void slotDoSomething(); private: QString m_member; }; #endif
#ifndef __VIVADO_SYNTH__ #include <fstream> using namespace std; // Debug utility ofstream* global_debug_handle; #endif //__VIVADO_SYNTH__ #include "jacobi2d_unrolled_2_opt_compute_units.h" #include "hw_classes.h" struct t1_t1_update_0_write0_merged_banks_5_cache { // RAM Box: {[-2, 16], [-1, 16]} // Capacity...
#pragma once #include "Editor.h" // CObjectDialog 对话框 class CObjectDialog : public CDialog { DECLARE_DYNCREATE(CObjectDialog) public: CObjectDialog(CWnd* pParent = NULL); // 标准构造函数 virtual ~CObjectDialog(); // 对话框数据 enum { IDD = IDD_OBJECTS }; protected: virtual void DoDataExchange(CDataExc...
#ifndef _NAME_POOL_H_ #define _NAME_POOL_H_ #include <string> #include <vector> #include <map> class NamePool { public: static NamePool* getInstance(); ~NamePool(); bool Initialize(const char *lpFileName); const char* AllocName(); void FreeName(const char* pName); private: NamePool(); private: struct Item ...
#include <fstream> #include <string> #include <iostream> #include <specex_pypsf.h> using namespace std; specex::image_data specex::PyPSF::get_trace(std::string axis){ if(axis == "x"){ return this->psf->pydata.coeff2d_x; } else{ return this->psf->pydata.coeff2d_y; } } void specex::PyPSF::set_psf( ...
namespace n1 { class ival_box {}; class ival_slider1 : public ival_box, protected BBwidget {}; class ival_slider2 : public ival_box, protected CWwidget {}; } namespace n2 { class ival_box {}; class ival_slider : public ival_box {}; class ival_slider_1 : public ival_slider, protected BBwidget {}; class ival_slider...
#include <stdio.h> #include <algorithm> #include <iterator> #include <unistd.h> #include <errno.h> #include <string> #include <vector> /** Reads the input file with the given path * Careful: This mallocs for lm and wp and expects you to dealloc! */ void read_input_file(const std::string s, double **lm, double **wp, ...
#include "GnSystemPCH.h" #include "GnSingletonManager.h" GnTPrimitiveArray<GnMemoryObject*> GnSingletonManager::mSingletonObjects; GnSingletonManager::GnCreateFuncArray<GnSingletonManager::CreateSingletonFunc>* GnSingletonManager::mCreateFuncs = NULL; GnSingletonManager::GnCreateFuncArray<GnSingletonManager::De...
#pragma once #include "stdafx.h" class CustomReport; class Station; // Class to manage Custom Reports class CustomReportManager { public: CustomReportManager(); virtual ~CustomReportManager(); // Create a custom report based off of the given report config file name bool CreateCustomReport(const string& configFi...
// Created on: 1994-04-01 // Created by: Yves FRICAUD // Copyright (c) 1994-1999 Matra Datavision // Copyright (c) 1999-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 L...
#include<iostream> #include<vector> #include<map> #include<string> using namespace std; class Solution { public: vector<int> findSubstring(string s, vector<string>& words) { //简化版:滑动窗口+哈希表 vector<int> res; if(words.size()==0) return res; map<string,int> Map; for(auto word:words) Map[word]++; int wle...
#include <iostream> using namespace std; int n; int sets[10]; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cin >> n; if(n == 0){ cout << 1 << '\n'; return 0; } while(n){ int tar = n % 10; n /= 10; sets[tar]++; } sets[6] = ((sets[6]+s...
// -*- LSST-C++ -*- /* * LSST Data Management System * Copyright 2014-2015 AURA/LSST. * * This product includes software developed by the * LSST Project (http://www.lsst.org/). * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as publ...
#include "DefaultHeaderFiles.h" Player::Player() { x = 30; y = 30; row = 3; col = 3; speedX = 1; speedY = 1; color = YELLOW; bulletType = STRAIGHT; updateDelayDuration = 60; enableShooting = false; score = 0; life = 5; shootDelayTimer = 0; shootDelayDuration = ...
#include "bhand_motors.h" #include <ctype.h> #include <string.h> void toMotorChar(BHMotors bhMotors, char *chMotors) { if (bhMotors != 15) { if ((bhMotors & 7) < 7) { if (bhMotors & 1) *(chMotors++) = '1'; if (bhMotors & 2) *(chMotors++) = '2'; if (bhMotors & 4) *(chMotors++) = '3'; }...
//===-- program.cpp - OpenCL Program ----------------------------*- C++ -*-===// // // TODO (Zhongliang): Add a license. // //===----------------------------------------------------------------------===// /// /// \file /// \brief This file contains the implementation of OpenCL program functions and /// APIs. /// //===-...
#include "stdafx.h" #include "client.h" #include <random> #include <ctime> #include "server.h" #define DRI_IS_CLIENT #include "interface.h" using namespace boost; class Client : public rpc::ClientPeer<Interface> { shared_ptr<Interface> conn; string expecteds[6]; public: void on_connected( const bo...
#ifndef QFORM1_H #define QFORM1_H #define LED_TOP 0 #define LED_BOTTOM 1 #define LED_LEFT 2 #define LED_RIGTH 3 #include <QMainWindow> #include <QTimer> #include <QtMath> #include "qpaintbox.h" #include "qserial.h" namespace Ui { class QForm1; } class QForm1 : public QMainWindow { Q_OBJECT public: explic...
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ #ifndef cmCTestResourceSpec_h #define cmCTestResourceSpec_h #include <map> #include <string> #include <vector> class cmCTestResourceSpec { public: class Resource { ...
//interfaces de las clases #include "prestamos.h" using namespace std; //FUNCIONES DE CLASE //constructor de la clase prestamo prestamo::prestamo(void) { strcpy(datos.cedula,""); strcpy(datos.codigo,""); fecha* fec = new fecha(); fec->copiar_en(datos.fecha_pre); fec->copiar_en(datos.fecha_ent); strcpy(datos.nota,...
#include "std_lib_facilities.h" int main () { //bekéri a nevet cout<< "Enter the name of the person you want to write to\n"; string name; cin>> name; //bekéri egy barát nevét cout<< "Please enter the name of a mutual friend\n"; string friend_name; cin>> friend_name; //bekéri a barát nemét és megadja ...
#include <iostream> using namespace std; int value[20]; int coin_check[20] = { 0 }; int main() { int N, K; int coin_count = 0; cin >> N >> K; for (int i = 0; i < N; i++) { // 시간 복잡도 O(N) cin >> value[i]; } while (K>0) { for (int i = N-1; i >=0; i--) { // 시간 복잡도 O(N-1 * 동전 갯수) if (value[i] <= K) { ...
#include <QtCore/QCoreApplication> #include "downloadmanager.h" #include "updatemanager.h" int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); DownloadManager manager; HashChecker checker; UpdateManager updatemgr(&manager, &checker); updatemgr.StartUpdate(); //QObject::connec...
//知识点:模拟 /* By:Luckyblock 题意给定了详细的模拟方案 由于数据范围较小, 直接按照题意进行模拟即可 详见注释 */ #include<cstdio> #include<iostream> #include<ctype.h> const int MARX = 1e5+10; //============================================================= std::string name[MARX];//存姓名 int n,m,ans=1,dir[MARX];//存朝向 //=========================...
#include<iostream> using namespace std; class node { public: int data; class node *next; }; class matrix:public node { public: node *head; node *temp; int n,x,r,c,i; matrix() { cout<<"Enter no. of rows:\n"; cin>>r; cout<<"Enter no. of coloumns\n"; cin>>c; n=r*c; } void getmatrix() { node *temp...
/* -*- 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 SELECTION_H #define SELECTION_H #include "modules/logdo...
#include "GnScreenMeshPCH.h" #include "GnScreenMeshObject.h"
// ************************************** // File: KProfile.h // Copyright: Copyright(C) 2013-2017 Wuhan KOTEI Informatics Co., Ltd. All rights reserved. // Website: http://www.nuiengine.com // Description: This code is part of NUI Engine (NUI Graphics Lib) // Comments: // Rev: 2 // ...
//============================================================================ // Name : MoneyCounter.cpp // Author : Brett Bailey // Description : //============================================================================ #include <iostream> #include <string> #include <cstdlib> using namespace std; c...
#include <iostream> #include <fstream> #include <math.h> //a) Se citeşte de la tastatură un număr natural N. //Se consideră o tablă (matrice) pătratică de dimensiuni 2N*2N //pe care se scriu numerele naturale de la 1 si 2N*2N prin vizitarea //recursivă a celor patru cadrane ale tablei în ordinea indicată şi //în figu...
#pragma once #include <string> #include <vector> class ReadFile { private: std::string FileName; std::vector<std::string> FileVector; ReadFile() = delete; public: ReadFile(const std::string &file); ~ReadFile(); inline std::string GetFileName() const { return FileName; } std::vector<...
// // Created by Noam pnueli on 2/12/17. // #ifndef PHYSICSENGINE_CONSTRAINTS_H #define PHYSICSENGINE_CONSTRAINTS_H #include "math_2d.h" class Constraint { static vector2d get_constraint_force(double lagrange_multiplier, vector2d& p) { return p * lagrange_multiplier; } }; class ZeroConstraint :...
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ c...
#include <iostream> #include <iomanip> #include <bitset> #include "stegan.h" //#include <QDebug> using namespace std; vector<unsigned char> EncryptBMP(vector<unsigned char> data,vector<unsigned char> wareh) { vector<unsigned char>::iterator warehIt = wareh.begin(); vector<unsigned char>::iterator dataIt = da...
////////////////////////////////////////////////////////////////////////////////// // Generates gamma-gamma distributions from histograms created by GenerateHistogram // // Author: Connor Natzke (cnatzke@triumf.ca) // Creation Date: Tuesday May 12, 2020 T14:41:17-07:00 // Last Update: Tuesday May 12, 2020 T14:...
#include "ListaD.h"
#include <vector> #include <queue> #include <cassert> #include <iostream> #include <algorithm> #include <list> #include <string> #include <memory> using namespace std; class Graph_matrix { public: typedef vector<int>::iterator Vint_iter; typedef vector<vector<bool>> Vbool_2d; typedef vector<int> ...
#include "utils.hpp" int main(int argc, char** argv) { using namespace xlsxconverter; using namespace xlsxconverter::utils::dateutil; bool ok; size_t p; int y, m, d, h, i, s, ms, zh, zm; std::tie(ok, y, m, d, p) = parse_date("1970-01-01"); std::tie(ok, h, i, s, ms, p) = parse_time("1:02:3")...
int val[4*MAX]; int vet[MAX]; int N; int merge(int a, int b){ return max(a, b); } void build(int i=1, int j=N, int no=1){ if(i==j){ val[no]=vet[i]; return; } int meio = (i+j)/2; build(i, meio, no<<1); build(meio+1, j, no<<1|1); val[no]=merge(val[no<<1], val[no<<1|1]); } ...
#pragma once #include <stdio.h> #include <tchar.h> #include <GL/glew.h> #include <glm/glm.hpp> #include <glm/ext.hpp> #include <vector> #include <math.h> using namespace std; using namespace glm; //float scalar_product(vec3 vector1, vec3 vector2) { // return (vector1[0] * vector2[0] + vector1[1] * vector2[1] + vector...
#include <Timers.h> #include <SM.h> #include <State.h> #include <Pulse.h> State Overall_Start(); State Overall_FindRightBinIR(); State Overall_ApproachBinLine(); State Overall_DriveBy(); State Overall_ApproachTheForce(); State Overall_LoadForce(); State Overall_DetermineDumpSide(); State Overall_DumpRightSide(); Stat...
#include "ofApp.h" //-------------------------------------------------------------- void ofApp::setup(){ receiver1.setup(PORT1); receiver2.setup(PORT2); ofSetWindowTitle("Receiver App"); //load gif gifloader1.load("gif5.gif"); gifloader2.load("gif2.gif"); //set background color ...
#include <ros/publication.h> #include <ros/publisher.h> #include <ros/forwards.h> #include <ros/subscriber_link.h> #include <ros/topic_manager.h> #include <iostream> #include <dlfcn.h> namespace ros { static void (Publication::*real_publish)(SerializedMessage& m) = nullptr; void Publication::publish(SerializedMess...
#include <string.h> #include <netinet/in.h> #include "mutiplex/ByteBuffer.h" #include "Debug.h" #include <stdlib.h> #include <assert.h> namespace muti { ByteBuffer::ByteBuffer(int capacity) : limit_(capacity), mark_(-1), position_(0) { assert(capacity > 0); int cap = htonl(capacity); data...
#include <direct.h> #include <fstream> #include <cstring> #include <iostream> #include <math.h> #include <random> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <vector> #include <conio.h> #pragma warning(disable : 4996) #define yugu 50000 #define peiwei 40 using namespace std; char a[120][3] = { "...
#include "Node.h" #include <stdio.h> #include <math.h> #include <stdlib.h> #include <time.h> #define PAI 3.141592654 #define DELTATIME 0.000001 double reflectx(double angle){ if(angle>=0){ return(PAI-angle); }else{ return(-PAI-angle); } } double reflecty(double angle){ return(-angle); } dou...
#include "coups.h" void afficheNbCoups(SDL_Surface *ecran, int nbCoups) { char coups[3] = ""; SDL_Surface *texte; SDL_Surface *font; SDL_Rect positionNbCoups ; SDL_Rect positionSurface ; TTF_Init(); TTF_Font *police = NULL; sprintf(coups, "%d", nbCoups); police = T...
//-------------------------------------------------------- // musket/include/musket/device.hpp // // Copyright (C) 2018 LNSEAB // // released under the MIT License. // https://opensource.org/licenses/MIT //-------------------------------------------------------- #ifndef MUSKET_DEVICE_HPP_ #define MUSKET_DEVICE_HPP_ #...
#ifndef COMMON_H #define COMMON_H #include <cstdint> #include <list> #include <memory> #include <stdexcept> #include <string> #include <glad/glad.h> #include <GLFW/glfw3.h> #include <Logger.h> #define UNUSED(x) ( (void)(x) ) #define BUFFER_OFFSET(x) ( reinterpret_cast<const void *>(x) ) namespace utils { std::str...
#pragma once #include "Product.h" class ElecProduct : public Product{ private : int m_nVoltage; public : ~ElecProduct() { cout << "elec 소멸자 호출" << endl; } ElecProduct(const char* name = "", key productCode = 0, price Price = 0, int voltage = 220) : Product(name, productCode, Price), m_nVoltage(voltage) { ...
//--------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include <tchar.h> //--------------------------------------------------------------------- USEFORM("UI\FrmSourceEdit.cpp", SourceEditFrm); USEFORM("UI\FrmPlugin.cpp", PluginFrm); USEFORM("UI\FrmSourceGenDesign.cpp"...
#include<iostream> #define N 100 using namespace std; struct BiNode{ int data; BiNode *lchild,*rchild; }; class BiSortTree{ private: BiNode *root; //根 void InOrder(BiNode *bt); //中序遍历 void Release(BiNode *bt); //释放二叉树 BiNode *SearchBST(BiNode *&bt,int k);//查找 public: void InsertBST(BiNode ...
#pragma once #include "User.h" #include "DbConnection.h" #include "DLLDefines.h" #include <map> class EXPORT UserGateway { private: int64_t generateNextId(); DbConnection& connection; public: UserGateway(DbConnection& connection); void CreateUsersTable(); void createNewUser(User* user); void updateUser(User* d...
//Phoenix_RK /* https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/ Say you have an array prices for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete as many transactions as you like (i.e., buy one and sell one share of the...
// // Created by pedro on 16-05-2019. // /* * Copyright (c) 2019 Intel Corporation * * This work is licensed under the terms of the MIT license. * For a copy, see <https://opensource.org/licenses/MIT>. */ /* System Includes */ #include "PclVisualizer.h" #include <string> #include <stdio.h> #include <stdlib.h> #i...
#ifndef MYQPUSHBUTTON_H #define MYQPUSHBUTTON_H #include <QObject> #include <QWidget> #include <QPushButton> #include <QString> class MyQPushButton : public QPushButton { Q_OBJECT public: MyQPushButton(const QString &text, QWidget * parent = 0); public slots: void buttonClicked() { emit sendtex(t...
/* XMRig * Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh> * Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * ...
#ifndef ARETE_H #define ARETE_H #include <QGraphicsItem> #include <QInputDialog> class Sommet; class Graphe; class QGraphicsLineItem; class QGraphicsScene; class QRectF; class QGraphicsSceneMouseEvent; class QPainterPath; class Arete : public QGraphicsItem { public: Arete(Sommet *sourceNode, Sommet *destNode,Graphe...
#ifndef _SetServerInfoProc_H #define _SetServerInfoProc_H #include "CDLSocketHandler.h" #include "IProcess.h" class SetServerInfoProc :public IProcess { public: SetServerInfoProc(); virtual ~SetServerInfoProc(); virtual int doRequest(CDLSocketHandler* clientHandler, InputPacket* inputPacket, Context* pt ) ;...
#include <chrono> #include <cmath> #include <cstdio> #include <iostream> #include <vector> class BoundaryLayer { private: //気体パラメータ const double rou0_ = 1.225; //密度 const double t0_ = 293.5; //温度 const double visc_ ...
#include "cbt/behavior.hpp" #include "cbt/behavior/continuation.hpp" #include "cbt/behavior/continues.hpp" #include <cassert> namespace cbt { auto continues::up(continuation&& c, status s) noexcept -> continues { continues x; x._continue = std::move(c); x._status = s; return x; } auto continues::down(behavior co...
#include <bits/stdc++.h> using namespace std; string palabra; int T, K; void muevele(){ string nuevaPalabra = "", repetida = ""; char letra; int tamanio = palabra.size(); long long int nuevoTamanio =0, repeticiones = 0; bool repetir = false; bool sePudo = true; for(int i=0...
#include<iostream> #include<cstdio> #include<algorithm> #include<vector> using namespace std; bool comp(pair<int, string>a,pair<int,string>b) { return a.first < b.first; } main() { vector<pair<int, string> >v; int wide, length, height, i, test, n, cou=1; string name; cin>>test; while(test--) ...
#include "glut.h" #include <GL/gl.h> #include <GL/glu.h> float angle_1 = 0, angle_2 = 0, angle_3 = 0; float trans = 0.3; void MyDisplay() { glClear(GL_COLOR_BUFFER_BIT); glViewport(0, 0, 1000, 1000); glColor3f(0.0, 0.0, 1.0); glMatrixMode(GL_MODELVIEW); //수성 glPushMatrix(); glRotatef(angle_...
class Category_517 { class GNT_C185U_DZ { type = "trade_any_vehicle"; buy[] = {4,"ItemGoldBar10oz"}; sell[] = {2,"ItemGoldBar10oz"}; }; class GNT_C185_DZ { type = "trade_any_vehicle"; buy[] = {4,"ItemGoldBar10oz"}; sell[] = {2,"ItemGoldBar10oz"}; }; class GNT_C185R_DZ { type = "trade_any_vehicle"; ...
class Solution { public: int maxProfit(vector<int>& prices) { int prof = 0, currProf = 0; for(int i = 1; i < prices.size(); ++i){ currProf = max(0, prices[i] - prices[i-1]); prof += currProf; } return prof; } };
#include <vector> #include <string> #include <iostream> #include <fstream> #include <sstream> #include <list> #include <algorithm> #include <sstream> #include <set> #include <cmath> #include <map> #include <stack> #include <queue> #include <cstdio> #include <cstdlib> #include <cstring> #include <numeric> #include <bits...
#pragma once #ifndef _LR_ANALYZE_H_ #define _LR_ANALYZE_H_ #include <iostream> #include <iomanip> #include <vector> #include "AppContext.h" #include "LexicalAnalysis.h" #include "InitApp.h" using namespace std; struct Node { size_t status; Symbol symbol; }; class LRAnalyze { private: //分析程序配置 AppContext context...
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- */ #ifndef ES_PROPERTY_TABLE #define ES_PROPERTY_TABLE #include "modules/ecmascript/carakan/src/util/es_hash_table.h" #include "modules/ecmascript/carakan/src/kernel/es_box.h" #ifdef DEBUG_ENABLE_OPASSERT struct ...
#include <vector> #include <iostream> void test0() { char* mem = static_cast<char*>(malloc(100)); bool* ptr = reinterpret_cast<bool*>(mem + 1); } int main() { test0(); return 0; }
#include <iostream> #include <cassert> #include <vector> #include <functional> using std::vector; int binary_search(const vector<int> &a, int x) { std::function<int(int,const vector<int> &,int,int)> internal_search; internal_search = [&](int x, const vector<int> &a, int l, int r) -> int { if(r <= l) { ...
// // Created by abel_ on 31-10-2022. // #include<iostream> using namespace std; // base class class Device{ public: Device(){ cout << "Device constructor" << endl; } ~Device(){ cout << "Device destructor" << endl; } }; // derived class class MobileDevice : public Device{ public: M...
#pragma once #include "basis.hpp" namespace Time { double Integrate(const std::function<double(double)>& f, const Element1D& elem, size_t degree); } // namespace Time
#include <QDateTimeEdit> #include <QTimer> #include <QLabel> #include <QHBoxLayout> #include "samclock.h" SamClock::SamClock( QWidget* parent ) : QWidget( parent ) { edit = new QDateTimeEdit( this ); edit->setDisplayFormat( "dd.MM.yyyy h:mm:ss AP" ); secondsLeft = new QLabel( this ); QHBoxLayout* ...
#include "cmudef.h" #include <stdio.h> #include "fssimplewindow.h" #include "ysglfontdata.h" #include "yspng.h" GAMECONTROL::GAMECONTROL() :timer(0),Lives(20),ProjectionX(0),ProjectionY(600) ,key(0),TotMoney(30),NumMonster(0) ,MouseEvent(0),Click(NOACTION),InsPtr(0) { Color1=1.0; Color2=1.0; Color3=1.0;...
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <vector> int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0); int n; std::cin >> n; std::priority_queue<int, std::vector<int>> maxHeap; std::priority_queue<int, std::vect...
// // Created by Masayuki IZUMI on 5/9/16. // #include <OpenNI.h> const float getFocalLength(openni::VideoStream *stream) const { int frameWidth = stream->getVideoMode().getResolutionX(); float hFov = stream->getHorizontalFieldOfView(); return frameWidth / (2.0f * tan (hFov / 2.0f)); } const openni::VideoMode...
/************************************************************************************************* ** Author: Chris Matian ** Date: 08/08/2017 ** Description: This is the header and class definition file for starting the game and creating a new board. ******************************************************************...
/* * CaptureModes.cpp * * Created on: May 26, 2016 * Author: bakhvalo */ #include "gtest/gtest.h" #include <type_traits> #include <vector> #include <functional> #include <memory> namespace { using filters = std::vector<std::function<bool(int)>>; void addLambdaReferenceMode(filters& f) { int divisor =...
#include "Decrypt.h" #include <tclap/CmdLine.h> int main(int argc, char *argv[]) { auto args = parseCMD(argc, argv); CImg<PTYPE> apparent(args["apparent"].c_str()); int key = 0; if (args["signature"] == "true") { key = getKey(apparent); } else { key = std::stoi(args["key"]); } bool soleImage; istringstr...