text
stringlengths
8
6.88M
#include<bits/stdc++.h> using namespace std; class Student{ private: int age; public: int rno; //Default Constructor. Student(){ cout << "Default Constructor is Called !" << endl; } //Parameterized Constructor with one parameter. Student(int rno){ cout << "Parameterized Constructor with 1 para...
/*-----------------UDP客户端------------------------------------ ------------接受UDP服务器的广播并显示广播信息 ------------如果是“点名”命令,则回传自己的学号和姓名--------*/ #include "Winsock2.h" #include "stdio.h" #include "string.h" #pragma comment(lib,"wsock32.lib") #define SEND_PORT 3000 //发送端口 #define RECV_PORT 3001 //接收端口 SOCKET sock; soc...
#include <iostream> #include <vector> #include <fstream> using namespace std; struct Muchie { int varf_i, varf_f; double cost; }; Muchie Muchie_minima( int m, Muchie *Muchii, int *vizitat ) { Muchie m_minim = {0,0,0}; int x, y; double cost_minim = 35000; for(int i = 0 ; i < m; i++ ) { ...
#ifndef SMS_RECEIVER_H_ #define SMS_RECEIVER_H_ // INCLUDES #include <e32base.h> #include <es_sock.h> // RSocketServ #include <f32file.h> // RFs // LIBS // esock.lib (RSocketServ), smsu.lib (TSmsAddr), gsmu.lib (CSmsBuffer), // efsrv.lib (RFs), estor.lib (RSmsSocketRea...
// MicroVoiceLiteDlg.h : 头文件 // #pragma once #include "afxwin.h" // CMicroVoiceLiteDlg 对话框 class CMicroVoiceLiteDlg : public CDialog { // 构造 public: CMicroVoiceLiteDlg(CWnd* pParent = NULL); // 标准构造函数 // 对话框数据 enum { IDD = IDD_MICROVOICELITE_DIALOG }; protected: virtual void DoDataExchange(...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** Copyright (C) 1995-2007 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 VEGA_SUP...
// 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 <iostream> #include <cstdio> #include <queue> #include <binary_search_tree.h> BST::~BST(){ CleanAll(); } void BST::CleanAll(){ if(root == NULL){ return; } std::queue<BSTNode*> printed_queue; printed_queue.push(root); while(!printed_queue.empty()){ BSTNode* current_no...
#include <bitset> #include <boost/log/trivial.hpp> #include "subgraph.hpp" int FindMaxIndependentSubGraph(const SubGraph &graph); int FindMaxIndependentSetInConnectedSubGraph(const SubGraph &graph) { if (graph.VerticesCount() < 2) { return 1; } auto degrees = graph.GetVerticesDegrees(); std:...
#include "Transform2DComponent.hpp" Transform2DComponent::Transform2DComponent(Entity* parent) : Transform2DComponent(parent, {0.0F, 0.0F}, 0.0F, {1.0F, 1.0F}) {} Transform2DComponent::Transform2DComponent(Entity* parent, vec2 position) : Transform2DComponent(parent, position, 0.0F, {1.0F, 1.0F}) {} Transfor...
#include <QDataStream> #include <QByteArray> #include <QBuffer> #include "wevent.h" #include "wmessage.h" #include "wsetid.h" #include "wnickrequest.h" #include "wnickresponse.h" #include "wclientlist.h" #include <iostream> using std::cout; using std::endl; WEvent::WEvent(quint64 senderId_p, typeId eventType_p): ...
#ifndef CREQUESTXMLMESSAGE_H #define CREQUESTXMLMESSAGE_H #include "CMessage.h" #include <QObject> //ÇëÇóXMLÏûÏ¢ class CRequestXmlMessage : public CMessage { Q_OBJECT public: CRequestXmlMessage(CMessageEventMediator* pMessageEventMediator, QObject *parent = 0); ~CRequestXmlMessage(); virtual void packedSendMess...
// Replace all pi in a string with 3.14 using rec. #include<iostream> using namespace std; void replaceAllPi(char a[],int i) { // base case if(a[i]=='\0' || a[i+1]=='\0') return; // Look for pi for current location if(a[i]=='p' && a[i+1]=='i') { int j=i+2; // take j to the end of the array while(a[j]!='...
// overlap_eigensystem_template_device.h // Andrei Alexandru // Dec 2003 #include "complex.h" #include "overlap.h" #include "../eigensystem/arnoldi.h" #include "cpu_vector.h" #include "layout.h" #include "defines.h" #include "small_eigenvalues.h" #include "random_vectors.h" #include "overlap_eigensystem_template.h" n...
// // Created by 邦邦 on 2022/4/22. // #ifndef BB_TIME_H #define BB_TIME_H #include <thread> namespace bb{ class Time{ static void test_(const int &second){ //process_time/60 //距离现在的分钟数 //process_time/3600 //距离现在的小时数60*60 //process_time/86400 //距离现在的天数60*60*24 ...
class Category_51 { class ItemSilverBar { type = "trade_items"; buy[] = {1,"worth"}; sell[] = {1,"worth"}; }; class ItemSilverBar2oz { type = "trade_items"; buy[] = {-1,"worth"}; sell[] = {2,"worth"}; }; class ItemSilverBar3oz { type = "trade_items"; buy[] = {-1,"worth"}; sell[] = {3,"worth"}; }...
#ifndef _TASK_QUEUE_I_ #define _IASK_QUEUE_I_ #include <list> #include <vector> using namespace std; namespace ff { typedef void(*task_func_t)(void *); class task_impl_i { public: virtual ~task_impl_i(){} virtual void run()=0; virtual task_impl_i *fork()=0; }; class task_impl_t:public task_impl_i { }; s...
// $Id$ #ifndef MESSAGEQ_H #define MESSAGEQ_H #define MAX_MESSAGE_LENGTH 100 typedef struct MessageFormat { long message_type; char mess[MAX_MESSAGE_LENGTH]; } tMessageFormat; class CMessageQueue { public: CMessageQueue(); ~CMessageQueue(); void Send(tMessageFormat* message, int messa...
#include "ObjLoader.h" #include <iostream> #include <fstream> #include <sstream> #include <string> #include <map> #include <sstream> #include <GLGraphics/ResourceLoader.h> using namespace std; using namespace CGLA; using namespace Mesh; namespace Mesh { Vec3f to_vec3(istringstream &iss){ float x,y,z; if (is...
#include <string> #include <cmath> using namespace std; /** * Just find the regular pattern, - * and solve this problem by math equation; */ class Solution { public: #define INSPECT(s, pos) \ if (pos < s.length()) { \ result.append(1, s.at(pos)); \ } string convert(string s, int numRows) { ...
#include "marcadores.h" marcadores::marcadores(QWidget* parent) : QDialog(parent) { this->setWindowTitle("Marcadores"); } marcadores::~marcadores() { }
/* RABIN KARP ALGORITHM -> Rabin Karp Algorithm matches the hash value of pattern to hash value of substring of text sliding by one. -> here, we find the hash value of each substring by sliding by one in O(1) time. -> When the hash value Matches we compare the each character of pattern to text. -> I...
#include <Poco/Event.h> #include <Poco/Exception.h> #include <Poco/Thread.h> #include <exception> #include <cppunit/extensions/HelperMacros.h> #include "util/SequentialAsyncExecutor.h" #define MAX_WAIT_TIME 10000 // 10 seconds in ms using namespace std; using namespace Poco; namespace BeeeOn { class SequentialAs...
#include "pch.h" #include "DBUser.h" DBUser::DBUser() { } DBUser::~DBUser() { } BOOL DBUser::Begin(VOID) { CThreadSync Sync; mIsConnected = FALSE; ZeroMemory(ID, sizeof(WCHAR) * 32); return CPacketSession::Begin(); } BOOL DBUser::End(VOID) { CThreadSync Sync; mIsConnected = FALSE; ZeroMemory(ID, sizeof(CHA...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2007 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. */ #ifndef ACCESSIBLEDOCUMENT_H #define ACCESSIBLEDOCUMENT_H #ifdef...
#ifndef __GAME_SCENE_H__ #define __GAME_SCENE_H__ #include <cocos2d.h> #include "BackgroundLayer.h" #include "GameLayer.h" #include "OptionLayer.h" #include "StatusLayer.h" using namespace cocos2d; class GameScene : public Scene { public: GameScene(){} ~GameScene(){} virtual bool init(); CREAT...
/* * z_example.cpp * * Created on: 11 Feb 2013 * Author: lukasz.forynski * * This file contains eample uses of jsmnrpc_tiny and is a mix of C and C++ * (mostly for convenience). */ #include "jsmnrpc.h" #include <string.h> #include <iostream> #include <sstream> #include <ctime> #include <vector...
#include <deque> #include <fstream> #include <iostream> #include <string> #include <dirent.h> #include <unistd.h> #include <sys/stat.h> #include <sys/types.h> #include <tbb/parallel_for.h> using namespace std; int main() { ifstream fin; string dir, filepath; DIR *current_dir; struct dirent *dir_entr...
//======include header====== #include "Board.h" //======const section======= const char enemy = '%'; const char coin = '*'; const char player = '@'; //===============C-TORS=============== Board::Board() { curr_level = 0; std::string str; // temporary string which we push into the vector; std::ifstream file; ...
#include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/nonfree/features2d.hpp> #include <opencv2/nonfree/nonfree.hpp> #include <iostream> #include <jni.h> #include <android/log.h> #include <vector> #include <fstream> #include <string.h> using namespace cv; using namespace s...
#pragma once #include "SingletonBase.h" // 전방 선언한 이유 // 원래 헤더에 include 하는게 좋은 방법이 아님 // 웬만해서는 헤더에 include 안하는게 좋음 /* GameNode에서 이미지 include 하고 이미지에서 게임노드 include 하면 왓다갓다 하게 되서 터짐 보통은 cpp에 선언 후 헤더에 전방 선언하는 방법을 씀 */ class GameNode; class SceneManager : public SingletonBase<SceneManager> { private: typedef map<string, G...
// MyExtenDllDlg.cpp : 实现文件 // #include "stdafx.h" #include "MyExtenDll.h" #include "MyExtenDllDlg.h" #include "afxdialogex.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // 用于应用程序“关于”菜单项的 CAboutDlg 对话框 class CAboutDlg : public CDialogEx { public: CAboutDlg(); // 对话框数据 enum { IDD = IDD_ABOUTBOX }; protected: ...
#include "login.h" #include "ui_login.h" login::login(QWidget *parent) : QWidget(parent), ui(new Ui::login) { ui->setupUi(this); } login::~login() { delete ui; } void login::on_showhide_pressed() { ui->password->setEchoMode(QLineEdit::Normal); } void login::on_showhide_releas...
#pragma once class DropEgg : public GameObject { public: DropEgg(); ~DropEgg(); bool Start() override; void Update() override; void OnDestroy() override; MonsterID GetMonsterID() { return m_monsterId; } wchar_t* GetMonsterName(){ return m_monsterName; } void SetDropMonster(MonsterID id) { m_monsterId = ...
#include <cmath> #include <vector> #include "lambert.h" std::vector<double> boundingVelocities(double grav_param, std::vector<double> r0, std::vector<double> rf, double dt, bool long_way) { // algorithm constants const int MAXITER = 1000; const double TOLERANCE = 1E-10; // switch to canonical units double scale...
#include "MotorBike.h" void MotorBike::printPosition() { std::cout << "The motorbike's position is "; BaseObject::printPosition(); } void MotorBike::move(Position newPosition) { DynamicObject::move(newPosition); std::cout << "The motorbike has been moved to new position "; BaseObject::printPosition(); }
//Midterm Programming Test #include <iostream> //inclusion of support for doing input & output #include <cmath> //inclusion of support for doing random number generation #include <cctype> //inclusion of support for character conversion #include <vector> using namespace std; //declare access to standard ...
#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...
/////////////////////////////////////////////////////////////////////////// // Copyright (C) 2009 Whit Armstrong // // // // This program is free software: you can redistribute it and/or modify // // it under the ...
#include <stdio.h> #define MAX 45 int F[MAX]; int fibonacci(int n){ if(F[n] != -1) return F[n]; if(n == 0 || n == 1){ F[n] = 1; }else{ F[n] = fibonacci(n-1) + fibonacci(n-2); } return F[n]; } int main(void){ int n, f; scanf("%d", &n); for(int i=0; i<=n; i++){ F[i] = -1; } f = fibonacci...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2012 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Kajetan Switalski ** */ #include "core/pch.h" #ifdef USE_SPDY...
/** Kabuki SDK @file /.../Source/Kabuki_SDK-Impl/_G/Caption.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 */ #include "_G/Cell.h" #include "_G/Caption_f.h" namespace _G { ...
#include "common.h" #include "CRequestXmlMessage.h" #include "Markup.h" #include "CMessageEventMediator.h" #include "NetClass.h" #include <QSettings> #include <QTextCodec> CRequestXmlMessage::CRequestXmlMessage(CMessageEventMediator* pMessageEventMediator, QObject *parent) : CMessage(pMessageEventMediator, parent) { }...
#include "kmp.h" #include "kmp_io.h" #include "kmp_wrapper_malloc.h" #include <sicm_low.h> static void *h_sicm; static sicm_device_list (*p_sicm_init)(void); static sicm_arena (*p_sicm_arena_create)(size_t, int, sicm_device_list *); static void (*p_sicm_arena_destroy)(sicm_arena arena); static sicm_device *(*p_sicm_...
#include <iostream> #include <sstream> #include <vector> #include <list> #include <queue> #include <algorithm> #include <iomanip> #include <map> #include <unordered_map> #include <unordered_set> #include <string> #include <set> #include <stack> #include <cstdio> #include <cstring> #include <climits> #include <cstdlib> ...
/** * created: 2013-4-9 15:29 * filename: FKLuaBase * author: FreeKnight * Copyright (C): * purpose: */ //------------------------------------------------------------------------ #pragma warning(disable:4127) //------------------------------------------------------------------------ #include "../Include/Scri...
/* * **************************************************************************** * * * * * Copyright 2008, xWorkshop Inc. * * * All rights reserved. * *...
#ifndef SetupConstruction_h #define SetupConstruction_h 1 /*! @file SetupConstruction.hh @brief Defines mandatory user class SetupConstruction. @date September, 2015 @author (D. Flechas dcflechasg@unal.edu.co) @version 1.0 In this header file, the 'physical' setup is defined: materials, geometries and po...
#pragma once namespace settings { class Setting; static const int FLAG_VIRTUAL = 1; static const int FLAG_READONLY = 2; static const int FLAG_MANAGE_MEM = 4; typedef bool (* setFunction)(Setting* setting, void* value); typedef bool (* getFunction)(Setting* setting, void** value); enum { TYPE_STRING, ...
#include "SdLongNameFile.h" // Search for the first file in a directory given by is base class // // parameters: // SdBaseFile * dirPath : the directory we want to scan // // return: // true if found, false if not boolean SdLongNameFile::first( SdBaseFile * dirPath ) { p_sdbf = dirPath; p_sdbf->rewind(); re...
#include <string> #include <cctype> #include <vector> #include <stdexcept> template <class T> std::string to_str(T&& x){ std::ostringstream buf; buf << x; return buf.str(); } template <class... Types> std::string format(std::string x, Types&&... t){ std::vector<std::string> args = {to_str(std::forwar...
#ifndef G2O_TARGET_TYPES_6D_HPP_ #define G2O_TARGET_TYPES_6D_HPP_ #include <g2o/core/base_vertex.h> #include <g2o/core/base_binary_edge.h> #include <g2o/core/base_unary_edge.h> #include <Eigen/Core> using namespace g2o; typedef Eigen::Matrix<double,6,1> Vector6d; typedef Eigen::Matrix<double,6,6> Matrix6d...
#pragma once #include <map> class DResource; class DManager { public: std::map<std::string, DResource *> m_mapResource; public: DManager(); virtual ~DManager(); DResource *Create(std::string name); DResource *Find(std::string name); void Delete(std::string name); };
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 ** ** Copyright (C) 1995-1999 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" #include "modules/dom/src/domglobaldata.h" ...
#ifndef __CCGREEPAYMENT_H__ #define __CCGREEPAYMENT_H__ #include <string.h> #include "GreeExtensionMacros.h" #include "cocoa/CCString.h" #include "cocoa/CCArray.h" NS_CC_GREE_EXT_BEGIN class CCGreePayment; class CCGreePaymentDelegate { public: virtual void paymentRequestSuccess(CCGreePayment *payment, int re...
#include "reorderingbuffer.h" #include <iostream> #include <algorithm> using namespace std; #include <unistd.h> void ReorderingBuffer::addBlock(uint32_t stream_idx, uint32_t global_idx, std::shared_ptr<trevi::SourceBlock> sb) { // If the idx is far enough, reset buffer and start clean... // If the current...
#pragma once #include <ionir/construct/construct.h> namespace ionir { template<typename T = Construct> // requires std::derived_from<T, Construct> // TODO: Cannot work in the current system because ConstructWithParent<T> is used where T is a forward decl. struct ConstructWithParent : Construct { ...
// // Window.cpp // Odin.MacOSX // // Created by Daniel on 05/06/15. // Copyright (c) 2015 DG. All rights reserved. // #include <assert.h> #include "Window.h" #include "Monitor.h" namespace odin { namespace io { Window::Window() { } WindowHandle* Window:...
/* * H_DetectorConstruction.h * * Created on: Oct 2, 2018 * Author: vsevolod */ #ifndef H_DETECTORCONSTRUCTION_H_ #define H_DETECTORCONSTRUCTION_H_ #include <G4VUserDetectorConstruction.hh> #include "H_SensitiveDetector.h" #include "G4Material.hh" #include "G4NistManager.hh" #include "G4Box.hh" #include "...
//http://codeforces.com/problemset/problem/446/A #include <iostream> using namespace std; int main() { int n, a[100000], l[100000], r[100000], ans; cin >> n; for(int i = 0; i < n; i++) cin >> a[i]; if(n<=2) { cout<<n<<'\n'; return 0; } l[0] = 1; ans = 1; //find length of strictly increaing sequences f...
#include<iostream> using namespace std; int main() { int a,b,c; for(a = 5; a >= 1; a--) { for(b = a; b >= 1; b--) { cout<<" "; } for(c = 1; c <= a; c++) { cout<<"*"<<" "; } cout<<"\n"; } return 0; }
// // Created by root on 25/05/19. // #ifndef SFML_TEST_4_PLAYER_H #define SFML_TEST_4_PLAYER_H #include <SFML/Graphics.hpp> #include "Animation.h" #include "Collider.h" #pragma once class Player { private: sf::RectangleShape body; Animation playerAnimation; unsigned int row; float speed; bool fac...
#include <fstream> #include "psef23_2_opt.h" int main() { ofstream in_pix("input_pixels_regression_result_psef23_2_opt.txt"); ofstream fout("regression_result_psef23_2_opt.txt"); HWStream<hw_uint<32> > in_update_0_read; HWStream<hw_uint<32> > psef23_2_update_0_write; // Loading input data // cmap : { ...
#include "programwindowimage.h" //#define IM_WIDTH 720 //#define IM_HEIGHT 576 #define IM_WIDTH 1000 #define IM_HEIGHT 650 ProgramWindowImage::ProgramWindowImage(QStringList fileNames, QWidget *parent): ProgramWindow(parent), imageNames(fileNames) { frame_count = imageNames.size(); printf(...
#include "pch.hpp" #include "map.hpp" #include "grid.hpp" using yama::map; class map::impl_t { public: impl_t(int const Width, int const Height) : category_ {Width, Height} { } void clear() { category_.clear(); } tile_category get_category(int x, int y) const { return ...
#ifndef hhAnalysis_multilepton_EvtHistManager_hh_4l_h #define hhAnalysis_multilepton_EvtHistManager_hh_4l_h /** \class EvtHistManager_hh_4l * * Book and fill histograms for event-level quantities in the 4l category * of the HH->tttt, WWtt, and WWWW analysis * * \author Christian Veelken, Tallinn * */ #include ...
#pragma once #include <utility> #include "../type_list/type_list.hpp" // in general, assume a functor template<typename Function> struct function_signature : function_signature< decltype(&Function::operator()) > {}; // match function pointers template<typename Result, typename... Args> struct f...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2009 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" #ifdef MEDIA_JIL_PLAYER_SUPPORT #include...
#pragma once // AnalySet 对话框 class AnalySet : public CDialog { DECLARE_DYNAMIC(AnalySet) public: AnalySet(CWnd* pParent = NULL); // 标准构造函数 virtual ~AnalySet(); // 对话框数据 enum { IDD = IDD_ANALYSET }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 DECLARE_MES...
#ifndef _U_KEY_TRANSLATE_H_ #define _U_KEY_TRANSLATE_H_ #define kMaskOutCommand 0xFE00 // we need the modifiers without the command key #define kMaskOutOption 0xF700 // we need the modifiers without the option key #define kMaskVirtualKey 0x0000FF00 // get virtual key from event message for ...
#pragma once #include "IComponent.h" #include "Core\ComponentRegister.h" #include "Behavior\IBehavior.h" namespace Hourglass { class BehaviorTree : public IComponent { public: virtual void LoadFromXML( tinyxml2::XMLElement* data ); void SetRoot( IBehavior* root ); void DestroyRoot(); virtual void Updat...
#pragma once #include "Object.h" #include "Button.h" class HUD { private: Object hudBackground; Object hudCherry; Object hudStrawberry; Object hudOrange; Object* hudLives; std::string* hudScoreID; Rect* hudScoreRect; std::string hudXID; Rect hudXRect[3]; std::string hudStrawberryID; Rect hudS...
#pragma once #include <QWidget> #include <QHBoxLayout> #include <QLabel> #include <vector> #include <utility> #include <QTimer> #include <QtWinExtras> #include <QDebug> #include "raw_input.h" #include "mouse-widget.h" class DeviceVisualizer : public QWidget { Q_OBJECT public: devinfo_vec devices; s...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2008 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. */ #ifndef TEXT_EDIT_ELEMENT_OF_INTEREST_H #define TEXT_EDIT_ELEMENT...
#include <iostream> #include <cstdlib> #include <limits> using namespace std; const int N=6; // wierzcho³ki -2 int inf = 99999; void wypelnij(int t[N][N]) { for(int i=0;i<N;i++) { for(int j=0;j<N;j++) { t[i][j]=inf; } t[i][i]=0; } } void...
#include <unistd.h> #include <cstdio> #include <cstdlib> #include <cstring> #include "librtf.h" int main( int argc, char** argv ) { // Set RTF document font and color table char font_list[] = "Times New Roman;Arial;"; char color_list[] = "0;0;0;255;0;0;192;192;192;255;255;255"; char fname[] = "Sample....
#pragma once #include "ofMain.h" #include "ofxProfiler.h" #include "ofxSquash.h" class ofApp : public ofBaseApp{ public: void setup(); };
/** ****************************************************************************** * Copyright (c) 2019 - ~, SCUT-RobotLab Development Team * @file dr16.h * @author Zelong.Xu 8762322@qq.com * @brief Code for DJI-DR16 driver in embedded software system. ******************************************...
// Count inversions // Multiset O(n^2) [distance is O(N)] // Balanced BST O(NlogN) // Mergesort O(NlogN) class Solution { public: void merge(vector<int> &left, vector<int> &right, vector<int> &nums){ int i = 0, j = 0, k = 0; while(i < left.size() || j < right.size()){ ...
/* 191020 LG codepro - [19년도_2차] 안테나설치 - 조건 나열해서 식 완성하기! -> 빠트린 조건 확인 */ #include <iostream> using namespace std; int arr[25];//안테나 커버리지 값을 저장할 배열 int N;//설치할 안테나의 갯수 //작성할 함수 int Antenna_Count(double p1, double p2) { int i, cnt=0; double sum=0; double upper_len,len; len = (p2>p1) ? p2 - p1 : p1-p2...
void setup() { Serial.begin(115200); } char parse1 = char(0x0a); void loop() { String text = "absdcecrvd dfasfegrg fdfsdfdsfdsgd"; String arr_A[4]; int parseArr[3]; int text_length = text.length(); Split(text, " "); Serial.print(); } static Split(String sData, char cSeparator) ...
#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.)...
#include<bits/stdc++.h> using namespace std; const double pi=acos(-1.0); const double eps=1e-8; //double类型的数,判断符号 int cmp(double x){ if(fabs(x)<eps) return 0; if(x>0) return 1; return -1; } //二维点类,可进行向量运算 //计算平方 inline double sqr(double x){ return x*x; } struct point{ double x,y; ...
#include <iostream> using namespace std; int main(){ int a,b,c,d; d = 0; cin >> a >> b >> c; if(a > b) d = a; else d = b; if(d > c) d = d; else d = c; cout << d << " eh o maior" << endl; return 0; }
#define SEA 0 #define LAND 1 #define NON_VISITED 0 #define VISITED 1 #include <iostream> using namespace std; int nResult; int W, H; int dx[8] = { -1, -1, 0, 1, 1, 1, 0, -1 }; int dy[8] = { 0, 1, 1, 1, 0, -1, -1, -1 }; int nMap[50][50]; int nChecked[50][50]; void DFS(int nStartY, int nStartX) { nChecked[nSt...
#include<iostream> #include<cstring> using namespace std; int main() { int str[10]; memset(str, 8, sizeof(str)); for (int i = 0; i < 10; i ++) { // for (int i = 0; i < strlen(str); i ++) { cout << str[i] << " "; } cout << endl; return 0; }
#pragma once #include <vector> using namespace std; class DiceRollingFacility { private: int number_of_rolls; //0index is for 1, 1index is for 2... //3,4 and 5 indices are for black dice values vector<int> number_of_Getting_each_value; public: DiceRollingFacility(); int rollDice(); //console output ...
// Fill out your copyright notice in the Description page of Project Settings. #include "Hypoxia.h" #include "HypoxiaMonster.h" // Sets default values AHypoxiaMonster::AHypoxiaMonster() { // Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryAc...
#include <string> #include <cmath> #include <fstream> #include <iostream> #include <sstream> #include <list> #include <algorithm> #include <set> #include <map> #include <stack> #include <queue> #include <numeric> #include <bitset> #include <deque> //#include <random> #include <string.h> #include <stdlib.h> #include <ve...
#include <ESP8266WiFi.h> // Importa a Biblioteca ESP8266WiFi #include <PubSubClient.h> // Importa a Biblioteca PubSubClient // WIFI const char* SSID = " "; // SSID da Rede const char* PASSWORD = " "; // Senha da Rede // MQTT const char* BROKER_MQTT = "iot.eclipse.org"; // IP/URL DO BROKER MQTT int BROKER_PORT = 188...
// Copyright (c) 2016-2019 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 as published // by the Free Software Foundation, with spe...
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #include <cstdlib> #include <cmath> using namespace std; typedef long long ll; #define INF 10e10 #define rep(i,n) for(int i=0; i<n; i++) #define R...
// https://practice.geeksforgeeks.org/problems/subset-with-sum-divisible-by-m/0 #include <iostream> #include <cstring> using namespace std; bool checkAns(int n, int m, int a[]) { if (n > m) return true; bool dp[m], temp[m]; memset(dp, 0, m); for (int i = 1; i <= n; i++) { if (dp[0]...
#include <gl/glui.h> #include <iostream> int window_width = 512; int window_height = 512; void reshape (int w, int h); void mouse (int button, int state, int x, int y); void motion (int x, int y); void pmotion (int x, int y); void keyboard (unsigned char key, int x, int y); void special (int key, int x, in...
// // Rock.cpp // GetRock // // Created by zhusu on 15/3/11. // // #include "Rock.h" #include "AudioController.h" Rock* Rock::create(const char* name,int hp) { Rock* rock = new Rock(); if(rock && rock->init(name,hp)) { rock->autorelease(); return rock; } CC_SAFE_DELETE(roc...
/* ID: stevenh6 TASK: milk6 LANG: C++ */ #define problemname "milk6" #include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using db = double; using pi = pair<int, int>; using pl = pair<ll, ll>; using pd = pair<db, db>; using vi = vector<int>; using vb = vector<bool>; using vl...
#include<iostream> #include<string.h> using namespace std; int score(char a) { int i; i=a-'0'; if(a=='X') return 10; else if(a=='/') return 10; else { return i; } } void makeline(char* a) { int k=0; char *b; b=(char*)calloc(strlen(a)+1,sizeof(char)); for(int i=0;i<strlen(a);i++) ...
#ifndef GAME_HPP #define GAME_HPP #define CASPER 2 #define SPEED 5000 //#include "pac.hpp" class Game { public: Game(void); Game(std::vector<char*>, int, int); Game(Game const &); ~Game(void); Game const &operator=(Game const &); void start(void); void print_map(); void getScore(); //////getters pri...
#pragma once #include "GcVSListBox.h" #include "GcMediateObject.h" class GcCollisionList : public GcVSListBox, public GcMediateObject { protected: Gn2DAVData* mpAVData; Gt2DSequence* mpSequence; public: GcCollisionList(void); ~GcCollisionList(void); void ResetData(Gt2DSequence* pSequence); CString GetMakeNam...
#include<iostream> using namespace std; int main(void){ int a[10] = {0}; int i = 10; int j = 3; cout << a[i/j]; }