text
stringlengths
8
6.88M
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include "parametersettingwindow.h" #include "thresholdsettingwindow.h" #include "allsettingwindow.h" namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~M...
#include <iostream> #include <stdio.h> int maxEl1; int arr[10]; int array(int *arr, int N) { for(int i = 0; i < N; ++i) { std::cout << "array[" << i + 1 << "]" << ": "; std::cin >> arr[i]; } return arr[N]; } int maxim(int *arr, int N) { int maxEl; maxEl = arr[0]; for(int i = 1; i < N; ++i) { ...
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/chromeos/crostini/crostini_package_installer_service.h" #include "base/bind.h" #include "base/files/file_path.h" #include "base/...
#include <iostream> using namespace std; int main() { int t; cin >> t; for(int i=0;i<t;i++) { int n; cin>>n; int array[n]; for(int j=0;j<n;j++) { int lol; cin>>lol; array[j]=lol; } for (int j=0;j<n;j++) { if (array[j]%2==0) { cout<<1<<"\n"; cout<<j<<"\n"; break; } ...
#include "rule.h" #include <iostream> #include <conio.h> using namespace std; // check whether location x,y is attacked bool Rule::Attacked(int x, int y, bool color, Location** board) { for ( int i = BOARD_MIN; i <= BOARD_MAX; i++ ) { for ( int j = BOARD_MIN; j <= BOARD_MAX; j++ ) { if ( ( board[i][j].GetPie...
#include <map> #include <set> #include <list> #include <cmath> #include <ctime> #include <deque> #include <queue> #include <stack> #include <string> #include <bitset> #include <cstdio> #include <limits> #include <vector> #include <climits> #include <cstring> #include <cstdlib> #include <fstream> #include <numeric> #inc...
#pragma once #include "shader.h" #include "singleton.h" #include "named_vector.h" #include <array> enum class ShadersId { Sprite, Batch, Shapes, Particle, Light, Obstruct, Buffer, Generate, ShadersSize }; class ShadersImpl : public Singleton { public: NamedVector<Shader> Shaders; void Load(); void Re...
/********************************************************************** * Felix Winterstein, Imperial College London * * File: build_kdTree.cpp * * Revision 1.01 * Additional Comments: distributed under a BSD license, see LICENSE.txt * **********************************************************************/ #include <...
//--------------------------------------------------------------------------- //bluely 2003.05.26 //改良的TList类,第一次尝试使用模板类 //主要改进 支持类型 支持自动释放 /*与非模板类不同的是,必须将函数实现包括在调用它的每个源文件中, 使编译器能从函数实现产生代码。通常的做法是将模板类的函数实现 也放在定义该类的头文件中,这样只需在调用的源文件中包含该头文 件即可。*/ //修改日期2003.08.22 // 注: 此类基于VCL ,现在已经基本不用,可以采用Alist类代替 #ifndef mli...
/* \author Aaron Brown */ // Quiz on implementing kd tree #include <memory> #include "render/render.h" // Structure to represent node of kd tree struct Node { std::vector<float> point; int id; std::unique_ptr<Node> left; std::unique_ptr<Node> right; Node(std::vector<float> arr, int setId) : point(arr), id(set...
#include<iostream> #include<vector> #include<algorithm> #include<map> using namespace std; class Solution { public: vector<vector<string>> groupAnagrams(vector<string>& strs) { //基本思想:使用HashMap,HashMap记录当前排序后的元素存在res中的下标,如果不存在则新添加入res,下标cnt++ //循环遍历strs中所有元素,对每个元素str排序后temp看是否存在HashMap中 //如果不存在加入res和HashMap中,Has...
#include "Includes.h" #include <iostream> #include <vector> #include <algorithm> #include <bitset> #include <fstream> using namespace std; long long sieveSize; bitset<10000010> bs; vector<int> primes; void sieve(long long upperbound); bool isPrime(long long I); void uva543Main() { ofstream myfi...
/* Generates initial models for TPCF using real SDSS data * by Jose Fiestas (09.03.13) * */ #include <stdio.h> #include <stdlib.h> #include <math.h> #include <iostream> #include <fstream> #include <sstream> #include <string> using namespace std; #define NMAX 100000 float a[NMAX],d[NMAX],zz[NMAX],R...
// Created on: 1991-10-10 // Created by: Jean Claude VAUTHIER // Copyright (c) 1991-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 t...
// Copyright (c) 2016 peposso All Rights Reserved. // Released under the MIT license #pragma once #include <string> #include <unordered_set> #include "yaml_config.hpp" #include "utils.hpp" #define EXCEPTION XLSXCONVERTER_UTILS_EXCEPTION namespace xlsxconverter { struct Validator { const YamlConfig::Field& field...
#include "KickOutPlayerProc.h" #include "HallHandler.h" #include "Logger.h" #include "Configure.h" #include "GameServerConnect.h" #include "PlayerManager.h" #include "GameCmd.h" #include "ProcessManager.h" #include <string> using namespace std; KickOutPlayerProc::KickOutPlayerProc() { this->name = "KickOutPlayerProc"...
/************************************************************************ * @project : sloth * @class : ModelDataNM * @version : v1.0.0 * @description : 记录包含法线贴图的模型数据结构 * @author : Oscar Shen * @creat : 2017年2月21日21:34:41 * @revise : ************************************************************...
#include "framebuffer.h" #include "SimpleGL.h" FrameBuffer::FrameBuffer(int x , int y) { width = x; height = y; pixels = new GLubyte[width * height * 3]; for(int i=0;i<width*height*3;i++) pixels[i]=0; } FrameBuffer::~FrameBuffer() { if(pixels != NULL) delete[] pixels; } void FrameBuffer::setsize(i...
/** * @file src/types/meta.cpp * @brief Implementation of class Meta. * @copyright (c) 2017 Avast Software, licensed under the MIT license */ #include "yaramod/types/meta.h" namespace yaramod { /** * Returns the string representation of the meta information. * * @return String representation. */ std::string ...
#include <opencv2/opencv.hpp> #include <opencv2/tracking.hpp> #include "iostream" class CImageLoader { public: CImageLoader(std::string f_firstImageFilename_s) { m_firstImage = cv::imread(f_firstImageFilename_s, 1); } bool copyROIImagePart(); cv::Mat getROIImage(); cv::Rect2d getROI(); private: bool sho...
// // Created by archtao on 2021/6/12. // // 归并排序 - 突然看到我这函数声明我自己都傻了。。。哈哈哈, 这玩意我自己都看不懂用的啥参数 // I try to tell you, but you don't listen. #include <iostream> using std::endl; using std::cout; void Merge(int*, int, int, int); // 归并 void MergeSort(int[], int, int); ...
#ifndef __USER_H__ #define __USER_H__ #include "DLLDefines.h" #include "ISerializable.h" #include <string> class EXPORT User : public ISerializable { private: char * _message; char * _username; char * _password; public: //For position we use floats since are the smallest floating point type (in all platforms) /...
/// @file /// @brief bytecode compiler C++ code #include "compiler.hpp" #define YYERR "\n\n" << yylineno << ":" << msg << "[" << yytext << "]\t\n" void yyerror(std::string msg) { std::cout << YYERR; std::cerr << YYERR ; exit(-1); } int main() { return yyparse(); }
/* Structure of the node of Huffman tree is as struct MinHeapNode { char data; int freq; MinHeapNode *left, *right; }; */ // task is to complete this function // function should return decoded string from // the given bianry encoded string string decodeHuffmanData(struct MinHeapNode* root, string binaryString) { ...
#include "number.hpp" Number :: Number() { setValue(0); } Number :: Number(int num) { setValue(num); } Number :: Number(const Number& obj) {} Number :: ~Number() {} void Number :: operator=(int num) { setValue(num); }
/** Kabuki SDK @file /.../Source/Kabuki_SDK/_2D/Entity_f.cpp @author Cale McCollough @copyright Copyright © 2016 Cale McCollough @license Free and open-source. You can find a copy of the license that YOU MUST READ in the accompanying ./ReadMe.md, file incorporated herein by this reference,...
#include "stdafx.h" BOOST_AUTO_TEST_SUITE(SessionControllerTests) BOOST_AUTO_TEST_CASE(Run) { } BOOST_AUTO_TEST_SUITE_END()
#pragma once #include <iostream> class Cell { public: Cell(char Symbol); virtual ~Cell(); Cell(size_t Row, size_t Column, char Symbol); Cell(const Cell& other); virtual Cell* Clone() const = 0; size_t getRow() const; size_t getColumn() const; char getSymbol() const; bool getIsFree() const; void setRow(siz...
#include "bricks/cryptography/crc32.h" namespace Bricks { namespace Cryptography { CRC32::CRC32() { for (int i = 0; i < 0x100; i++) { u32 n = i; for (int k = 0; k < 8; k++) n = (n >> 1) ^ ((n & 1) ? 0xedb88320L : 0); table[i] = n; } } Data CRC32::Preprocess() { u32 value = 0xffffffffUL; retu...
#define RRS_PIN 22 #define RS_PIN 24 #define LS_PIN 26 #define LLS_PIN 28 #define e1 1 #define e2 2 #define e3 3 double RRS; double RS; double LS; double LLS; void Inizializza_sensori() { pinMode(RRS_PIN, INPUT); pinMode(RS_PIN, INPUT); pinMode(LS_PIN, INPUT); pinMode(LLS_PIN, INPUT); } void following_PID(...
// too many corner cases /* The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this character, takes an optional initial plus or minus sign followed by as many numerical digits as possible, and interprets them as a numerical valu...
#include <bits/stdc++.h> #define fastio ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0) #define rep(i, a, b) for(i=(int)a;i<(int)b;i++) #define MAX 100010 using namespace std; int main() { fastio; int n, c, k; while(cin >> n >> c >> k){ if(n == 0 && c == 0 && k == 0) break; int count[MAX] = {0}; f...
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QVBoxLayout> #include <QHBoxLayout> #include <QPushButton> #include <QListWidget> #include <QLabel> #include <QComboBox> #include <QLineEdit> #include <QMessageBox> #include <QDialog> #include <QTextEdit> #include <string> #include "reviewbox.h" #include "loginbox.h" ...
#include <iostream> using namespace std; int main() { int num,sum=0,average,i=0; cout<<"Enter the numbers \n"; cout<<">";cin>>num; while(i <= num) { sum = i + sum; i++; } cout<<"The sum of the number from 1 to "<<num<<" is "<<sum<<endl; average = sum/num; cout<<"The average of "<<num<<" is " <<a...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <quic/congestion_control/Copa.h> #include <folly/portability/GTest.h> #include <quic/common/test/TestUtils.h> #include ...
#pragma once #include <vector> #include <string> #include <set> #include <unordered_map> #include<unordered_set> #include "ServerModel.h" #include "VirtualMachineModel.h" #include "VirtualMachine.h" #include "Server.h" #include "OP.h" using namespace std; vector<vector<OP>> vAllOperation; // 所有操作序列的数据 unordered_map<...
#pragma once #include "GameNode.h" #include "Bullet.h" struct tagEnemy { RECT rc; float x, y; float width, height; float speed; float angle; float moveFrame; }; class Enemy : public GameNode { private: vector<tagEnemy> _vEnemy; vector<tagEnemy>::iterator _viEnemy; Image * _enemyImage; Bullet * _bullet; ...
#pragma once #include "Cell.h" class FatCell : public Cell { public: sf::CircleShape body; sf::CircleShape fat; float fatstored = 4.f; FatCell::FatCell() { //position = Vector2(400, 200); //radius = 50.f; body.setFillColor(sf::Color(c[0], c[1], c[2], 125)); fat.setFillColor(sf::Color(163, 124, 75)); ...
#include "SaleableItem.h" SaleableItem::SaleableItem(const char* pTitlep, unsigned int unitPricePencep) { pTitle = pTitlep; unitPricePence = unitPricePencep; } const char* SaleableItem::getTitle(void) { return pTitle; }
// Created on: 2013-09-25 // Created by: Denis BOGOLEPOV // Copyright (c) 2013-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 ...
#ifndef IIMAGEFILTER_H #define IIMAGEFILTER_H #include "QImage" #include "iimageexpander.h" class IImageFilter { public: virtual QImage *process(IImageExpander *expander, QImage *img) = 0; }; #endif // IIMAGEFILTER_H
#include <stdio.h> #define p printf main() { int domain[100],range[100],n,c,x,d=0; int z,int v,b=0; p("Input the Domain and Range\n"); p("enter 3 pairs:"); for(c=0;c<3;c++) { p("Enter Domain %d\t:\t",(1)+d++); scanf("%d",&domain[c]); p("Enter Range %d\t:\t",d); scanf("%d"...
#ifndef MQTTMESSENGER_H #define MQTTMESSENGER_H // typedef int MQTTClient_persistence; //Throws undefined otherwise if se to // PERSISTENCE_NONE. #include <mqtt/publisher/publisherwrapper.h> #include <mqtt/subscriber/subscriberwrapper.h> #include <mqtt/xorcipher.h> #ifdef linux #include <unistd.h> #endif class MqttM...
#include"IndexManager.h" using namespace std; int main() { //ifstream ini("init.txt"); BPLUSTREE bt(4096); string s1 = "int1", s2 = "int2.txt", f="int2.txt"; //bt.CreateIndex(&s1 , &s2, 1); bt.DropIndex(&f); getchar(); }
// // LeftBullet.cpp // ClientGame // // Created by liuxun on 15/3/4. // // #include "LeftBullet.h" #include "Player.h" LeftBullet::LeftBullet(Player* player) { Vector2 playerVector = MathUtil::VectorFromAngle(player->GetRotation() + 90.0f); Vector2 pos = player->GetPosition(); pos += playerVecto...
//https://www.spoj.com/problems/BUSYMAN/ //activity selection problem SPOJ #include<iostream> #include<bits/stdc++.h> #include<algorithm> using namespace std; #define ll long long bool comp(pair<ll,ll>p1,pair<ll,ll>p2) { return p1.second<p2.second; } vector<pair<ll,ll>>vec; int main() { ll t; cin>>t; while(t--) ...
#include "settingswindow.h" #include "ui_settingswindow.h" SettingsWindow::SettingsWindow(const std::weak_ptr<Settings> settings, QWidget *parent) : QWidget(parent), ui(new Ui::SettingsWindow) { this->settings = settings.lock(); ui->setupUi(this); QRegExpValidator *dateValidator = new QRegExpValida...
#include "../headers/Jueguito.h" Jueguito::Jueguito():isRunning(false){} Jueguito::~Jueguito() { /*for (int i = 0; i < drawables.size(); i++){ delete drawables[i]; }*/ delete layoutManager; } void Jueguito::init() { // initialize SDL if(SDL_Init(SDL_INIT_EVERYTHING) >= 0){ setIsRunning(true); // if succ...
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: QueueFactory.h * Author: ssridhar * * Created on October 11, 2017, 1:06 PM */ #ifndef QUEUE_FACTORY_H #...
// // Vuelo.h // TorreDeControl // // Created by Catalina Peralta on 11/1/14. // Copyright (c) 2014 Catalina Peralta. All rights reserved. // #ifndef __TorreDeControl__Vuelo__ #define __TorreDeControl__Vuelo__ #include <iostream> #include <string> #include "Hora.h" class Vuelo { private: int passengers, flig...
/**************************************************************************** * Copyright (c) 2013 GeoMind Srl. www.geomind.it * All rights reserved. * *--------------------------------------------------------------------------- * This software is part of the GeoFlyerPro PROJECT by GeoMind Srl; * it is not ...
// MFCApplication2Doc.cpp : реализация класса CMFCApplication2Doc // #include "stdafx.h" #include "MainFrm.h" // SHARED_HANDLERS можно определить в обработчиках фильтров просмотра реализации проекта ATL, эскизов // и поиска; позволяет совместно использовать код документа в данным проекте. #ifndef SHARED_HANDLER...
// // Timer.cpp // Project2 // // Created by William Meaton on 26/02/2016. // Copyright © 2016 WillMeaton.uk. All rights reserved. // #include "Timer.hpp" namespace Math{ Timer::Timer(bool startNow){ if(startNow){ this->start(); } } Timer::Timer(){ } void Ti...
// // TextBox.h // OpenGL_Timer_CPP // // Created by Ran Bao on 4/27/13. // Copyright (c) 2013 Ran Bao. All rights reserved. // #ifndef __OpenGL_Timer_CPP__TextBox__ #define __OpenGL_Timer_CPP__TextBox__ #include <iostream> #include <GL/freeglut.h> #include "GLColor.h" class NewTextBox { void *font; std::stri...
#pragma once #include <string> #include <vector> namespace HelloWorld { std::string get_hello(); std::string get_personalized_greeting(const std::string& who); std::vector<std::string> greet_each(std::vector<std::string> v); } // namespace HelloWorld
#include <chuffed/core/propagator.h> // sum x_i <= y template <int U = 0> class BoolLinearLE : public Propagator { public: vec<BoolView> x; IntView<U> y; // Persistent state Tint ones; vec<Lit> ps; BoolLinearLE(vec<BoolView>& _x, IntView<U> _y) : x(_x), y(_y), ones(0) { for (int i = 0; i < x.size(); i++) {...
// Copyright (c) 2018 Mozart Alexander Louis. All rights reserved. // Includes #include "base_manager.hxx" BaseManager::BaseManager(Layer& layer) : main_layer_(layer) {} BaseManager::~BaseManager() { // Unload all the node in the node map. first, cancel all action on the node if any for_each(node_map_.begin(), n...
#include <ionir/passes/pass.h> namespace ionir { // TODO: Finish init. implementation. AllocaInst::AllocaInst(const AllocaInstOpts &opts) : Inst(opts.parent, InstKind::Alloca), InstYield(opts.yieldId), type(opts.type) { // } void AllocaInst::accept(Pass &visitor) { ...
/* BEGIN LICENSE */ /***************************************************************************** * SKFind : the SK search engine * Copyright (C) 1995-2005 IDM <skcontact @at@ idm .dot. fr> * $Id: filterhtml.h,v 1.6.4.3 2005/02/21 14:22:46 krys Exp $ * * Authors: Marc Ariberti <ariberti @at@ idm .dot. fr> * * T...
#include "treeface/scene/SceneRenderer.h" #include "treeface/gl/Program.h" #include "treeface/gl/VertexArray.h" #include "treeface/misc/UniversalValue.h" #include "treeface/scene/Geometry.h" #include "treeface/scene/SceneGraphMaterial.h" #include "treeface/scene/SceneNode.h" #include "treeface/scene/VisualObject.h" ...
/* * 0세대 : FX * X -> X + YF * Y -> FX - Y * * n세대 드래곤 커브 문자열 구하기! * 문자열 중 p 번째 글자부터 l 글자만을 계산하는 프로그램 만들기!*/ #include <iostream> #include <string> int skip; void curve (const std::string& seed, int generations) { if (skip < 0 ) return; if (generations == 0) { if (seed.size() >= skip) std::cout << seed;...
#include "..\include\Produc.h" string Produc::getStr() { return this->str; } string Produc::getLeft() { return this->left; } string Produc::getArrow() { return this->arrow; } vector<string> Produc::getRight() { return this->right; } Produc::Produc(string str, string left, string arrow, vector<string> right) { ...
// // Copyright (C) BlockWorks Consulting Ltd - All Rights Reserved. // Unauthorized copying of this file, via any medium is strictly prohibited. // Proprietary and confidential. // Written by Steve Tickle <Steve@BlockWorks.co>, September 2014. // #include <stdio.h> #include <stdint.h> #include <stdbool.h> #include...
#include <FL/Fl.H> #include <FL/Fl_Window.H> #include <FL/Fl_Button.H> #include <FL/Fl_Box.H> #include <Fl/Fl_Text_Display.H> #include "AnimTable.hpp" #include "ImgTable.hpp" void CreateGui() { Fl_Window* window = new Fl_Window(340,80,800,600,"Spriter"); window->make_current(); //Top bar Fl_Box* white...
// Copyright (C) 2012 Hartmut Kaiser // (C) Copyright 2008-10 Anthony Williams // // 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) #include <pika/future.hpp> #include <pi...
/* * File: main.cpp * Author: jay * * Created on March 28, 2014 */ #include <cstdlib> #include <cpptest.h> #include "QJsonPath.h" #include <QJsonObject> #include <QJsonArray> #include <QJsonDocument> #include <QJsonParseError> //#include <QDebug> // <editor-fold defaultstate="collapsed" desc...
#include <assert.h> #include <iostream> #include <limits> #include <math.h> #include <stdio.h> #include "cm_rt.h" struct surfaceInfoS{ unsigned short height; unsigned short width; unsigned int fileSize; char* surfaceFormat; char* fileName; unsigned char inited; VASurfaceID surfaceID; ...
/********************************************************************************** Brows.h This file contains the class definition, attributes, and methods of the Eyebrows class. This class controls both the left and right eyebrows to make it easier for the Head class to controll the eyebrows as a whole u...
#include <Poco/Exception.h> #include <Poco/Logger.h> #include <Poco/DOM/Document.h> #include <Poco/DOM/Element.h> #include <Poco/DOM/NodeList.h> #include "di/DIXmlLoader.h" #include "util/SecureXmlParser.h" using namespace std; using namespace Poco; using namespace Poco::XML; using namespace BeeeOn; DIXmlLoader::DIX...
#include "core/pch.h" #include "OpHotlistTreeView.h" #include "modules/prefs/prefsmanager/prefsmanager.h" #include "adjunct/quick/dialogs/SimpleDialog.h" #include "adjunct/quick/widgets/OpBookmarkView.h" #include "adjunct/quick/hotlist/HotlistManager.h" #include "modules/widgets/WidgetContainer.h" OpHotlistTreeView::O...
#include <iostream> #include <vector> #include <string> #include <limits> using namespace std; #define ROWS 6 #define COLS 7 #define TURNS 21 // Game class tracks all data for the ongoing game class Game { public: // Two-dimensional vector for the board vector<vector<char>> board; char winner; int P1...
#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 <stdio.h> #include <string.h> #include <time.h> #define INF (1<<28) using name...
#pragma once class Person { private: int strain; bool infected; // Latent bool infectious; //disease int timesInfected; public: Person(); ~Person(); void update(float transmission); void update(int strainNum, float transmission); void update(float* transmission ); //better oo void setInfectious(bool state)...
#ifndef _MISSION_H_ #define _MISSION_H_ class Mission { public: enum MissionType { CHANGE_ZONE, OPEN_DOOR, }; private: MissionType m_mType; unsigned int m_id; //attribué par MissionManager lors de l'assignation unsigned m_objective; bool m_status = false; public: Missi...
#include "TestRendererCpp.h" #include <iberbar/Utility/Platform/Android/JniHelper.h> #include <iberbar/GameEngine/BaseResourceManager.h> #define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "TestRendererCpp", __VA_ARGS__)) #define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, "TestRendererCpp", ...
#include "H/KBscancodes.h" bool ShiftPressed = false; uint_8 LastScancode; char KEY; void StandardKeyboardHandler(uint8 scancodes, uint8 chr){ if (chr != 0){ switch (ShiftPressed) { case true: switch (scancodes){ case 0x32: KEY = '?'; ...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<algorithm> #include<cmath> using namespace std; bool vis[2020]; int f[2020]; vector<int> edge[2020]; void dfs(int x,int k) { for (int i = 0;i < ed...
/*********************************************************\ * Copyright (c) 2012-2018 The Unrimp Team * * 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 wit...
#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...
//------------------------------------------------------------------------------ /* This file is part of Beast: https://github.com/vinniefalco/Beast Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com> Portions of this file are from JUCE. Copyright (c) 2013 - Raw Material Software Ltd. Please visi...
#ifndef COMPRESSORADAPTER_H #define COMPRESSORADAPTER_H #include <QObject> #include <QTcpSocket> #include "adapterbase.h" /// Набор глобальных перечислителей class CompressorAdapterData { Q_GADGET public: enum CompressorState{ ENSTATE_IDLE, ENSTATE_STARTING, ENSTATE_COMPRESSING, ...
#ifndef HELPPAGE_H #define HELPPAGE_H #include <SFML\Graphics.hpp> /// <summary> /// @author Peter Lowe /// @version 1.0 /// @date may 2016 /// /// \brief simple page to display help text. /// /// </summary> class HelpPage { public: HelpPage(); ~HelpPage(); protected: }; #endif // !HELPPAGE_H
#ifndef TREEFACE_TEXTURE_MANAGER_H #define TREEFACE_TEXTURE_MANAGER_H #include <treecore/Identifier.h> #include <treecore/RefCountObject.h> #include <treecore/RefCountSingleton.h> namespace treecore { class var; } // namespace treecore namespace treeface { class Texture; class TextureManager: public treecore::RefC...
#include<iostream> using std::cout; using std::cin; using std::endl; int main(){ int age; cout<<"Enter your age"<<endl; cin>>age; cout<<"Hi! you are "<<age<<" years old"<<endl; return 0; }
/* * rsaencryption.h * * Created on: Nov 22, 2013 * Author: Maxx Boehme */ #ifndef RSAENCRYPTION_H_ #define RSAENCRYPTION_H_ int encryption(std::string, std::string, std::string); int decryption(std::string, std::string, std::string); int key(unsigned long long , unsigned long long , unsigned long long *)...
#include "material.h" using namespace glm; Material::Material(vec4 _phong, vec3 _color) : color(_color) { kA = _phong.x; kD = _phong.y; kS = _phong.z; rough = _phong.w; } Material::Material(float _kA, float _kD, float _kS, float _rough, float _r, float _g, float _b) : kA(_kA), kD(_kD), ...
#include <cppunit/extensions/HelperMacros.h> #include <Poco/Exception.h> #include "cppunit/BetterAssert.h" #include "loop/StopControl.h" using namespace std; using namespace Poco; namespace BeeeOn { class StopControlTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(StopControlTest); CPPUNIT_TEST(testShould...
#include <stdio.h> #include <fstream> #include <math.h> #include <iomanip> using namespace std; int returnMax(int arr[][3]){ // Returns a 2 digit integer :- [row + 1][coumn] int rowColumn; int max; max = arr[0][0]; rowColumn = 10; for (int i = 0; i<3; i++){ for (int j = 0; j < 3; j++){...
#include <string> #include <gtest/gtest.h> #include "ComponentsInfrastructure.h" namespace PticaGovorunTests { using namespace PticaGovorun; struct GrowOnlyPinArenaTest : public testing::Test { }; TEST_F(GrowOnlyPinArenaTest, GrowOnlyPinArena1) { GrowOnlyPinArena<wchar_t> arena(5); std::wstring w1 = L"to";...
#include "stdafx.h" #include "IconMon.h" #include "../GameCursor.h" IconMon::~IconMon() { DeleteGO(m_frame); DeleteGO(m_mon); } bool IconMon::Start() { //m_frame->SetPivot({ 0,1 }); return true; } void IconMon::init(const wchar_t * path, GameCursor* cursor) { m_cursor = cursor; m_mon = NewGO<SpriteRender>(5, "...
#include "InOutMenuWidget.h" #include <qlayout.h> #include "MenuButton.h" #include <stack> InOutMenuWidget::InOutMenuWidget() { QStackedWidget* stack = new QStackedWidget; this->setMaximumHeight(80); this->setMinimumWidth(100); this->setStyleSheet("border: 1px solid black"); QHBoxLayout* hlayout = new QHBoxLay...
#include "NetworkSystem.h" #define _WIN32_WINNT 0x0600 #include <WinSock2.h> #include <iphlpapi.h> #include <WS2tcpip.h> #pragma comment(lib, "ws2_32.lib") #pragma comment(lib, "iphlpapi.lib") #include <stdio.h> #include <stdlib.h> bool net_init() { WSADATA d; if (WSAStartup(MAKEWORD(2, 2), &d)) { fprintf(std...
#pragma once /* 프렌드 선언 : 다른 클래스나 함수에서 이 클래스의 private 멤버에 접근을 허용한다. A클래스에서 B 클래스의 멤버에 접근하려면 class B 에서 class A를 친구로 선언 A클래스는 B클래스를 친구로 선언 하고 B클래스는 C 클래스를 친구로 선언 class yangachi{ friend class Babo; private : int money; public : void func(const Babo & babo){ money += babo.money; babo.money = 0; }...
/***************************************************************************************************************** * File Name : TheatreSquare.h * File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\sites\codeforces\TheatreSquare.h * Created on : Jan 24, 2014 :: 10:16:04 AM * Author : AVINA...
#ifndef GAME_HPP #define GAME_HPP #include <iostream> // std::cout #include <string> // std::string #include <vector> // vector #include "Team.hpp" class Game { protected : // CHAMPS ======================================================= // std::vector<Team*> teams; std::vector<Player*> players; ...
// https://oj.leetcode.com/problems/find-minimum-in-rotated-sorted-array/ // simpler solution class Solution { public: int findMin(vector<int> &num) { int size = num.size(); if (size == 0) { return 0; } int start = 0, end = size - 1; if (num[start] <= nu...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2011 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 "adjunct/quick/sync/view/SyncPass...
/* Test the ByteBuffer type. -*- Mode: C++; tab-width: 4; -*- */ group "util.adt.bytebuffer"; language c++; include "modules/util/adt/bytebuffer.h"; global { ByteBuffer *b; } setup { b = OP_NEW_L(ByteBuffer, ()); } exit { OP_DELETE(b); } test("Appending and extracting single bytes") { int i, errors; b->F...
#ifndef SIMPLEFACTORY_H #define SIMPLEFACTORY_H #include <iostream> //产品类 enum PRODUCTTYPE {A, B}; class Product { public: virtual void show() = 0; }; class ProductA : public Product { public: void show() { std::cout << "Product_A" << std::endl; } }; class ProductB : public Product { public...
// Created on: 1998-06-03 // Created by: data exchange team // Copyright (c) 1998-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...