text
stringlengths
8
6.88M
#ifndef __j1RENDER_H__ #define __j1RENDER_H__ #include "SDL/include/SDL.h" #include "Point.h" #include "j1Module.h" #include <vector> enum class ORIENTATION { NO_TYPE = 0, SQUARE_ORDER, //All cameras have the same width and height, even if it is not square order the maximum number of cameras. HORIZONTAL, //Th...
#include "condevent.hpp" #include "condition.hpp" #include "event.hpp" #include "scene/player/role.hpp" namespace nora { namespace scene { pd::result condevent_check(const pd::condevent_array& cea, const role& role, const pd::ce_env& ce) { auto result = pd::NOT_FOUND; ...
#include "Binary_Search_Tree.h" #include <stack> //添加結點 template <class Item> bool Binary_Search_Tree<Item>::insert(const Item &item) { TreeNode<Item> *node = new TreeNode<Item>(item); if(root == NULL) root = node; else{ TreeNode<Item> *p = root; TreeNode<Item> *loop = root; while ...
#include <iostream> #include <string> #include "Product.hpp" Product::Product(): mark("Golf"), price(100), count(0), product_name(product::none) {} Product::Product(const std::string& mark, const double& price, const unsigned int& count): mark(mark), price(price), count(count), product_name(product::none) {} void P...
#include "stdafx.h" #include "CalProteinProbShareEqual.h" #include <iostream> #include <set> CCalProteinProbShareEqual::~CCalProteinProbShareEqual(void) { } void CCalProteinProbShareEqual::calculateProteinProbabilityOut(ofstream& out) { double dProbability=1.0; set<string> setPeptideName;//考虑多个peptide对应一个peptide...
#ifndef MYCOIN_H #define MYCOIN_H #include <QWidget> #include <QPushButton> #include <QTimer> class MyCoin : public QPushButton { Q_OBJECT public: MyCoin(QString butImg); // butImg 图片路径 int posX; // x坐标 int posY; // y坐标 bool flag; // 正反标志 // 特效 void changeFlag(); QTimer* timer1; ...
#include <ros/ros.h> #include "PickAndPlaceNode.h" int main(int argc, char *argv[]) { ros::init(argc, argv, "hdt_pick_and_place"); PickAndPlaceNode node; if (!node.initialize()) { ROS_ERROR("Failed to initialize Pick And Place Node"); return 1; } return node.run(); }
#ifndef _UTIL_D9E2673EFADA464D9659570557AD587E #define _UTIL_D9E2673EFADA464D9659570557AD587E #include <string> #include <functional> namespace util { bool PathExists(std::string path); bool IsRegularFile(std::string path); bool IsDirectory(std::string path); std::string BaseName(std::string path);...
#include <iostream> #include <algorithm> #include <cstring> #include <vector> #define MAX 101 int n, m, X[MAX][MAX], Y[MAX][MAX], d[MAX * 10]; bool blocked[MAX][MAX], check[MAX * 10]; std::vector<int> adj[MAX * 10]; bool dfs(int x) { if(check[x]) { return false; } check[x] = true; for(auto ...
#pragma once #include <string.h> #include <string> #include "json/json.h" //#include "GameInfo.h" namespace SqlLogic { bool GetUserInfo(int32_t nMid , Json::Value& info, bool bUseCache = true); int GetSiteMidByKey(std::string deviceNo, int productId); int getSitemidByIosKey(std::string strDeviceNo, std::string ...
// // Created by cirkul on 27.11.2020. // #include "Elephant.h" Animal *Elephant::spawn(Playground &pg, int i, int j) { Elephant *newAnimal = new Elephant(pg, i, j); ++newAnimal->home->creatureCount; newAnimal->pg->newCreatures[newAnimal] = 1; newAnimal->pg->allAnimals.push_back(newAnimal); newAni...
#include <fstream> #include "two_input_denoise_pipeline_opt.h" int main() { ofstream in_pix("input_pixels_regression_result_two_input_denoise_pipeline_opt.txt"); ofstream fout("regression_result_two_input_denoise_pipeline_opt.txt"); HWStream<hw_uint<32> > f_update_0_read; HWStream<hw_uint<32> > u_update_0_read...
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main(){ string s; string ans; cin >> s; if (s.size() == 2){ ans = s; }else{ char tmp; tmp = s[0]; s[0] = s[2]; s[2] = tmp; ans = s; } cout ...
// // main.cpp // 2017.2.26.10.43.1.1 // // Created by Thai Cao Ngoc on 26/2/17. // Copyright © 2017 Thai Cao Ngoc. All rights reserved. // #include <iostream> #include <string> #include <cctype> #include <bitset> class IsUnique { public: bool isUniqueArray (std::string& string) { if (string.size() > 128) r...
/* #include <iostream> #include <vector> #include "tools.h" int main() { std::vector<gtarma::model::Item> items = gtarma::GetFiles(); for (int i = 0; i < items.size(); i++) { gtarma::DownloadFile(items[i], ""); } return 1; } */
/*============================================================================= Copyright (c) 2014 Anton Bikineev // SPDX-License-Identifier: BSL-1.0 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =========...
#pragma once #include <iberbar/RHI/D3D9/Headers.h> #include <iberbar/RHI/VertexDeclaration.h> namespace iberbar { namespace RHI { namespace D3D9 { class CDevice; class __iberbarD3DApi__ CVertexDeclaration : public IVertexDeclaration { public: CVertexDeclaration( CDevice* pDevice, const UVer...
#include "Utils.h" string removeWhitespaces(string str) { str.erase(remove_if(str.begin(), str.end(), [](char c) { return isspace(c, cin.getloc()); }), str.end()); return str; } void playWow() { const int wowFileCount = 6; int fileNumber = rand() % wowFileCount; stringstream comm...
// // Created by Zakhar on 07.03.2017. // #include <string> #include <iostream> #include "Testing.h" #include "Algebra/CentroidDecomposition.h" #include "Algorithms/CDMissingValueRecovery.h" #include "Stats/Correlation.h" #include "Algebra/Auxiliary.h" #include "Algebra/RSVD.h" #include <armadillo> using namespace ...
//--------------------------------------------------------------------------- #include <vcl.h> #include <tchar.h> #pragma hdrstop #include <System.IOUtils.hpp> #include <System.RegularExpressions.hpp> #include "TFrmMain.h" #include "EsDibUtilities.h" // use jpeg, png and gif support #include <jpeg.hpp> ...
../1075/C.cpp
#include "CQEnum_Pch.hpp" #include "CQEnum.hpp" namespace CQSL { namespace CQEnum { void ConstInfoList::ParseFrom(InputSrc& srcFile) { static const char* const pszExpectedErr = "Expected constant definition or end of constants"; // // We are looking for const, constexpr, or external const lines, or th...
#include <iostream> #include <string> #include "big_integer.h" #include "optimized_vector.h" using namespace std; int main() { optimized_vector *a = new optimized_vector(); while (true) { string s; cin >> s; if (s == "exit") { return 0; } else if (s == "push_back"...
#pragma once namespace BeeeOn { /** * @brief Representation of a logical expression in form: * <code>left</code> <em>operator</em> <code>right</code>. * The operator can be on of: * * - == - equals * - != - not equals * * The <code>left</code> and <code>right</code> parts are * strings without whitespace. *...
#pragma once #include <SFML/Network.hpp> #include <iostream> #include "Game.h" class Client { public: Client(); bool find_server(); bool connect(); ClientId get_id(); bool send(sf::Packet& packet); bool recieve(sf::Packet& packet); void disconnect(); ~Client(); private: sf::Tc...
struct SkyDome { double radius; DrawItem draw_item; struct { Texture atmospheric_scattering_lookup; } textures; struct { Uniform proj; Uniform view; Uniform p; Uniform n; } uniforms; }; bool InitSkyDome(SkyDome &sky, double radius, ...
#include "LidarData.h" #include <algorithm> lidar::point_t lidar::Map::transform(const LidarData& data) const { point_t p; p.x = data.robPos.x + data.dist * cos(deg2rad(data.robPos.theta + data.angle - 5)); p.y = data.robPos.y + data.dist * sin(deg2rad(data.robPos.theta + data.angle - 5)); return p; } lidar::Ma...
#pragma once #include <string> #include <array> #include <memory> #include <unordered_map> #include <QString> #include <boost/utility/string_view.hpp> #include "assertImpl.h" #include "CoreUtils.h" #include "assertImpl.h" namespace PticaGovorun { // The Int which can be adorned with some useful debug information. In ...
#include "persona.h" #include "casos.h" #include "secuestro.h" #include <string> #include <sstream> #include <vector> #include <iostream> using std::cout; using std::endl; using std::string; using std::stringstream; using std::vector; Secuestro::Secuestro(int numero_caso, vector<Persona> investigadores, vector<Evidenc...
#include <iostream> #include <string.h> #include <string> #include <vector> using namespace std; class Person { public: Person() { } Person(int age, string name) { this->age = age; this->name = name; } bool operator==(Person &p2) { return this->age == p2.age && ...
// Created on: 1997-05-09 // Created by: Christian CAILLET // Copyright (c) 1997-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 ...
#include "Loader.h" #include "glad/glad.h" #include <iostream> #include <iostream> #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" using namespace std; extern const char* IMAGE1_FILLPATH; extern const char* IMAGE2_FILLPATH; class RawModel* Loader::loadToVao(float vertices[], int size,unsigned int indexData[]...
#include <WiFiClient.h> #include <PubSubClient.h> #define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT #define ETH_PHY_POWER 12 #include <ETH.h> // CHANGE THESE SETTINGS FOR YOUR APPLICATION const char* mqttServerIp = "18.195.250.188"; // IP address of the MQTT broker const short mqttServerPort = 1883; // IP port of the MQTT ...
#include "GetPlayInfo.h" #include "ClientHandler.h" #include "Logger.h" #include "Configure.h" #include "Player.h" #include "GameServerConnect.h" #include "PlayerManager.h" #include "HallHandler.h" #include "Util.h" #include <json/json.h> #include "NamePool.h" #include "RobotUtil.h" #include <string> using namespace st...
// 더블 링크드 리스트 구현 #pragma once template <typename T> class ListNode { template <typename T> friend class DoubleLinkedList; template <typename T> friend class DoubleLinkedListIterator; template <typename T> friend class DoubleLinkedListReverse; private: ListNode() { } ~ListNode() { ...
// // NamedMutex_WIN32U.h // // $Id: //poco/1.4/Foundation/include/_/NamedMutex_WIN32U.h#1 $ // // Library: Foundation // Package: Processes // Module: NamedMutex // // Definition of the NamedMutexImpl class for Windows. // // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. // and Contributors....
#include<iostream> #include<cstdio> using namespace std; int main() { int t; cin>>t; while(t--) { int n; int cnt=0; cin>>n; int a[n]; for(int i=0;i<n;i++) { cin>>a[i]; } for(int i=0;i<n;i++) { if(a[i]==0){ cnt++; }else{ for(int j=i+1;j<n;j++) { if(a[i]==2*a[...
#pragma once #include <string> #include <map> class Dictionary { public: void addDefinition(std::string word, std::string definition); std::string getDefinition(std::string word) const; void printAll() const; private: std::map<std::string, std::string> dictionary; };
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// // Булевый тип данных. Простые примеры // V 1.0 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// #include<iostream> using namespace std; int main() { cout << boolalpha; bool a = false; // 0 - false, 1...
#ifndef CEZNOTIFYMESSAGE_H #define CEZNOTIFYMESSAGE_H #include "EZWBDef.h" #include <set> #include <list> #include <mutex> using namespace eztalks; typedef struct{ int32_t nWBId; int32_t nMsgId; int64_t nParam1; int64_t nParam2; }EZMsg_t; typedef std::set<INotifyMessageListener*> Li...
// Robert Fus // CSCI 6626 - Object-Orientated Principles & Practices // Program 3: Game // File: Square.cpp // 9/12/2019 #include "Square.hpp" #include "game.hpp" #include "Cluster.hpp" #include "StreamErrors.hpp" void testState(); void testSquare(); void testBoard(); void testCluster(); //-------------------------...
#pragma once class MathHelper { public: void swap(int * left, int * right); };
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/app18.unoproj.g.uno. // WARNING: Changes might be lost if you edit this file directly. #include <_root.app18_ButtonEntryMyCoupon_Category_Property.h> #include <_root.ButtonEntryMyCoupon.h> #include <Uno.Bool.h> #include <Uno.UX.IPropertyListener...
#include<iostream> #include<vector> #include<algorithm> using namespace std; class NumArray { public: NumArray(vector<int>& nums) { //基本思想:因为会多次调用sumRange方法,所以每次都逐个相加计算子区间的和不是理想的做法 //可以使用partisum[i]存储partisum前i个元素的和。则可得到i-j 子区间的和为partisum[j]-partisum[i-1] int sum = 0; for (int i = 0; i < nums.size(); i++) {...
#pragma once #include "Helpers.h" #include <cpphttplib/httplib.h> #include <cstdint> #include <unordered_set> class KeyManager; struct AccessKeys; class APIServer { public: explicit APIServer(uint32_t port, const std::string& secret, KeyManager& keyManager); void run(); private: httplib::Server m_ser...
#include <iostream> long long fact( long long x){ if(x == 1) return 1; else return x*fact(x-1);} using namespace std; int main() { cout<<fact(10); return 0; }
// C++ STL headers #include <iostream> #include <vector> #include <stdexcept> #include <system_error> // Linux system headers #include <sched.h> #include <unistd.h> #include <stdlib.h> #include <grp.h> #include <string.h> #include <sys/types.h> #include <sys/wait.h> // My headers #include "util.h" #include "log.h" usi...
#pragma once #include <msscript.h> class CScript { public : CScript() : isReady_(FALSE) {}; void Set(CComPtr<IDispatch> const& scriptDispatch) { this->pScriptControl_ = scriptDispatch; isReady_ = TRUE; } BOOL isReady() { return this->isReady_; } HRESULT Eval(wchar_t const* express...
/* Q: Write a C++ program to create class Item with data members Item_code, Item_name,Item_price. Write a member function to accept and display number of objects created for class. Use Static Data Member and Member Function */ #include<string.h> using namespace std; class Item{ private: char it...
#include <iostream> using namespace std; struct RBNode{ RBNode*left; RBNode*right; RBNode*up; char colour; int key; }; leftRotate(RBNode *T,RBNode *x) { RBNode *NULLT=T->up; RBNode *y=x->right; x->right=y->left; y->left->up=x; y->up=x->up; if(x->up==NU...
#pragma once //使用するヘッダー #include "GameL\SceneObjManager.h" //使用するネームスペース using namespace GameL; //オブジェクト : 敵(あじ) class CObjEnemy1 : public CObj { #define ALL_ENEMY_SIZE (32.0f) public: CObjEnemy1(float x, float y) ; ~CObjEnemy1() {}; void Init(); //イ二シャライズ void Action(); //アクション void Draw(); //ドロー ...
// // Created by ebinsaad on 28/09/17. // #include "list.h" #include <stdlib.h> void InitiateList(LinkedList * ptrList){ ptrList->head= nullptr; ptrList->size = 0; } void InsertNode(ListData lData, LinkedList *ptrList) { ListNode * ptrNode = (ListNode*)malloc(sizeof(ListNode)); ptrNode->data = l...
/* * Copyright (c) 2011 Pierre-Etienne Bougué <pe.bougue(a)gmail.com> * Copyright (c) 2011 Florian Colin <florian.colin28(a)gmail.com> * Copyright (c) 2011 Kamal Fadlaoui <kamal.fadlaoui(a)gmail.com> * Copyright (c) 2011 Quentin Lequy <quentin.lequy(a)gmail.com> * Copyright (c) 2011 Guillaume Pinot <guillaume.pino...
// format :if not initiallize parameters #include<iostream> using namespace std; int main() { pair<int,float> p1; pair<char,string> p2; cout<<"p1: "; cout<<p1.first<<" "<<p1.second<<endl; cout<<"p2: "; cout<<p2.first<<" "<<p2.second<<endl; }
/* Copyright 2021 University of Manchester 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 applicable law or agreed to in writing, s...
#include <stdio.h> int jam,menit,detik,sum; int main() { scanf("%d %d %d",&jam,&menit,&detik); sum+=(jam*3600)+(menit*60)+detik; scanf("%d %d %d",&jam,&menit,&detik); sum-=((jam*3600)+(menit*60)+detik); if(sum<0) sum*=-1; printf("%d\n",sum); }
//#array 执行效率比<vector>高 #include <iostream> #include <array> #include<vector> #include<algorithm> using namespace std; struct bird { int a,b; }; int main () { //******************************************************初始化template <class T,size_t N> class array, T是数据类型(泛型),后面是长度****************************** /*int一维数组...
#ifndef MYTREAP_H #define MYTREAP_H #include <QDebug> template <typename T> class MyTreap { public: MyTreap() { } struct node { T x; int y; node *left,*right; node (T nx,int ny) { x = nx; y = ny; left = ...
#ifndef AVIONES_H_INCLUDED #define AVIONES_H_INCLUDED #include <cstring> #include "Servicio.h" using namespace std; class Aviones:public Servicio{ public: //Constructores Aviones(); Aviones(string,int,Fecha,int,string,char,double,string,int,int); //Metodos de Acceso int getCantPersonas(); int g...
#include <stdlib.h> #include <tuple> class World; class Player { private: int number; int x; int y; World * myWorld; public: Player(int n, std::pair<int, int> pos ); bool setPosition(std::pair<int, int> position); std::pair<int, int> getPosition(); ...
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ float num1 = 3; float num2 = 6; float result; result = num1/num2; printf("%f",result); ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2008 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Yngve Pettersen */ #include "core/pch.h" #if defined(_NATIVE...
/* * File : receiver.cpp Nama: Ivan Ausiri NIM: 13513039 */ #include <iostream> #include <unistd.h> #include <pthread.h> #include <netinet/in.h> #include <arpa/inet.h> #include "dcomm.h" #include "receiver.h" using namespace std; struct sockaddr_in addr; struct sockaddr_in *sockaddr_ipv4; socklen_t addrLength = size...
#include "main.h"; int main( int argc, char* argv[]) { //INITIAL FUNCTION CALL ON LOAD GameObject Game = GameObject(); Game.Run(); return 0; } GameObject::GameObject() : _gameState(GameState::PLAY), _gameStateLoaded(false) { } void GameObject::Run() { Init(); //DECLARE ANY TEMP VARIABLES HERE FOR DEBUG PURPOS...
#include <iostream> #include <vector> using namespace std; class TrieNode { public: bool isWord; bool isAdded; TrieNode *children[26]; TrieNode(){ isWord = isAdded = false; for(int i=0;i<26;i++) children[i] = NULL; } }; class Trie{ public: TrieNode *root; Trie(vector<string>& words){ ...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 1995-2010 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * @author Arjan van Leeuwen (arjanl) */ #include "platforms/quix/toolkits/kde4/Kde4Ui...
/* Operator overloading passing two arguement for biary operator using friend function */ #include<iostream> using namespace std; class add_complex { public: int real,complex; add_complex(); add_complex(int real,int complex); friend add_complex operator +(add_comp...
#include "nan.h" #include "ODBCConnection.hh" #include "ODBCStatement.hh" #include "ODBCTransaction.hh" NAN_MODULE_INIT(Init) { NC::ODBCConnection::Init(target); NC::ODBCStatement::Init(target); NC::ODBCTransaction::Init(target); } NODE_MODULE(NC, Init)
#pragma once #include "l10n/Translator.h" namespace BeeeOn { /** * The NoTranslator returns the key without any formatting. */ class NoTranslator : public Translator { public: std::string formatImpl( const std::string &key, const std::vector<Poco::Dynamic::Var> &args) override; }; class NoTranslatorFactory :...
#pragma once #include "entity/entity.h" #include "component/component.h" #include "component/poscomponent.h" #include "entity/interfaces.h" #include "mesh/mesh.h" namespace component { struct MeshComponentDesc : public ComponentDesc { string mesh; string transformComponent; }; class MeshCompo...
#include <bits/stdc++.h> using namespace std; long long len1,counta,countb,temp,aattempt = 5,battempt = 5; bool flag = 0; int main() { string str; while(getline(cin,str)) { counta = 0; countb = 0; flag = 0; aattempt = 5; battempt = 5; for(int i = 0; i < 10;i++) { if( ...
#ifndef FORNODE_H #define FORNODE_H #include "Node.hpp" #include "ClassNode.hpp" class ForNode : public Node { private: string iterator; Node *itVal; Node *condition; Node *operation; Node *value; public: ForNode(string iterator, Node *itVal, Node *condition, Node *operation, Node *value); ...
/* * Copyright (C) 2013 Tom Wong. All rights reserved. */ #include "gtusermanager_p.h" #include "gtuserclient.h" #include <QtCore/QDebug> #include <QtCore/QMutex> #include <QtNetwork/QHostAddress> #include <QtSql/QSqlError> #include <QtSql/QSqlQuery> #define MAX_ACCOUNT 5 GT_BEGIN_NAMESPACE class GtUserManagerPriv...
#include "RangeArray.h" #include <iostream> using namespace std; RangeArray::RangeArray(int a,int b):Array(b-a+1) { low=a; high=b; } RangeArray::~RangeArray() { } int RangeArray::baseValue(){ return low; } int RangeArray::endValue() { return high; } int& RangeArray::operator[](int i) { static int temp; if(i>=low&...
#include<iostream> #include<cstdio> using namespace std; #define ll long long // not solved void binary_representation(int n) { cout << n << "\t"; for (int i = 31; i >= 0; i--) { if (n & (1 << i)) cout << 1; else cout << 0; } cout << "\n"; } int count_ones(int n) { int cnt = 0; while ...
#pragma once #include "../../Toolbox/Toolbox.h" #include "../Keys/Keys.h" #include "../Keys/KeyState.h" #include "../../Maths/Primitives/TRect.h" namespace ae { class Window; namespace Input { class InputManager; /// \ingroup input /// <summary>Determine if the given key is a keyboard key...
#include <iostream> #include <cstring> #include <vector> struct fish { int x; int y; int way; }; int dx[9] = {0, -1, -1, 0, 1, 1, 1, 0, -1}, dy[9] = {0, 0, -1, -1, -1, 0, 1, 1, 1}, eat; void dfs(int ans, std::vector<fish> f, std::vector<int> dead, std::vector<std::vector<int>> map) { eat = std::max(eat,...
#include <iberbar/Utility/Timer/GlobalTimer.h> #ifdef _WIN32 #include <Windows.h> #include <Mmsystem.h> #pragma comment( lib, "winmm.lib" ) #endif iberbar::CGlobalTimer::CGlobalTimer( void ) : m_bInit( false ) , m_nOneSecondTicks( 0 ) , m_nTimeStart( 0 ) , m_nTimePrevRun( 0 ) , m_nMinSliceRun( 1000 ) ...
/** * @file SaveFileDialog.h * @brief 包含类 SaveFileDialog的定义 */ #ifndef SAVEFILEDIALOG_H #define SAVEFILEDIALOG_H #include <qdialog.h> class QLabel; class QLineEdit; class QPushButton; /**      *  @class SaveFileDialog     *  @brief 继承自QDialog类.   *  保存用户编辑内容的对话框 */ class SaveFileDialog : public QDialog ...
#include<iostream> #include<cstring> #include<vector> using namespace std; int main() { //要有一个结束符号,此处以#作结束符 //基本设计 string str; char ch; while(cin.get(ch)&&ch!='#') //可以存换行符,空格 str+=ch; cout<<"输出结果是:"<<str; //其余的视情况一般用cin或cin.get(&arry,int)或cin.getline(&arry,int)或getline(cin,st...
/* Copyright (c) 2016, Los Alamos National Security, LLC All rights reserved. Copyright 2016. Los Alamos National Security, LLC. This software was produced under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National Laboratory (LANL), which is operated by Los Alamos National Security, LLC for the ...
/* * @lc app=leetcode.cn id=372 lang=cpp * * [372] 超级次方 */ // @lc code=start #include<iostream> #include<vector> using namespace std; // 这算是我AC的第一道结果取模的题 class Solution { public: int base = 1337; int mypow(int a,int b) { if(b==0)return 1; a %= base; if(b%2 == 1){ ...
int digit_sum(ll n){ if(n < 10) return n; return digit_sum(n/10) + n%10; }
/* Copyright 2014-2016 Fogo Digital, Inc; All Rights Reserved * */ #include "draw.hpp" #include "sgfx.hpp" #include "ui/Menu.hpp" using namespace ui; Menu::Menu() { // TODO Auto-generated constructor stub m_current = 0; animation.set_type(AnimationAttr::PUSH_LEFT); animation.set_path(AnimationAttr::SQUARED); ...
// Created on: 1997-01-17 // Created by: Didier PIFFAULT // Copyright (c) 1997-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 GN...
#pragma once #include "sub_trie_decl.hpp" inline trie::sub_trie::sub_trie(trie& base_trie, trie_node& node, key_type const& prefix) : base_trie_(base_trie), root_node_(node), prefix_(prefix) { for (auto && value : *this) { ++value_nodes_count_; } } inline base_trie::key_type trie::sub_trie::ge...
#include <bits/stdc++.h> using namespace std; #define TESTC "" #define PROBLEM "11059" #define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0) int main(int argc, char const *argv[]) { #ifdef DBG freopen("uva" PROBLEM TESTC ".in", "r", stdin); freopen("uva" PROBLEM ".out", "w", stdout); #endif int num; l...
#include "AncillaryRecords/UvListRecord.h" #include "VertexListRecord.h" #include <fstream> #include "StreamUtilities.h" using namespace std; using namespace OpenFlight; //------------------------------------------------------------------------------ VertexListRecord::VertexListRecord(PrimaryRecord* ipParent) : Prim...
#include <iostream> #include <algorithm> #include <stdio.h> #include <vector> using namespace std; typedef long long ll; vector<ll> a; int main() { for (int i = 1; ; ++i) { ll x = ll(3) * ll(i) * ll(i) - ll(3) * ll(i) + 1; if (x > 1e12) break; a.push_back(x); } while (true) { ll x; cin >> x; if (x ==...
#ifndef LTSIMPLEPATH_H #define LTSIMPLEPATH_H #include "common.h" #include "HashTreeMap.cc" #include <map> #include <deque> #include <set> #include <list> #include <vector> #include <queue> #include <cstdio> #include <algorithm> #include <cmath> #include "MC.h" #include "LDAG.h" using namespace _MC; namespace _LTSi...
#include "OrthographicCameraController.h" #include <iostream> OrthographicCameraController::OrthographicCameraController(Input &input, float aspectRation) : m_input(input), m_aspectRatio(aspectRation), m_zoom(2.0f) { m_camera = OrthographicCamera(-m_aspectRatio * m_zoom, m_aspectRatio *...
#include "geom/wavy.h" #include "geom/transform.h" using namespace glm; Wavy::Wavy(vec3 _normal, float _offset) : normal(_normal), offset(_offset) { normal = normalize(normal); trans = mat4(1.f); } float Wavy::dist(vec3 *pt, vec3 *dir) { return sin(pt->z); } void Wavy::debug() { printf("Wavy\n"); }
#include "board.h" Board::Board(XY pos, XY size, GameManager *game) : Element(pos, size, 1, game) { //_pos = pos; //_size = size; } void Board::updateElement() { //nic sie nie moze zmienic } void Board::getHurt(int damage) { //cannot be damage }
#include "dvrnvrplaybackdialog.h" #include "ui_dvrnvrplaybackdialog.h" #include <iostream> #include <QDial> #include "skinneddial.h" using namespace std; using namespace std::chrono; using namespace std::experimental; DVRNVRPlaybackDialog::DVRNVRPlaybackDialog(QWidget *parent) : QDialog(parent), ui(new U...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2011 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #include "core/pch.h" #ifdef WAND_SUPPORT #include "modules/wan...
#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 10e17 // 4倍しても(4回足しても)long longを溢れない #define rep(i,n) f...
#pragma once #include <bitset> #include <string> #include <vector> #define BLOOM_SIZE 256 int summationSeries(const int n); std::vector<std::string> listSubStrings(const std::string str); std::bitset<BLOOM_SIZE> generateBloom(const std::string str);
#ifndef LOGGER_H #define LOGGER_H #endif #include <fstream> #ifndef RELEASE #include <iostream> #endif #include <string> #include <time.h> #define ERROR 1 #define WARNING 2 #define DEBUG 4 #define TEST 8 #define STDOUT 16 short loglevel = 0xFF; void Log(short level, std::string message) { bool screenout...
////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002-2004, Thomas Reps, Gogul Balakrishnan // University of Wisconsin, Madison. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that...
#include<stdio.h> int main() { long a,b,i; long c = 1; scanf_s("%ld%ld",&a,&b); for(i=2;i<=a;i++) { if(a%i==0 && b%i==0) { if(c < i) { c = i; } } } printf("%ld",c); return 0; }