text
stringlengths
8
6.88M
#include <cstdio> #include "ThreadPool.h" class MyTask : public Task { public: MyTask(int i) : Task("MyTask" + std::to_string(i)) {} void Run() { for (int i = 0; i < 5; i++) { printf("-- thread [%3d]: task_name=[%20s], out=%d\n", GetThreadId(), GetName().c_str(), i); std::th...
#include <iostream> using namespace std; int main(){ string name = "07:05:45PM"; int n = ((int)name[0]-48)*10+((int)name[1]-48); if(n>12){ } char a = name[8]; // cout<<a; if(a=='P'){ n += 12; } cout<<"THe name start from : "<<n; // char name = stringn) // cout<<name; string nname = char(n); return 0; }
// // Created by wqy on 19-11-26. // #ifndef VERIFIER_INITIALKNOWLEDGE_H #define VERIFIER_INITIALKNOWLEDGE_H #include "../Process/Process.h" namespace esc { class InitialKnowledge { private: Process* process; Attribute* attribute; public: Process* getProcess() {return this->proce...
#include<stdio.h> void swap (int arr[6] ,int j); int main(){ int arr[6] = {1,3,4,2,4,2}; int len = sizeof(arr)/sizeof(arr[0]); int i,j,temp; for (i = 0; i < len - 1; i++) //外层循环控制趟数,总趟数为len-1 for (j = 0; j < len - 1 - i; j++) //内层循环为当前i趟数 所需要比较的次数 if (arr[j] >...
#include<stdio.h> #include<conio.h> void main() { clrscr(); int arr[4][2]; static int sum; for(int i=0;i<4;i++) { for(int j=0;j<2;j++) { scanf("%d",&arr[i][j]); sum=sum+arr[i][j]; } } printf("\n%d",sum); getch(); }
class Solution { public: int canCompleteCircuit(vector<int>& gas, vector<int>& cost) { if (gas.empty() || cost.empty() || gas.size() != cost.size()) return -1; if(gas.size() == 1) return gas[0] >= cost[0] ? 0: -1; int index = 0; int n = gas.size(); while (index < n) { int stepsNeeded = 0; int left = 0; whil...
#include <vector> #include "Encoder.h" //#define PRINT void Encoder::setCode(const string code, const unsigned char pos) { _codes[pos] = code; } void Encoder::encodeFile(const string& inputFileName, const string& outputFileName) { _fin.open(inputFileName, ios::binary | ios::ate); _fout.open(outputFileNam...
#include<bits/stdc++.h> using namespace std; vector<int> printMatrix(vector<vector<int> > matrix) { int n = matrix.size(); vector<int> res; if(n == 1) { res.push_back(matrix[0][0]); return res; } for(int i = 0; i < n/2; i++) { for(int j = i; j < n-i; j++) r...
#include <cstdlib> #include <iostream> using namespace std; struct nodo { int x,y; nodo *sig; }; int main(int argc, char** argv) { nodo **arr, *Aux; int N, tam, j, i; cout<<"Escriba el valor de N "; cin>>N; cout<<"Escriba el valor de tam "; cin>>tam; arr= new nodo *[N]; for(i=0; i<N; i++) arr[i]=NULL; ...
#include "dateutils.h" bool DateUtils::isLeapYear(int y) { return y%400==0||(y%4==0&&y%100!=0); } /*日期所在年的天数*/ int DateUtils::daysOfYear(Date & date) { int days = date.day(); for(int m = 1;m < date.month();++m) { days+=DAYS[m-1]; } if(DateUtils::isLeapYear(date.year())) ++days; ret...
#include "VertexStream.h" #include "graphics/VertexBuffer.h" #include <cstring> VertexStream::VertexStream(VertexBuffer &buffer) : buffer(&buffer), ptr(reinterpret_cast<char*>(buffer.vb.lock(Gx::Graphics::Lock::Flag::Discard))) { buffer.n = 0; } VertexStream::VertexStream(VertexStream &&v) : buffer(v.buffer), p...
// // BaseTableView.cpp // SMFrameWork // // Created by KimSteve on 2016. 11. 8.. // // #include "BaseTableView.h" #include "VelocityTracker.h" #include "SMScroller.h" #include <cocos2d.h> #define CLEANUP_FLAG (true) BaseTableView::InstantHolder::InstantHolder() { } BaseTableView::InstantHolder::~InstantHol...
/** * MIT License * * Copyright (c) 2021 Dantali0n * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modif...
#pragma once template <class T> class Sequence { public: // Получение подпослед. / копирование послед. / объединение послед. virtual Sequence<T>* GetSubSequence(int start, int end) = 0; virtual Sequence<T>* Copy() = 0; virtual Sequence<T>* Concat(Sequence<T>* toConcat) = 0; // Основные функции дек...
#include "ObjectPool.hpp" #include <cassert> #include <iostream> int main() { ObjectPool<UsedObject, int> pool(0, 2, 5); std::cout << "Initialized object pool with max size of " << pool.max_size() << std::endl; std::cout << "Size of the pool: " << pool.size() << std::endl; std::cout << "Available objec...
#include "MainWindow.h" #include <QGridLayout> MainWindow::MainWindow(QWidget *parent) : QWidget(parent) { m_tcpServer = new TcpServer; m_msgStr = ""; constructUI(); connectSlots(); } void MainWindow::constructUI() { QGridLayout* mainLayout = new QGridLayout(this); QLabel* portLabel = ne...
/* * JSON C++ Library * Drecom. co. Ltd. 2005. * IMAMURA Shoichi <imamura@drecom.co.jp> * * JsonHanlder class handles conversion between C++ string and JsonObject. * Using JSON format, we can easily exchange various data * with other system programmed by other language like Perl, PHP, JAVA. */ #ifn...
/** * Created by Cheng Ji * Dec. 9, 2015 */ #include <stdio.h> #include <stdlib.h> #include <iostream> #include "bst.h" using namespace std; BSTNode::BSTNode(int val, BSTNode *left, BSTNode *right): val(val), left(left), right(right) { } BSTNode::BSTNode(int val): val(val), left(NULL), right(NULL), height(0) { ...
#include "ros/ros.h" #include "../msg_gen/cpp/include/camina/datos_ini.h" #include "../msg_gen/cpp/include/camina/coordenadas.h" #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #include <time.h> void trayectoria (float *p, float landa, float dh, float vel_1, float vel_2, float t, int s); ...
#include <iostream> #include <algorithm> #include <cstring> using namespace std; const int INF = 1000000000; const int MAX = 1000005; int a[MAX], tmp[MAX], cnt[MAX], le[MAX], ri[MAX]; long long solve(int l, int r) { if (r - l < 2) return 0; int mid = (l + r) / 2; long long ret = solve(l, mid) + solv...
// // TODO: to complete... + special functions // #pragma once #include "MissionImpossible/ad.hpp" #include <cmath> namespace MissionImpossible { //////////////////////////// // Min/max like functions // //////////////////////////// template <typename T, typename IMPL> inline AD<T> abs(const AD_Crtp<T, ...
// ------------------------------------------------------------------------------------------------ #include "Handle/Connection.hpp" #include "Account.hpp" // ------------------------------------------------------------------------------------------------ #include <cstdio> #include <cstring> #include <cstdlib> // ---...
#ifndef RESOURCELIB_ANIMATION_ANIMATION_H #define RESOURCELIB_ANIMATION_ANIMATION_H #include "Resource.h" namespace Resources { class Animation : public Resource { public: struct Keyframe { float timeValue = 0; float translation[3]{0.0f,0.0f,0.0f }; float quaternion[4] {0.0f,0.0f,0.0f,0.0f }; f...
#ifndef TREEWIDZARD_INPUTCONTROLLER_H #define TREEWIDZARD_INPUTCONTROLLER_H #include <experimental/filesystem> #include <iomanip> #include <iostream> #include "../Conjecture/Conjecture.h" #include "../Conjecture/PropertyAssignment.h" #include "../Kernel/DynamicCoreHandler.h" #include "../Kernel/DynamicKernel.h" #includ...
// // Created by Sweet Acid on 29.04.2021. // #pragma once #include <pch.h> #include <glm.hpp> #include <gtc/type_ptr.hpp> namespace Snow { class Shader { public: unsigned int id; Shader() = default; void use() const; void compile( const char *vertex_code, ...
/****************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the Qt PDF Module. ** ** $QT_BEGIN_LICENSE:COMM$ ** ** Commercial License Usage ** Licensees holding valid commercial Qt license...
//----------------------------------------------------------------------------- // Perimeter Map Compiler // Copyright (c) 2005, Don Reba // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met:...
#include <iostream> using namespace std; int main() { int a[3][4]={ {1,1,1,1}, {2,2,2,2}, {3,3,3,3} }; for(int (&i)[4]:a) { for (int &j:i) cout << j; cout<<endl; } for(int i=0;i<3;i++){ for(int j=0;j<4;j++) cout << a[i][j] ; ...
/**************************************************** * RoseBin :: Binary Analysis for ROSE * Author : tps * Date : 3Apr07 * Decription : Code that actually builds the Rose Tree ****************************************************/ #ifndef __RoseBin_buildTree__ #define __RoseBin_buildTree__ #include <stdio.h> #i...
#pragma once #include <string> #include "Room.h" using namespace std; class Hero { public: string userName; ~Hero(); static Hero* Instance() { static Hero mInstance; // Guaranteed to be destroyed. - Instantiated on first use. return &mInstance; } // Getters const string getUserName() { retur...
/** * Core logging functionality * * Logging is provided via a macro {@code Log(level)} which can log at 4 levels * of detail. The macro links in a {@link core::logging::TraceInfo} which * contains detailed information about the call site. */ #ifndef FISHY_LOGGING_H #define FISHY_LOGGING_H #include <CORE/BASE/st...
#include <bits/stdc++.h> using namespace std; struct node { int data; node *l; node *r; node(int val) { data = val; l = NULL; r = NULL; } }; struct Info { int sz; int min; int max; int ans; bool isBST; }; Info isbiggestBST(node *root) { if...
#include "board.h" #include <iostream> #include <vector> #include <array> #include <string> #include <stdio.h> using namespace std; Board::Board(int size){ //stores the board size in the object board_size = size; //allocate memory for new board of that is a square of the input size cells = ...
#include <iostream> int contar(char* arreglo); int main(int argc, char const *argv[]) { char arreglo[14] = "hola a todos0"; int contador = contar(arreglo); std::cout << contador << '\n'; return 0; } int contar(char* arreglo) { int contador=0; for(int i=0; i < 14; i++) if(arreglo != nullptr) ...
/* Julian Shen Programming II Due: 03 / 09 / 2020 HW6 - UDP Packet Recombination Read input packet, put packets in order, print total message */ #include <iostream> #include <string> #include <fstream> #include "sllist.h" using namespace std; int main() { sllist list; fstream inData; inData.open("input.txt"); str...
#include <fstream> #include <string> #include <iostream> #include "header.h" using namespace std; int main(int argc,char* args[]) { // Размер буфера const int buf_size = 15638; // Имя исходного файла string src_file = args[1]; string out_file = args[2]; cout << src_file << " -> " << out_fi...
//순수 가상함수(Pure Virtual Function) : 몸체가 없는 가상함수 -> 무조건 상속을 받아야 한다.(자식클래스에서 구현을 해줘야 한다.) #define _CRT_SECURE_NO_WARNINGS #include <cstdio> #include <cstring> enum class Time { Morning, afternoon, Night }; class Animal { // 추상 클래스 abstract public: char name[100]; Animal(const char* name) { strcpy(this->name, name...
#include "Losfahren.h" #include <iostream> #include "stdafx.h" using namespace std; Losfahren::Losfahren() { } Losfahren::Losfahren(Fahrzeug * pFahrzeug, Weg * pWeg) : FahrAusnahme(pFahrzeug, pWeg) { } Losfahren::~Losfahren() { } void Losfahren::vBearbeiten() { cout << "-----------------------------------------...
// // Disclaimer: // ---------- // // This code will work only if you selected window, graphics and audio. // // In order to load the resources like cute_image.png, you have to set up // your target scheme: // // - Select "Edit Scheme…" in the "Product" menu; // - Check the box "use custom working directory"; // - Fil...
#ifndef PARTICULA_CHATARRA_H #define PARTICULA_CHATARRA_H #include <herramientas/vector_2d/vector_2d.h> #include <generador_numeros.h> #include "particula_movil_base.h" #include "../../definiciones/animaciones.h" #include "../../recursos.h" namespace App_Juego_ObjetoJuego { class Particula_chatarra: public Particu...
#include<bits/stdc++.h> using namespace std; int calculate(int k, int n){ int steps = (k - 1); n = n - k; if(n%k == 0) { steps += n/k; } else{ steps += (n/k + 1); } return steps; } int main(){ int t; cin >> t; while( t --){ int n; cin >> n; ...
#include "Game.h" #include "Rendering\ResourceManager.h" #include "Components\TransformComponent.h" #include "Components\RenderComponent.h" #include "Components\PlayerKeyboardControlComponent.h" #include "Rendering\MeshFactory.h" #define TIXML_USE_STL static void error_callback(int error, const char* description) { ...
#include <iostream> using namespace std; void swap(int* a, int* b); void MergeSort(int* a, int left, int right); void printArr(int* arr, int size); void merge(int* a, int left, int middle, int right); int main(){ int a[11] = {6,12,4,19,22,3,2,15,13,17,30}; cout << "Before sort:\n"; printArr(a, 11); MergeSort(a...
class Solution { public: bool isPalindrome(string s) { if(s == "") return true; string temp = ""; for(char ch:s) { if((ch >='0'&&ch<='9')||(ch >='a'&&ch<='z')) { temp += ch; } else if((ch >='A'&&ch<='Z')) { ...
#include <iostream> #include <string> #include <stdlib.h> #include "Vector2d.h" #include "Simulation.h" #include "Display.h" #include "Environment.h" #include "EnvironmentStore.h" using namespace std; int compare(char* string1, char* string2) { int i = 0; while(string1[i] != '\0' && string2[i] != '\0') { ...
#include "gltools_Loader.hpp" #include <stack> #include <regex> #include <unordered_map> #include "gltools_Math.hpp" #include "cpptools_Files.hpp" #include "cpptools_Timer.hpp" #include "cpptools_Logger.hpp" #include "cpptools_Strings.hpp" #include "Settings.hpp" // ==================================================...
#include <iostream> #include "node.h" using namespace std; template<typename T> class Stack{ node<T>* head; int count; public: Stack(){ head=NULL; count=0; } void push(T d){ if(head==NULL){ head=new node<T>(d); count++; } else{ node<T>* n=new node<T>(d); n->next=head; head=n; count++;...
#ifndef __ACTION_SCOPE_MANAGER__ #define __ACTION_SCOPE_MANAGER__ #include <functional> #include "string_t.h" #include "Context.h" #include "ContextManager.h" class ActionScopeManager { private: static ContextManager * _context_manager; static Context * _current_context; public: static void init(ContextManager ...
#include "common\Singularity.Common.h" namespace Singularity { namespace Threading { class _AutoLock { private: #pragma region Variables bool m_bRunning; CriticalSection& m_pCritSection; #pragma endregion #pragma region Constructors and Finalizers #pragma warning(dis...
// Copyright 2020 JD.com, Inc. Galileo Authors. All Rights Reserved. // // 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 requ...
#ifndef CONTAINR_H #define CONTAINR_H #include <iostream> #include <string> #include <locale> #include <fstream> class Object; using namespace std; template <typename T> class Container { private: class Object; friend class Object; class TextFile; friend class TextFile; class BinFile; ...
#include <bits/stdc++.h> using namespace std; string test(int X, int Y, int arr[]) { if (X == Y) { } else { } } int main() { int t; cin >> t; while (t > 0) { int n; int hard; int easy; int arr[n]; for (int i = 0; i < n; i++) { ...
#include "Common.h" #include "Tools.h" unique_ptr<Tools> Tools::m_pInstance = nullptr; typedef int(__stdcall *MSGBOXWAPI)(IN HWND hWnd, IN LPCWSTR lpText, IN LPCWSTR lpCaption, IN UINT uType, IN WORD wLanguageId, IN DWORD dwMilliseconds); Tools* Tools::Instance() { if (!m_pInstance) { m_pInstance.reset(new Tool...
#include "Patcher_CombatMasterySwap.h" #include "../Addr.h" #include "../FileSystem.h" //----------------------------------------------------------------------------- // Static variable initialization LPBYTE CPatcher_CombatMasterySwap::addrMintWriteWord = NULL; LPBYTE CPatcher_CombatMasterySwap::addrCMessage = NULL; L...
#include <iostream> using std::cout; using std::cin; using std::endl; // function prototypes char ToUpperCase(char input); char ToLowerCase(char input); // main program entry point int main() { int Printendl = 0; for (unsigned int i = 33; i <= 255; ++i) { ++Printendl; if (i >= 65 && i <= 90) { cout << i ...
#pragma once namespace State { enum { _Loading, _Start, _Lobby, _LobbyReady, _Game, _Dead, _EndGame }; }
// // Copyright (c) 2003--2009 // Toon Knapen, Karl Meerbergen, Kresimir Fresl, // Thomas Klimpel and Rutger ter Borg // // 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) // // THIS FILE IS AUTOMATICALLY GENERATED ...
#include <bits/stdc++.h> using namespace std; ALNode *deepCopy(ALNode *head) { if (!head) return head; ALNode *origin = head, *copy = new ALNode(0), *temp = copy, *newNode; map<ALNode *, ALNode *> m; while (origin) { newNode = new ALNode(origin->value); temp->next = newNode...
// Copyright 2018 Global Phasing Ltd. // // Functions that convert string to integer or floating-point number, // and a few helper functions. // // This file is named similarly to the standard functions atoi() and atof(). // But the functions here are not meant to be equivalent to the standard // library functions. The...
#include <bits/stdc++.h> using namespace std; int findMin(vector<int> &nums) { return *min_element(nums.begin(), nums.end()); } int findMin_using_binary_search(vector<int> &nums) { int lo = 0, hi = nums.size() - 1; while (lo < hi) { int mid = lo + (hi - lo) / 2; if (nums[mid] < nums[hi...
#include <bits/stdc++.h> using namespace std; vector<int> deckRevealedIncreasing(vector<int> &deck) { int n = deck.size(); vector<int> ans(n); sort(deck.begin(), deck.end()); queue<int> q; for (int i = 0; i < n; i++) q.push(i); int i = 0; while (!q.empty()) { ans[q.front...
#include<bits/stdc++.h> using namespace std; int main(){ int n, m; cin >> n >> m; vector<int>a(n); for(int i = 0; i < n; i++){ cin >> a[i]; } deque<pair<int,int>>q; for(int i = 0; i < m; i++){ while(!q.empty() && q.back().first > a[i]){ q.pop_back(); } ...
// This file has been generated by Py++. #ifndef ActivationEventArgs_hpp__pyplusplus_wrapper #define ActivationEventArgs_hpp__pyplusplus_wrapper void register_ActivationEventArgs_class(); #endif//ActivationEventArgs_hpp__pyplusplus_wrapper
/* Copyright (c) 2005-2023, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in source and binary forms...
#ifndef SHAPE_H #define SHAPE_H #include <math.h> #include <stdio.h> #include <stdlib.h> #include <iostream> #include "Camera.h" #include "Light.h" #include "SOIL.h" class Shape { protected: GLuint VertexShaderId, FragmentShaderId, ProgramId, vaoId, vboId, colorId, normalId, texId; char* text...
#include <iostream> using namespace std; int main() { int t; cin>>t; int a[1000005], c[1000005]; for(int i = 0; i<t; i++) { cin>>a[i]; } for(int i=0 ; i<1000005;i++) { c[i]= 0; } for(int i = 0; i< t; i++) { int x=a[i]; c[x]++; } int k=0; for(int i= 0; i<1000005; i++) { for(int j=0;j...
#ifndef COMPONENTMAPPER_H #define COMPONENTMAPPER_H //#include "ECS/ComponentManager.h" #include <vector> #include "ComponentType.h" #include "Component.h" #include "ComponentManager.h" #include "World.h" //class World; class Entity; template <class T> class ComponentMapper { public: ComponentMapper(World...
#include <iostream> #include <string> #include <vector> int main() { std::string str; std::vector<std::string> vstr; while (std::cin >> str) vstr.push_back(str); for (auto st : vstr) std::cout << st << " "; std::cout << std::endl; return 0; }
#include "optimizer.h" #include "expressions.h" namespace optimizer { using namespace evaluator; inline bool is_writable (const node& expr) { return (expr.unique() && (expr->name_ != "variable") && (expr->name_ != "immediate") && (expr->name_ != "real") && (expr->name_ != "rational")); } ...
#include <stdafx.h> #include "LineMatcher.h" #include "DebugTrace.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif // // 给定激光头姿态和一条直线段,计算对应于线段两个端点的扫描角(假定以逆时针方向扫描)。 // void FindScanAngles(CPosture& pstScanner, CLine& Line, CAngle& ang1, CAngle& ang2) { // 取得激光头的位置和...
#pragma once #include <stdio.h> #include <stdlib.h> #include <iostream> #include <string> #include <vector> using namespace std; static int compteurPatron = 0; static int compteurChefDeProjet = 0; static int compteurProgrammeur = 0; static int compteurSoundDesigner = 0; static int compteurGraphicDesigner = 0; static ...
#include "IndexMaker.h" #include <cstdio> #include <cstring> #include "IRDefine.h" #include "StatisticInfo.h" #include <algorithm> #include "VB.h" #include <cmath> void IndexMaker::makePostIndex(const char *filename) { this->loadDict(); StatisticInfo si; char value[128]; m_offset = 0; si.read(STATISTIC_KEY_TERMNU...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.Devices.Printers.2.h" WINRT_EXPORT namespace winrt { namespace Windows::Devices::Printers { struct WINRT_EBO Print3DDevice : Windows::Devices::Printers::IPrint3DDevice ...
#pragma once #include <thread> #include <mutex> #include <condition_variable> #include <vector> #include <atomic> #include <deque> #include <stack> namespace Concurrency { //forward declaration template<typename T> class ThreadPool; template<typename T> class Worker { using TaskFunction = std::function<void(...
#ifndef PUBLICVISION_YOLO_H #define PUBLICVISION_YOLO_H #include "darknet.h" #include <opencv2/opencv.hpp> #include <json/json.h> #include <EZOutput.h> class yolo { public: yolo(); void init(); cv::Mat detect(); cv::Mat pullImg(); Json::Value getRes(); }; class YOLOv3 : public file { public: ...
// Topic: vector in C++ #include<iostream> #include<vector> using namespace std; int main(){ vector<int> Vec; for(int i=0; i<32; i++){ Vec.push_back(i); cout << "Size: " << Vec.size() << " Capacity: " <<Vec.capacity()<< endl; } }
// $Id: DDUP.h,v 1.2 2013/02/12 18:56:14 david Exp $ #ifndef __PF2ASM_NODE_nodes_DDUP_H__ #define __PF2ASM_NODE_nodes_DDUP_H__ #include <cdk/nodes/Node.h> #include "semantics/SemanticProcessor.h" namespace pf2asm { namespace node { class DDUP: public cdk::node::Node { public: inline DDUP(int lineno) ...
#pragma once #include<iostream> using namespace std; struct node { int data; node* next; }; class L_List { protected: node* head; public: L_List() { head = nullptr; } void Add_On_Tail(int d) { node* temp1 = new node(); node* temp2; temp1->next = nullptr; temp1->data = d; i...
// This file is subject to the terms and conditions defined in 'LICENSE' in the source code package #include "game/logic/deferral_timer.h" #include "game/world/world.h" using namespace jactorio; void game::DeferralTimer::DeferralUpdate(Logic& logic, World& world, const GameTickT game_tick) { if (game_tick > 0) ...
#include <fstream> #include "wrapper.h" #include "IFPLoader.h" extern std::vector <IFP> g_IFPs; extern std::ofstream ofs; extern std::wofstream ofsW; extern bool g_bAllowToPlayCustomAnimation; extern DWORD g_CurrentHierarchyAnimationHash; extern hGetUppercaseKey OLD_GetUppercaseKey; extern hGetAnimationBlock ...
#include <iostream> using namespace std; //Function returning the Longest Sequence of positive numbers int getLongestSeq (int a[], int n); int main() { int arr[] = {1,2,3,4,5,-1,-1,1,2,3,-1, 1, 10, 3, 4, 5, 6, 7, -1 }; int n = sizeof(arr); getLongestSeq(arr, n); return 0; } int getLongestSeq (i...
// \file MatrixBufferTiming.cpp #include <list> #include <vector> #include <iostream> #include <string> #include <Eigen/Core> // Build: g++ MatrixBufferTiming.cpp -o matrix_buffer_timing -I/usr/include/eigen3 using namespace Eigen; using std::list; struct Buffer { int vectorCount; int vectorSize; Buf...
/*#######. ########",#: #########',##". ##'##'## .##',##. ## ## ## # ##",#. ## ## ## ## ##' ## ## ## :## ## ## ##*/ #include <ctime> #include <cstdlib> #include "Zombie.hpp" #include "ZombieHorde.hpp" int main(void) { // Initialize Random Generator std::srand(std::time(0)); Z...
#include "critter.h" #include <vector> Critter::Critter(int x, int y, int level ){ if (x >= 0){ mX = x; } else if (x<0){ mX = 0; } if (y >= 0){ mY = y; } else if (y < 0){ mY = 0; } mLevel = level; mAlive = true; } Critter::~Cr...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "../base.h" #include "Windows.Security.Cryptography.0.h" #include "Windows.Storage.Streams.0.h" WINRT_EXPORT namespace winrt { namespace ABI::Windows::Security::Cryptography { struc...
#include "Pizza.h" Pizza::Pizza() { } void Pizza::addTopping(){ //toppings.push_back(topping); } istream& operator >> (istream& in, Pizza& pizza){ return in; } ostream& operator << (ostream& out,const Pizza& pizza){ return out; }
#include "stdafx.h" #include "CDIGITAL.h" int CComandaRobot::Le_canal(int junta,int canal) { int tmp; BOOL n_passa = TRUE; while (n_passa) { tmp=(int) Comunica->ler (1912,canal,1,0); if (ForaIntervalo(junta,tmp)) { // n_passa=TRUE; n_passa=FALSE; fprintf (temporario,"Bloquei leit...
#include<iostream> using namespace std; int main() { int m,n,c; cin >>m>>n; if(m<n)swap(m,n); while(true) { c=m%n; if(c==0)break; m=n; n=c; } cout <<n<<endl; return 0; }
#pragma once #include "..\\Led5kSDK\\Led5kSDK.h" // CStaticAreaDlg 对话框 class CStaticAreaDlg : public CDialogEx { DECLARE_DYNAMIC(CStaticAreaDlg) public: CStaticAreaDlg(CWnd* pParent = NULL); // 标准构造函数 virtual ~CStaticAreaDlg(); // 对话框数据 enum { IDD = IDD_STATICAREADLG }; protected: virtual void DoDataExchang...
#ifndef _HS_SFM_UTILITY_MATCHE_TYPE_HPP_ #define _HS_SFM_UTILITY_MATCHE_TYPE_HPP_ #include <vector> #include <map> #include "cereal/types/vector.hpp" #include "cereal/types/map.hpp" #include "cereal/types/utility.hpp" namespace hs { namespace sfm { typedef std::vector<std::vector<int> > MatchGuide; ...
#include <vtkPolyDataReader.h> #include <vtkPolyDataWriter.h> #include <vtkPolyData.h> #include <vtkSmartPointer.h> #include <vtkPointData.h> #include <vtkInformation.h> #include <vtkDataSetAttributes.h> #include <fstream> #include <stdio.h> #include <sstream> #include <string> #include "tinyxml.h" int main(int argc, ...
#include "vector3.h" #include <math.h> Vector3::Vector3() : Vector3(0.0f, 0.0f, 0.0f) { } Vector3::Vector3(float e0, float e1, float e2) { e[0] = e0; e[1] = e1; e[2] = e2; } Vector3 Vector3::operator+(const Vector3& v) const { return Vector3(e[0] + v.e[0], e[1] + v.e[1], e[2] + v.e[2]); } V...
/// /// \file atome.h /// \brief Déclare la classe Atome /// /// La classe Atome hérite de la classe Expression /// #ifndef ATOME_H #define ATOME_H #include "../headers/expression.h" /// /// \class Atome /// \brief Identificateur de programme ou de variable /// /// Hérite de Expression /// Un atome est un identificat...
#include<iostream> using namespace std; class student { private: int batcode; char bname[20]; int innings,notout,runs; float batavg; float calavg() { batavg =runs/(innings-notout); return batavg; } public: void readdata() { cout<<"Enter batsman code.:"...
#include "Surface.h" #include<cassert> Surface::Surface(int w, int h) : width(w), height(h), pPixels(new Color[width*height]) { } Surface::Surface(const Surface & s) : Surface(s.width,s.height) { const int nPixels = width*height; for (int i = 0; i < nPixels; i++) { pPixels[i] = s.pPixels[i]; } } Surfac...
#include <iostream> using namespace std; int main(void) { // Z harfi int z = 4; for(int i = 1; i <= 6; i++){ for(int j = 1; j <= 4; j++){ if(i == 1 || i == 6 || j == z+1 ) cout<<"* "; else cout<<" "; } cout<<endl; z--;} retur...
#if 1 #include"videoshop.h" //비디오를 등록 Video* Video::registerVideo() { cout << "registerVideo" << endl; return 0; } //비디오 목록을 출력합니다 void Video::listVideo() { cout << "listVideo" << endl; } //비디오를 검색합니다.(일련번호로..) Video* Video::findVideo(int id) { cout << "findVideo" << endl; return 0; } // 비디오를 삭제합니다 void Video::r...
#include "main.h" #include <comutil.h> #pragma comment(lib, "comsuppw.lib") cFont g_FontEsp; cFont g_FontMenu; cDrawing g_Draw; void cFont::SetFont( char* name , int h , int w , int flag ) { if ( !dwFontId ) dwFontId = g_pSurface->FontCreate(); g_pSurface->SetFontGlyphSet( dwFontId , name , h , w , 0 , 0 , flag...
#include "Map.h" Map::Map() { for (int x = 0; x < MAX_WIDTH; x++) { for (int y = 0; y < MAX_HEIGHT; y++) { this->blockedNodes[x][y] = false; } } } Map::~Map() { } void Map::SetObstructNode(int x, int y, bool state) { if (x < 0 || x >= MAX_WIDTH || y < 0 || y >= MAX_HEIGHT) return; this->blockedN...
/* * SPDX-FileCopyrightText: 2020 Rolf Eike Beer <eike@sf-mail.de> * * SPDX-License-Identifier: GPL-3.0-or-later */ #include <josm_presets.h> #include <josm_presets_p.h> #include <icon.h> #include "info_p.h" #include <object_dialogs.h> #include <osm.h> #include <algorithm> #include <cassert> #include <cstring> #...