text
stringlengths
8
6.88M
#include<iostream> using namespace std; int main() { int n; cin>>n; int line=1; while(line<=n) { //spacing loop int spaces=1; while(spaces<=n-line) { cout<<" "; spaces++; } //increasing loop int j=line; int count=1; while(c...
#include<stdio.h> #include<string.h> char strs[10001]; int gplt[4]; int main() { scanf("%s",strs); for(int i=0;i<strlen(strs);i++) { if(strs[i]=='g'||strs[i]=='G') { gplt[0]++; } else if(strs[i]=='p'||strs[i]=='P') { gplt[1]++; } else if(strs[i]=='L'||strs[i]=='l') { gplt[2]++; } else i...
#include <string> #include <cstring> class Person { private: static const int LIMIT = 25; std::string lname_; char fname_[LIMIT]; public: Person() { lname_ = ""; fname_[0] = '\0'; } Person(const std::string & lname, const char * fname = "Heyyou"); void show() co...
#ifndef WIZMACHELPER_H #define WIZMACHELPER_H #include <QtGui> #include <QSplitter> #include "wizdef.h" QBrush WizGetLeftViewBrush(); class CWizSpacer : public QWidget { public: CWizSpacer(QWidget* parent = 0); QSize sizeHint() const { return QSize(1, 1); } }; class CWizVerSpacer : public QWidget { public:...
#include "HUD.h" #include <ds_game_ui.h> #include "tweening.h" #include "..\Constants.h" #include "..\GameSettings.h" #include "utils.h" HUD::HUD(SpriteBatchBuffer* buffer, GameContext* context) : _buffer(buffer) , _gameContext(context), _pieces(3), _points(6), _minutes(2), _seconds(2) { reset(); _mode_x_pos[0] =...
#include "core\Singularity.Core.h" using namespace Singularity::Components; namespace Singularity { IMPLEMENT_OBJECT_TYPE(Singularity, BehaviorTask, Singularity::Threading::Task); #pragma region Static Variables BehaviorTask* BehaviorTask::g_pInstance = NULL; #pragma endregion #pragma region Const...
#include <stdio.h> int main(){ char num[100]; scanf("%[^\n]", num); printf("%s\n", num); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { //freopen("in", "r", stdin); freopen("out", "w", stdout); int T; cin>>T; for(int tt=1; tt<=T; tt++) { cout<<"Case #"<<tt<<":"<<endl; int r, c, m, mi; cin>>r>>c>>m; mi = m; char a[r][c]; for(int i=0; i<r; i++) { for(int j=0; j<c; j+...
#include <bits/stdc++.h> using namespace std; #define int long long #define endl "\n" int32_t main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin>>n; if (n == 0) { cout<<"1"<<endl; } else { int v = 0; while(n > 0) { n = n/10; ...
/* Copyright(c) 2016-2019 Panos Karabelas 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, modify, merge, publish, distrib...
class Solution { public: int maxSumTwoNoOverlap(vector<int>& A, int L, int M) { // 利用前缀和 vector<int> presum; int result = 0; for(int i = 0; i < A.size(); i++) { if(i == 0) { presum.push_back(A[i]); } else ...
// // Created by Liang on 2019-08-11. // #include <vector> #include <iostream> #include <queue> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} static TreeNode* buildByLevel(vector<int> nums){ TreeNode* ro...
#include <cstdio> #include <algorithm> using namespace std; // Heapsort based on the idea of using priority queue to sort in O(NlogN) time. The basic strategy is to build a binary heap of N elements. This stage takes O(N) time. Then we perform the N DeleteMin operations, the total running time of which is O(NlogN). A ...
/* 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 __WHISKEY_AST_FieldUInt_HPP #define __WHISKEY_AST_FieldUInt_HPP #include <whiskey/AST/Field.hpp> namespace whiskey { class FieldUInt : public Field { private: UInt64 value; protected: std::unique_ptr<Field> onClone() const; void onPrintAsLiteral(std::ostream &os) const; bool onCompare(const Field &other...
#ifndef POINT_H #define POINT_H #include <iostream> #include <cmath> #include <string> #include <exception> #define PI 3.14 using namespace std; class Point { protected: double x, y, z; public: Point() {}; Point(double x, double y, double z) : x(x), y(y), z(z) {}; Point(double x, double y) {}; Point(const Point& ...
// // Created by zanbo on 2020/4/27. // #include <vector> #include <stdlib.h> #include <iostream> #include <map> #include <unordered_map> #include <set> #include <queue> #include <stack> #include <algorithm> #include <stdio.h> #include <fstream> using namespace std; //struct TreeNode { // int val; // TreeNode ...
// // // @ Project : PorkParser // @ File Name : PItemDTag.h // @ Date : 9/16/2011 // @ Author : Andy Brennan // // #if !defined(_PITEMDTAG_H) #define _PITEMDTAG_H #ifndef UINT #define UINT unsigned int #endif #include "PorkString.h" #include <boost/serialization/vector.hpp> using std::vector...
/* * @LastEditor: YuukInZ * @Date: 2019-11-24 16:07:23 * @LastEditTime: 2019-11-29 23:41:45 * @Description: */ #include "protocol4_c.h" //网络层-数据链路层-物理层 const char *NetworkProcName = "receiver4_network"; const char *DatalinkProcName = "receiver4_datalink"; const char *PhysicalProcName = "receiver4_phys...
#include<iostream> #include "DataRecord.h" #include <fstream> #include <algorithm> using namespace std; #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif const int USER_MAX_COLUMNS = 14; const string USER_TITLES[USER_MAX_COLUMNS] = { "用户ID", "用户类型", "是否新增", "新增来源", "锁桌情况", ...
#ifndef ENGINEWIDGET_H #define ENGINEWIDGET_H #include "stackedwidget.h" #include <QWidget> #include <QObject> #include <string> #include <chrono> class EngineWidget : public StackedWidget { Q_OBJECT int _max_update_rate; bool _isRunning; std::string _nextState; protected: E...
#ifndef MENU_ITEMS_PAPAJOHNS #define MENU_ITEMS_PAPAJOHNS #include "../../menu_component.hpp" class menu_items_papajohns : public menu_component { private: string item_name_papajohns; string item_description_papajohns; double item_price_papajohns; int item_number_papajohns; public: menu_items_papa...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "Components/ActorComponent.h" #include "HealthAndDamageComponent.generated.h" DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FUnitDied, AActor*, Unit); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OnePar...
#include <iostream> int main() { int input_value; std::cin >> input_value; int i = {3}; double wage; double salary = wage = 9999.99; i = 3.14; }
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* TacticalMarine.hpp :+: :+: :+: ...
#ifndef STATE_H_ #define STATE_H_ class State { public: enum InternalState { DEAD, ALIVE }; State(char i_state); State(InternalState i_state); bool operator==(InternalState i_state) const; operator char() const; private: InternalState d_state; }; #endif /* STATE_H_ */
#include "MapTree.hpp" namespace rpg2kLib { namespace model { MapTree::MapTree(SystemString const& dir) : Base(dir) { load(); } MapTree::MapTree(SystemString const& dir, SystemString const& name) : Base(dir, name) { load(); } void MapTree::load() { Base::load(); /* BerEnum& existSr...
#ifndef _ATTACH_PREPROCESSING_INFO_TRAVERSAL_H_ #define _ATTACH_PREPROCESSING_INFO_TRAVERSAL_H_ // DQ (4/5/2006): Andreas has removed this code! // void printOutComments ( SgLocatedNode* locatedNode ); // Need dummy classes and the actual tree traversal class // DQ: Renamed classes, can't have DI and DS polluting th...
#include "command.h" #include <QLatin1String> #include <iostream> const char *Command::getName(Command::ChannelID value) { switch (value) { case CHANNEL_YAW : return "CHANNEL_YAW"; break ; case CHANNEL_ROLL : return "CHANNEL_ROLL"; break ; case CHANNEL_PITCH : return "CHANNEL_PITCH"; break ; ca...
/* * Copyright (c) 2014 Juniper Networks, Inc. All rights reserved. */ #include <stdio.h> #include <string.h> #include <fcntl.h> #include <assert.h> #include <sys/ioctl.h> #include <sys/socket.h> #include <net/if.h> #include "base/logging.h" #include "cmn/agent_cmn.h" #include "sandesh/sandesh_types.h" #include "s...
#include "Board.h" #include <assert.h> Board::Tile::Tile(const Vei2 & pos) : pos(pos), tileArea(pos, Dimension, Dimension) { } void Board::Tile::Draw(Graphics & gfx) const { gfx.DrawRect(tileArea, color); gfx.DrawRectBorder(tileArea, BorderColor); } bool Board::Tile::Contains(const Vei2 in_pos) const { if (in_...
#include <stdio.h> #include <iostream> using namespace std; int main(){ int x, y, z, c, i, j, satu, dua; bool ketemu; cout<<"Masukkan x: "; cin>>x; cout<<"Masukkan y: "; cin>>y; cout<<"Masukkan z: "; cin>>z; ketemu=false; dua=0; c=z/y; for (i=1; i<=c; i++){ ...
class Trie { public: struct TrieNode { TrieNode * child[26]; bool isWord; TrieNode () : isWord(false) { for (auto &a : child) a = nullptr; } }; Trie() {root = new TrieNode();} void insert(string & s) { TrieNode * p = root; for (char &...
/* https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWXRQm6qfL0DFAUo 5656. [모의 SW 역량테스트] 벽돌 깨기 DFS BFS로 구현했을 때 시간초과남 void CrushBrick(int r, int c, int s) { queue<pair<pair<int, int>, int>> Q; Q.push({ { r, c }, s }); Visited[r][c] = true; while(Q.empty()...
/* 单例模式: 动机:在软件系统中,经常有这样的一些特殊的类,必须保证他们在系统中只存在一个实例, 这样才能保证他们的逻辑正确性,以及良好的效率 如何绕开常规的构造器,提供一种机制来保证一个类只有一个实例? (我们不能单单说,我们(类设计者)告诉用户(类使用者),你就只能实例化一个对象,不要弄多了) 这应该是类设计者的责任,而不是使用者的责任 模式定义:保证一个类仅有一个实例,并提供一个该实例的全局访问点 实现版本: 1、懒汉模式:顾名思义,非常“懒”,懒汉模式不会迫切需要单例模式,只有在第一次需要 该单例实例对象的时候才会生成该单例实例对象,之后再获得该单例实例时, 该单例...
#ifndef LXAMODELS_H #define LXAMODELS_H #include <QSortFilterProxyModel> #include <QStandardItemModel> #include "generaldefinitions.h" class CWordCollection; class CStemCollection; class CSuffixCollection; class CHypothesis; class MainWindow; class LxaStandardItemModel : public QStandardItemModel { Q_OBJECT publ...
#include <iostream> #include <algorithm> #include <queue> #include <set> #include "Graph.h" using namespace std; Graph::Graph() {} void Graph::addEdge(int vertex, int adjacentVertex, int weight) { auto result1{ addVertex(vertex) }; auto result2{ addVertex(adjacentVertex) }; result1->adjacents[result2] = weight; r...
#ifndef RESOURCELIB_MESH_MESH_H #define RESOURCELIB_MESH_MESH_H #include "Resource.h" #include "FileHeaders.h" namespace Resources { class Mesh : public Resources::Resource { public: struct Vertex { float position[3]; float normal[3]; float tangent[3]; float uv[2]; }; struct VertexAnim { ...
// This file has been generated by Py++. #include "boost/python.hpp" #include "generators/include/python_CEGUI.h" #include "WindowFactoryManager.pypp.hpp" namespace bp = boost::python; void register_WindowFactoryManager_class(){ { //::CEGUI::WindowFactoryManager typedef bp::class_< CEGUI::WindowFactoryM...
#include "BasicCalculatorII.hpp" #include <stack> using namespace std; int BasicCalculatorII::calculate(string s) { vector<BasicCalculatorII::Token> tks = parse(s); stack<int> vals; stack<BasicCalculatorII::Token> ops; vector<BasicCalculatorII::Token> postOrder; for (auto &t : tks) { if ...
//////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2006-2010 MStar Semiconductor, Inc. // All rights reserved. // // Unless otherwise stipulated in writing, any and all information contained // herein regardless in any format shall remain the sole proprietary of ...
#ifndef PROPERTIES_H #define PROPERTIES_H #include <QString> #include <QCoreApplication> #include <QDomDocument> #include <QMap> #include <QFile> #include <ConstProperties.h> class Properties { protected: QDomDocument xmlDocument; QByteArray readFile(const QString path); public: Properties() {} virtu...
/* Copyright (c) 2011 Andrew Wall 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, modify, merge, publish, distribut...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "../base.h" #include "Windows.Devices.Sms.0.h" #include "Windows.Foundation.0.h" #include "Windows.Storage.Streams.0.h" #include "Windows.Foundation.Collections.1.h" #include "Windows....
/** * Copyright (C) 2017 Alibaba Group Holding Limited. 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 * * ...
#include <RFduinoBLE.h> #define SENSOR_COUNT 7 #define HIT_THRESHOLD 140 class HitSensor { public: HitSensor(byte sensorPin, byte id); byte sensorPin; byte id; int hitThreshold = HIT_THRESHOLD; bool enabled = false; bool isHitting = false; unsigned long hitTime = 0; }; HitSensor::HitSensor(byte sensorPi...
#pragma once //PageUpKey.h #ifndef _PAGEUPKEY_H #define _PAGEUPKEY_H #include "KeyAction.h" class PageUpKey :public KeyAction { public: PageUpKey(Form *form = 0); PageUpKey(const PageUpKey& source); ~PageUpKey(); PageUpKey& operator=(const PageUpKey& source); virtual void OnKeyDown(UINT nChar, UINT nRepCnt, UIN...
/* this is the solution of beakjoon #10451 https://www.acmicpc.net/problem/10451 */ #include <iostream> #include <vector> using namespace std; vector<int> a[1001]; int check[1001]; void dfs(int x){ check[x]=1; int next=a[x][0]; if(check[next]==0){ dfs(next); } } int main(){ int t; scanf("%d",&t); while(t--)...
// --------------------------------------------------------------------------- // tools.cpp // Tools library. Unsorted utility functions. // // author. ebarsall // // Remarks // None. // --------------------------------------------------------------------------- #include <stdio.h> #include "tools.h" /// <summary>Com...
/**************************************************************************** ** ** Copyright (C) 2009 Du Hui. ** ****************************************************************************/ #ifndef SERIALCOMM_H #define SERIALCOMM_H #include <qt_windows.h> #include "qserialcomm.h" #include <QIODevice> ...
#pragma once #include <string> #include "drake/manipulation/util/robot_state_msg_translator.h" #include "drake/systems/controllers/plan_eval/generic_plan.h" #include "drake/systems/controllers/zmp_planner.h" namespace drake { namespace examples { namespace humanoid_controller { /** * A baseline manipulation plan i...
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Scalar.cpp :+: :+: :+: ...
#include <string> #include <iostream> #include "FileSystem.h" #include "Commands.h" #include "GlobalVariables.h" using namespace std; VerboseCommand::VerboseCommand(string args):BaseCommand(args){ }; void VerboseCommand::execute(FileSystem & fs) { // Every derived class should implement this function according t...
#include "common\Singularity.Common.h" namespace Singularity { /*#pragma region Methods void Logger::Initialize() { } #pragma region Methods Logger* Logger::Create() { Logger* logger = new Logger(); logger->Initialize(); return logger; } #pragma endregion*/ }
#include "epoll_helper.h" #include "utils.h" #include <fcntl.h> #include <signal.h> #include <sys/signalfd.h> #include <unistd.h> #include <cstring> void epoll_helper::add_event(int fd, uint32_t events) { epoll_event event; event.events = events; event.data.fd = fd; safe_call(::epoll_ctl(epoll_fd, EPO...
/* Copyright (c) 2011 Andrew Wall 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, modify, merge, publish, distribute, sub...
#include <algorithm> #include <array> #include <cstdio> #include <iostream> #include <iterator> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <utility> #include <vector> #define ll long long using namespace std; typedef tuple<ll, ll, ll> tp; typedef pair<ll, ll> pr; const l...
/* *创建人:Huang *创建日期:2019.4.19 *修改日期:2019.4.19 *类:CACLInteger *功能:绝对值函数absoluteValue() */ #include "CACLInteger.hpp" // 求number的绝对值 CACLInteger CACLInteger::absoluteValue() { if (symbol) { CACLInteger temp; temp = *this; temp.symbol = false; return temp; } else { r...
/* EMRAH YILDIRIM 111044056 */ #ifndef CONTAINER_H #define CONTAINER_H #include<vector> using namespace std; namespace HW08 { template <class T> class Container { public: Container(); virtual ~Container(); virtual int size() const = 0; virtual int capacity() const = 0; virtual void empty() = 0; //de...
/////////////////////////////////////////////////////////////////// //Copyright 2019-2020 Perekupenko Stanislav. All Rights Reserved.// //@Author Perekupenko Stanislav (stanislavperekupenko@gmail.com) // /////////////////////////////////////////////////////////////////// #pragma once #include "CoreMinimal.h" #include ...
#include <iostream> #include "network/server.h" #include "network/client.h" #include <raspicam/raspicam.h> using namespace std; using namespace core::network; using namespace raspicam; // 1B typ ramki // 1B typ operacji enum FrameType { FT_Undefined = 0, FT_Camera = 1, // FT_Led, // FT_Gyro, // F...
//! Bismillahi-Rahamanirahim. /** ========================================** ** @Author: Md. Abu Farhad ( RUET, CSE'15) ** @Category: /** ========================================**/ #include<bits/stdc++.h> #include<stdio.h> using namespace std; #define ll long long #define scl(n) cin>...
//! Bismillahi-Rahamanirahim. /** ========================================** ** @Author: Md. Abu Farhad ( RUET, CSE'15) ** @Category: /** ========================================**/ #include<bits/stdc++.h> #include<stdio.h> using namespace std; #define ll long long #define scl(n) scan...
// Connect to a Modbus device via RS485 and send Modbus data to the SIGFOX cloud. // Needs a UnaBiz SIGFOX adapter, DFRobot RS485 shield and FTDI 5V UART-to-USB adapter (e.g. uUSB-PA5) // https://www.dfrobot.com/index.php?route=product/product&product_id=1024 // https://www.dfrobot.com/wiki/index.php/RS485_Shield /...
// -*- C++ -*- // // Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory, // Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC // // This file is part of FreePOOMA. // // FreePOOMA is free software; you can redistribute it and/or modify it // under the terms of the Expat license. // // This progr...
#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> data(n); vector<int> nums(n); for(int i = 0; i < n; i++) { cin >> data[i]; nums[i] = data[i]; } sort(nums.begin(),nums.end()); int counts = 0; for(int i = n-1, j = n-1; i >= 0...
#pragma once #include<iostream> using namespace std; template<class T> class Array { private: T* data; int size; int capacity; public: //构造函数,传入参数capacity构造Array Array(int capacity) { size = 0; data = new T[capacity]; this->capacity = capacity; } //无参数的构造函数,默认capacity为10 Array() { size = 0; data = ...
#ifdef _WINDLL #include "ZobObjectManagerWrapper.h" #include "DirectZob.h" #include "ZobObject.h" namespace CLI { ZobObjectManagerWrapper::ZobObjectManagerWrapper():ManagedObject(DirectZob::GetInstance()->GetZobObjectManager(), false) { } System::String^ ZobObjectManagerWrapper::GetZobObjectList() { return gc...
#include<stdio.h> #include<malloc.h> struct node { int data; struct node *left; struct node *right; }; //struct node *newNode(int); struct node *newNode(int data){ struct node *node=(struct node *)malloc(sizeof(struct node )); node ->data=data; node->left=NULL; node->right; return(node); } int IdenticalTree(struct ...
#include "utils/any.h" #include <vector> #include <map> #include "typedefs.h" namespace modifiers{ typedef any Value; typedef std::vector< Value > VectorValue; typedef boost::shared_ptr< Value > ValuePtr; typedef std::map<String,Value> PropertyList; }
/*Consider a scheduling approach which is non pre-emptive similar to shortest job next in nature. The priority of each job is dependent on its estimated run time, and also the amount of time it has spent waiting. Jobs gain higher priority the longer they wait, which prevents indefinite postponement. The jobs that have ...
#include "globalvariables.h" Graph graph;
#pragma once #include "hit.h" #include "ray.h" #include "material.h" class Object3D { public: Object3D(); Object3D(Material *material); ~Object3D(); virtual bool intersect(const Ray &r, Hit &h, float tmin) = 0; protected: Material * m_material; };
#include <iostream> #include <fstream> #include <string> #include <vector> #include <set> #include <sstream> #include <map> #include "cnf.h" using namespace std; /** * Read the contents of a CNF file and converts to a * vector of Clauses * * @param[in] filename Character array of the DIMACS CNF file * @param[ou...
#include "environment.h" #include "include/tuple.h" Environment::Environment(raytracer::Tuple grav, raytracer::Tuple wi) :gravity{grav}, wind{wi} { } Environment::Environment() { }
#include "physics\Singularity.Physics.h" using namespace Singularity::Threading; using namespace Singularity::Components; namespace Singularity { namespace Physics { class PhysicsTask : public Singularity::Threading::Task { DECLARE_OBJECT_TYPE; private: #pragma region Static Variables ...
#include "tic_tac_toe_manager.h" #include "tic_tac_toe_3.h" #include "tic_tac_toe_4.h" #include<iostream> #include<string> using std::cout; using std::cin; using std::string; using std::unique_ptr; using std::make_unique; int main() { char cont = 'y'; TicTacToeData data; unique_ptr <TicTacToeManager> manager = ma...
#ifndef MYGRAFICVIEW_H #define MYGRAFICVIEW_H #include <QWidget> #include <QGraphicsView> #include <QGraphicsScene> #include <QGraphicsItemGroup> #include <QTimer> class mygraficview: public QGraphicsView { Q_OBJECT public: explicit mygraficview(QWidget *parent = nullptr); protected slots: void mousePres...
#ifndef _HS_SFM_BUNDLE_ADJUSTMENT_BA_NAIVE_AUGMENTED_NORMAL_MATRIX_HPP_ #define _HS_SFM_BUNDLE_ADJUSTMENT_BA_NAIVE_AUGMENTED_NORMAL_MATRIX_HPP_ #include "hs_math/linear_algebra/eigen_macro.hpp" #include "hs_sfm/bundle_adjustment/ba_naive_normal_matrix.hpp" namespace hs { namespace sfm { namespace ba { ...
#pragma once #include "nginx.hpp" class NgxClock final { public: NgxClock() = default; ~NgxClock() = default; public: static const ngx_time_t& now() { //更新缓存时间 ngx_time_update(); //获取缓存时间 return *ngx_timeofday(); } ngx_time_t delta() const { auto t...
#include "ResourceModel.h" #include "Application.h" #include "ModuleFileSystem.h" #include "ModuleResourceManager.h" RESOURCE_DEFINITION(Resource, ResourceModel); ResourceModel::~ResourceModel() { for (auto iter = nodes.begin(); iter != nodes.end(); ++iter) { RELEASE_ARRAY((*iter)->name); } } const char * Resou...
#include <bits/stdc++.h> using namespace std; int main() { int n,i,len; cin>>n; char a[1000]; while(n--){ cin>>a; len = strlen(a); for(i=0;i<len/2;i++){ cout<<a[i];++i; } cout<<endl; } return 0; }
// // Created by vybirto1 on 8.2.18. // #ifndef ROGUE_CSDLTEXTURE_H #define ROGUE_CSDLTEXTURE_H #include <SDL2/SDL.h> class CSDLTexture { public: CSDLTexture(SDL_Texture * me); ~CSDLTexture(); SDL_Texture* getTexture(void) const; private: void freeData(); SDL_Texture * texture; }; #endif //ROG...
#include <iostream> #include <vector> #include <string> #include <algorithm> void print_message(int value) { std::cout << "Hello " << value << std::endl; } bool match(std::string test) { return test.size() == 5; } int count_strings_of_five(std::vector<std::string>& texts, bool (*matching_string)(std::string ...
// This file is subject to the terms and conditions defined in 'LICENSE' in the source code package #ifndef JACTORIO_INCLUDE_GUI_MENUS_DEBUG_H #define JACTORIO_INCLUDE_GUI_MENUS_DEBUG_H #pragma once #include "core/data_type.h" namespace jactorio::data { class PrototypeManager; } // namespace jactorio::data name...
//#include "CActionListenerMemberFn.h"
#include <iostream> #include <string> using namespace std; //compare with already defined password int compare(const string& s) { string password = "lolkek4eburek"; if (password.length() != s.length()) { return 0; } else { for ( int i = 0; i < password.length(); i++) { if ...
#include <iostream> #include "util/ArrayHelper.h" #include "sort/Select.h" #include "sort/Insert.h" #include "sort/Shell.h" #include "sort/Quick.h" #include "sort/Bubble.h" #include "sort/Merge.h" #include "sort/PriorityQueue.h" #include "sort/Heap.h" #include "advanced/PriorityQueueIndex.h" #include "advanced/Prior...
#include "ConvexHull.h" ConvexHull::ConvexHull() { center.x = center.y= 0; maxy_x = 0; } ConvexHull::~ConvexHull() { } /* find hand with skin color (erode, dilate) find endpoint, centerpoint and tracking them */ Mat ConvexHull::convex(Mat srcImage) { Mat errorMat; dstImage = srcImage.clone(); GaussianBlur(srcI...
// ve cua so //ve hinh 3d // ve luoi //di chuyen hinh //Create Quads #include <iostream> #include <stdio.h> #include <GL/glut.h> using namespace std; int cx=0,cy=0,cz=0; //toa do x, y,z cua hinh_3ds int number;// dung de dem so luong struct tu_giac{ int x1,y1,z1, x2,y2,z2, x3,y3,z3, x4,y4,z4; float r,g,b; int sta...
#include "pch.h" #include <iostream> #include <Windows.h> #include <ctype.h> using namespace std; //Functions bool check(char a[]) { for (int i = 0; i <= strlen(a) - 1; i++) { if (a[i] <= '0' || a[i] >= '9') return false; } return true; } //Functions end int main(int argc, char* argv[]...
#include <fstream> #include <vector> using namespace std; int main () { for (int c = 10; c < 20; c++) { srand(c * c * c); ofstream fout("tests/" + to_string(c) + ".in"); int n = 100000000, m = 50, k = 1000; int k1, k2; if (c % 4 == 0) { k = 10; k1 = 5; } else if (c % 4 == 1) k1 = 0; else if (c % 4 == 2...
// // Created by disooqi on 2020-04-04. // enum class Color {RED, GREEN, BLUE}; enum class Traffic_light {GREEN, YELLOW, RED}; Traffic_light& operator++(Traffic_light& t){ switch (t){ case Traffic_light::GREEN: return t = Traffic_light::YELLOW; case Traffic_light::YELLOW: re...
#include <iostream> #include <sstream> #include <string> #include <stdlib.h> #include "element.h" #include "atom.h" #include "vec.h" using namespace std; void atom :: line_from_in(string tmp, vector<element>& ele_list) { string ele_symbol; stringstream ss; ss<<(tmp); ss>>ele_symbol>>pos>>if_move; ele = nullptr;...
#include "CustomGamesWidget.h" CustomGamesWidget::CustomGamesWidget(int width, int height, QWidget *parent) : QWidget(parent) { this->setFixedSize(width, height); QImage background("images/CustomGames/background.png"); m_background = new QLabel(this); m_background->setPixmap(QPixmap::fromImage(back...
#include "img_manager.h" namespace fgtcc { namespace imgproc { //imgType 包括png bmp jpg jpeg等opencv能够进行编码解码的文件 std::string Mat2Base64(const cv::Mat &img, std::string imgType) { //Mat转base64 std::string img_data; std::vector<uchar> vecImg; std::vector<int> vecCompression_params; vecCompression_params.push_bac...
/* Copyright 2017-2018 All Rights Reserved. * Gyeonghwan Hong (redcarrottt@gmail.com) * * [Contact] * Gyeonghwan Hong (redcarrottt@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 Lic...
#ifndef _HO_SKY_H_ #define _HO_SKY_H_ #include <vector> #include <list> #include <string> #define USER_SKY_ADD_CODE 10000 //코드값이 겹쳐서 더해주는 코드값 (하늘 코드값과 던젼 코드값이 겹쳐서) //읽어 들인 리소스 정보 struct skyResInfo { std::string resName; //읽어들일 리소스의 이름 int fadeSlowFlag; //Fade를 늦게 하는 Sky 요소(Fade를 같이 할경우 메시의 라인이 보인다) ...
/*************************************************************************** Copyright (c) 2020 Philip Fortier 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 the Free Software Foundation; either version 2 of the License, or...
#include "stdafx.h" #include "render_system/render_system_font.h" #include "base/nextai_basic_types.h" #include "base/nextai_file_system.h" #include "render_system/render_system.h" #include "freetype/freetype.h" namespace NextAI { Font::Font() { } Font::~Font() { } Font* WindowsFont::a...