text
stringlengths
8
6.88M
#include "Actor.h" #include "StudentWorld.h" // Students: Add code to this file (if you wish), Actor.h, StudentWorld.h, and StudentWorld.cpp /**************************** Actor Implementation *****************************/ Actor:: Actor(int imageID, int startX, int startY,StudentWorld* world, Direction dir, double si...
/* Copyright 2017 Istio 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 required by applicab...
# include <stdio.h> # define WEIGHT_A 3.5 # define WEIGHT_B 7.5 int main() { double A, B, avg; scanf("%lf", &A); scanf("%lf", &B); avg = (A * WEIGHT_A + B * WEIGHT_B) / (WEIGHT_A + WEIGHT_B); printf("MEDIA = %.5lf\n", avg); return 0; }
//========================================================================== // LOGBUFFER.H - part of // // OMNeT++/OMNEST // Discrete System Simulation in C++ // //========================================================================== /*---------------------------------------------...
// This file has been generated by Py++. #ifndef WindowFactoryManager_hpp__pyplusplus_wrapper #define WindowFactoryManager_hpp__pyplusplus_wrapper void register_WindowFactoryManager_class(); #endif//WindowFactoryManager_hpp__pyplusplus_wrapper
#include "sensor.h" using namespace std; void interrupt() { cout<< "l'interruption a eu lieu\n"; } PI_THREAD (myThread) { while (1) { wiringPiISR(3, INT_EDGE_RISING, interrupt); waitForInterrupt(3, -1); cout <<"allumé\n"; wiringPiISR(3, INT_EDGE_FALLING, interrupt); waitForInterrupt(3, -1); cout...
#include <string> #include "Bank.hpp" /************************************************ ** Member function definitions ************************************************/ // PLEASE ADD IMPLEMENTATIONS OF ALL FUNCTION MEMBERS OF CLASS BANK Bank::Bank( const std::string & name, const double & starting, co...
/** * Utility for converting a binary on/off image to * a signed distance field image. */ #ifndef FISHY_DISTANCE_FIELD_H #define FISHY_DISTANCE_FIELD_H #include <CORE/types.h> #include <vector> /** * Conversion utility for computing the signed distance field * representation of an input black and white image. ...
/* * Wrapper class for eureqa::server_info * * Created on: Nov 21, 2010 * Author: MF */ #ifndef SERVERINFO_H_ #define SERVERINFO_H_ #include <eureqa/server_info.h> class ServerInfo { private: eureqa::server_info instance; public: // Wrapper for default constructor ServerInfo() {} // Cons...
#include "mainwindow.h" #include "ui_mainwindow.h" #include "basicheaders.h" void MainWindow::setUpUI() { qDebug() << "UI set up started" << endl; // creates actual widget instances // from QtDesigner ui->setupUi(this); // working zone - main widget QWidget *canvas = new QWidget; QVBoxLay...
#include "invalidageofcarexception.h" InvalidAgeOfCarException::InvalidAgeOfCarException(string message) { this->message = message; } string InvalidAgeOfCarException::getMessage() { return this->message; }
#ifndef __TEST_FIXED_FLOAT_H__ #define __TEST_FIXED_FLOAT_H__ #include <iostream> #include <cstdlib> #include "physics.h" using namespace std; using namespace physics; class TestFixedFloat { public: static void doTest(); static void doTestSpeed(); }; #endif
// // Created by wojtekreg on 15.01.18. // #ifndef PYRAPORTFEL_KONTRAKT_H #define PYRAPORTFEL_KONTRAKT_H #include "Aktywa.h" class Kontrakt : public Aktywa{ private: int czasTrwania; void setCzasTrwania(int czasTrwania); public: Kontrakt(std::string opis, double wartosc, int czasTrwania); virtual vo...
#pragma once #include <map> #include <vector> #include "UpdateOperation.h" class DSM { public: DSM(int world_size, int process_id, std::map<char, int> variables); ~DSM(); bool available = true; void assignUpdate(char variable, int value); void updateVariable(char variable, int value); void setValue(char variab...
#include<stdio.h>//**打印函数的头文件** #include<stdlib.h> #include<time.h>//**电脑生成随机数的time函数头文件** #define ROW 3//**此处用define定义3行3列的棋盘** #define COL 3 void game(); void menu(); void InitBoard(char Board[ROW][COL],int row,int col);//**定义棋盘的函数声明** void DisplayBoard(char Board[ROW][COL],int row,int col);//**打印棋盘的函数的声明*...
#pragma once #include "FRAlgorithm.h" #include <opencv2\nonfree\features2d.hpp> #include <opencv2/nonfree/gpu.hpp> using namespace gpu; class FRSurfGpu : public FRAlgorithm{ private: int m_minHessian; SurfFeatureDetector m_detector; SurfDescriptorExtractor m_extractor; SURF_GPU surf; public: FRSurfGpu(void); F...
#ifndef CELLO_SEQUENCE_MANAGER #define CELLO_SEQUENCE_MANAGER #include <vector> #include <util/ActionSequence.h> using std::vector; namespace cello { class SequenceManager { public: ~SequenceManager() { for (ActionSequence* sequence : _sequences) { delete sequence; } for (ActionSequence* sequence : _se...
// // Created by wqy on 19-11-17. // #ifndef VERIFIER_BEAGLETRANSLATOR_H #define VERIFIER_BEAGLETRANSLATOR_H #include "Translator.h" #include "../BeagleModel/BeagleModel.h" #include <stdio.h> #include <string> #include <vector> using std::string; using std::vector; namespace esc { class BeagleTranslator : public...
#include <bits/stdc++.h> using namespace std; const int MAX_INT = std::numeric_limits<int>::max(); const int MIN_INT = std::numeric_limits<int>::min(); const int INF = 1000000000; const int NEG_INF = -1000000000; #define max(a,b)(a>b?a:b) #define min(a,b)(a<b?a:b) #define MEM(arr,val)memset(arr,val, sizeof arr) #defi...
#include <Arduino.h> #include <ESPEssentials.h> #include "Animation.h" #include "Config.h" #include "Fade.h" #include "Hardware.h" #include "WebSocket.h" #include "Webserver.h" // Include animations here: #include "Animations/rainbow.h" #include "Animations/color.h" #include "Animations/colorBlend.h" #include "Animat...
#include<iostream> using namespace std; class Node{ public : int data,key; Node *next; Node(){ data=0; key=0; next=NULL; } Node(int k, int d){ key=k; data=d; next=NULL; } }; class C...
#include "head.h" //具体类 class BinarySplitter : public ISplitter { void split() override { } }; class TxtSplitter : public ISplitter { void split() override { } }; class PictureSplitter : public ISplitter { void split() override { } }; class VideoSplitter : public ISplitter { void split() override { } };...
#pragma once #include <rpc/msgpack.hpp> #include <string> #include <vector> struct ObjectState { std::string objectName; float x, y, z; float qw, qx, qy, qz; ObjectState() {} ObjectState(std::string objectName, float x, float y, float z, float qw, float qx, float qy, float qz) :objectNam...
#include "Game.h" #include <iostream> #include <Windows.h> Game::Game( ) { m_currentScore = 0; m_currentGameState = GameStates::mainMenu; m_scoreFilename = "HighScore.txt"; m_highScoreFile.open( m_scoreFilename ); m_highScoreFile >> m_highScore; m_highScoreFile.close( ); } void Game::renderGameOver( ) { //Cle...
#include<bits/stdc++.h> using namespace std; int findparent(int* parent,int n,int index) { if(parent[index]==index) { return index; } return findparent(parent,n,parent[index]); } int solve(int* arr,int n) { int large = 0; // using union find algorithm for(int i=0;i<n;i++) { ...
/* * Copyright (C) 2014-2016 Open Source Robotics Foundation * * 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...
class IProgess { public: virtual void DoProgress(float value) = 0; ~IProgess(); }; class FileSplitter { public: FileSplitter(const string& filePath,int fileNumber,IProgess* m_iprogress):m_filePath(filePath),m_fileNumber(fileNumber),m_iprogessBar(iprogress) { } ~FileSplitter(); void split(...
//  Created by Frank M. Carrano and Timothy M. Henry. //  Copyright (c) 2017 Pearson Education, Hoboken, New Jersey. /** ADT stack: Link-based implementation. Listing 7-3. @file LinkedStack.h */ #ifndef LINKED_STACK_ #define LINKED_STACK_ #include "StackInterface.h" #include "Node.h" template<class ItemTyp...
#pragma once #ifdef _WIN32 #include <afxmt.h> typedef CCriticalSection CRIT_SECTION; #else #include <pthread.h> typedef pthread_mutex_t CRIT_SECTION; #endif // _WIN32 class CCSGuardian { CRIT_SECTION &m_CS; public: CCSGuardian(CRIT_SECTION &CS); ~CCSGuardian(void); };
/*************************************************************************** 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 <iostream> #include <string> #include <vector> using namespace std; //solution to the bit++ codeforces problem //http://codeforces.com/contest/282/problem/A int get_value(vector<string> operations, int n){ int x = 0; for (int i = 0; i < n; i++){ if ( (operations.at(i).at(1)) == '+' ) x += 1; else x -=...
#pragma once namespace logger { void init_logger(); void close_logger(); void write_entry(size_t hash, std::wstring text); }
// // Created by zlc on 2021/6/24. // #ifndef _MY_SLAM_GMAPPING_LIDAR_UNDISTORTION_H_ #define _MY_SLAM_GMAPPING_LIDAR_UNDISTORTION_H_ #include "ros/ros.h" #include "sensor_msgs/LaserScan.h" #include "std_msgs/Float64.h" #include "nav_msgs/GetMap.h" #include "tf/transform_listener.h" #include "tf/transform_broadcaste...
//OtherNoteApp.cpp #include "OtherNoteApp.h" #include "OtherNoteForm.h" #include "Note.h" #include "PageForm.h" #include "resource1.h" //#include <crtdbg.h>//메모리 릭 체크 BOOL OtherNoteApp::InitInstance() { OtherNoteForm *otherNoteForm = new OtherNoteForm(new Note); otherNoteForm->Create("otherNote", "제목없음 - OtherNote" ...
#include "OMJunctionGenerator.h" #include <Const.h> #include <Utils/GeneralizedCylinder.h> /* void OMJunctionGenerator::SampleSegmentBoundary(const TreeHypergraph::Branch &branch,float t,unsigned int sample_id_begin,VertexData destination[]) { GeneralizedCylinder BranchCylinder(*branch.Curve,branch.Up,branch.Width);...
#include "WorkerThreadPool.h" WorkerThreadPool::WorkerThreadPool (size_t low_mark, size_t high_mark) : ACE_Task_Base () , task_mutex_ () , task_condition_ (task_mutex_) , handler_ () , queue_ (low_mark, high_mark) , state_ (ST_INIT) , num_threads_ ...
#include "rectangle.h" Rectangle::Rectangle(int length, int width) { this->length = length; this->width = width; area = length * width; placed = false; } int Rectangle::getLength() { return length; } int Rectangle::getWidth() { return width; } int Rectangle::getArea() { return area; } v...
//想要sort()按照从大到小排列,则需要加入第三个参数cmp //处理double型数据 #include<stdio.h> #include<algorithm> using namespace std; bool cmp(double a,double b) { return a>b;//按照从大到小排列,注意与priority_queue的写法是相反的 } int main(){ double a[]={2.66,5.88,-89.1,-55.25,67}; for(int i=0;i<5;i++) printf("%f ",a[i]); printf("\n"); sort(a,a+5);//不加...
#include "ros/ros.h" #include "std_msgs/String.h" #include "math.h" #include <algorithm> // std::sort //Librerias propias usadas #include "constantes.hpp" #include "camina4/v_repConst.h" // Used data structures: #include "camina4/InfoMapa.h" #include "camina4/CinversaParametros.h" #include "camina4/UbicacionRobot.h"...
#pragma once #include <vector> #include "Edge.h" class GameStatus { public: int stage, score, cont_stage; int ini_score; bool isPlay; int max_Edges; std::vector<Edge*> edges; GameStatus(); };
#include<bits/stdc++.h> using namespace std; stack<bool> sta; char ch; int main() { scanf("%c", &ch); if (ch == ')') { printf("NO\n"); return 0; } while (ch != '@') { if (ch == '(') sta.push(true); if (ch == ')') { if (sta.empty()) { printf("NO\n"); return 0; } sta.pop(); } s...
#include <bits/stdc++.h> using namespace std; const int MAX_INT = std::numeric_limits<int>::max(); const int MIN_INT = std::numeric_limits<int>::min(); const int INF = 1000000000; const int NEG_INF = -1000000000; #define max(a,b)(a>b?a:b) #define min(a,b)(a<b?a:b) #define MEM(arr,val)memset(arr,val, sizeof arr) #defi...
#ifndef KEYWORD_SUGGESTION_SERVER_INCLUDE_ONLINE_THREAD_H_ #define KEYWORD_SUGGESTION_SERVER_INCLUDE_ONLINE_THREAD_H_ #include <pthread.h> #include <functional> #include <string> #include "noncopyable.h" namespace keyword_suggestion { namespace current_thread { extern __thread const char *name; } class Thread :...
/* * F1FrameGrabManager.cpp * * Created on: Dec 4, 2018 * Author: ttw2xk */ #include "f1_datalogger/image_logging/f1_framegrab_manager.h" #include "f1_datalogger/image_logging/utils/opencv_utils.h" //#include "image_logging/utils/screencapture_lite_utils.h" #include <algorithm> #include <iostream> namespace...
/*! * \file KaiXinApp_StatusFaceList.cpp * \author GoZone * \date * \brief 解析与UI: 获取用户状态列表 * * \ref CopyRight * =======================================================================<br> * Copyright ? 2010-2012 GOZONE <br> * All Rights Reserved.<br> * The file is generated by Kaixin_Comp...
#include "buff.h" Buff::Buff() { } Buff::Buff(BattleController* battleController, uint8 idBuff, uint8 owner, uint8 carrier) { _params.battleController = battleController; _params.owner = owner; _params.carrier = carrier; init(idBuff); } Buff::~Buff() { } bool Buff::isActive() const { return _pa...
/*********************************************************************** created: Tue Mar 7 2006 author: Paul D Turner <paul@cegui.org.uk> *************************************************************************/ /*************************************************************************** * Copyright...
/******************************************************************************* * include/generators/barabassi/barabassi.h * * Copyright (C) 2016-2017 Christian Schulz <christian.schulz@ira.uka.de> * * All rights reserved. Published under the BSD-2 license in the LICENSE file. ***********************************...
#include <windows.h> #include <iomanip> #include <iostream> void main() { setlocale(LC_CTYPE, "Russian"); using namespace std; char c, probel; probel = ' '; long long x = 1, y = 20; cout << "Введите символ "; cin >> c; cout << setw(y) << setfill(probel) << probel; cout << setw(x) << setfill(c) << c << endl; c...
#include "BitSet.h" #include <iostream> BitSet::BitSet() { this->bitSetSize = 0; } BitSet::BitSet(int initialSize) { this->bitSetSize = 0; this->array.push_back(0); for (int i = 0; i < initialSize; i++) this->push_back(false); } unsigned int BitSet::getBlock(unsigned int x) const { return x >> BITSET_SIZE_LOG; }...
#ifndef LIBNDGPP_TYPE_TRAITS_CHAR_NUMERIC_TYPE_HPP #define LIBNDGPP_TYPE_TRAITS_CHAR_NUMERIC_TYPE_HPP namespace ndgpp { /// Type trait class that returns a numeric type suitable for a char template <class T> struct char_numeric_type; template <> struct char_numeric_type<signed char> { ...
#include <QGuiApplication> #include <QQmlApplicationEngine> #include <QQmlContext> #include "beventure.h" int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQmlApplicationEngine engine; Beventure beventure (NULL, &engine); // Initialize engine.load(QUrl(QStringLiteral("qrc:///Main...
/* NO WARRANTY * * BECAUSE THE PROGRAM IS IN THE PUBLIC DOMAIN, THERE IS NO * WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE * LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE AUTHORS * AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT * WARRANTY OF ANY KIND, EITHER E...
#pragma once #include <frc/WPILib.h> class OI { public: OI(); frc::Joystick& GetJoystick(); frc::Joystick m_joystick{0}; frc::JoystickButton m_button1{&m_joystick, 1}; frc::JoystickButton m_button2{&m_joystick, 2}; frc::JoystickButton m_button3{&m_joystick, 3}; frc::JoystickButton m_button4{&m_joysti...
//************************************************************************** //** //** See jlquake.txt for copyright info. //** //** 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 ...
#ifndef ELECTRICCELL_H #define ELECTRICCELL_H #include <cmath> #include <vector> #include <fstream> #include <ctime> using namespace std; #include "particle.h" #include "toner_particle.h" #include "wall.h" /*//////////////////////////////////////////////////// ElectricCell構造体 粒子占有領域判定及び電界計算用メッシュ...
#include <vector> #include <fstream> #include <cstdint> #include <iostream> #define DATA_FILE_IO_GOOD 1 #define DATA_FILE_IO_BAD 0 namespace DataFileIO { /* Loads the bytes that were stored using DataFileIO::Save and returns it in Returns a pointer that you MUST call delete to Takes a reference...
#include<stdio.h> int pratition(int a[],int i,int j) { int pivot, temp, k; k = i + 1; int pivot1 = a[i]; while (k <= j) { while (a[k] <= pivot1) k++; while (a[j] > pivot1) j--; if (k < j) { temp = a[k]; a[k] = a[j]; a[j] = temp; } } temp = a[j]; a[j] =a[i] ; a[i] = temp; return j; } ...
#pragma once #include <iostream> #include <vector> using namespace std; #define vertexRadius 4.f #define TriangleSize 12.0f /******************************************************************** Struct: point Description: each point contains x, y coordinate *********************************************************...
#include "GameObject.h" GameObject::GameObject( const GameObject& ref ) : mPosition( ref.mPosition ), mRotation( ref.mRotation ), mpMesh( ref.mpMesh ), mpTexture( ref.mpTexture ) { } GameObject::GameObject() : mPosition( 0.0f ), mRotation( 0.0f, 0.0f, 0.0f, 0.0f ), mpMesh( nullptr ), mpTexture...
/* utils.h -*- C++ -*- Rémi Attab (remi.attab@gmail.com), 14 Apr 2015 FreeBSD-style copyright and disclaimer apply */ #pragma once namespace reflect { namespace json { /******************************************************************************/ /* BIT OPS ...
//tcp_cli_test.cpp #include "connector_co.h" #include <iostream> using namespace arsee::net; using namespace std; struct CoTask{ struct promise_type { CoTask get_return_object() { return {}; } std::suspend_never initial_suspend() { return {}; } std::suspend_never final_suspend() noexcept { return {}; }...
#include "Mixovnik.hpp" Mixovnik::Mixovnik() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) {} void Mixovnik::step() { float SUM_L = 0.0; float SUM_R = 0.0; float SUM_AUX1_L = 0.0; float SUM_AUX1_R = 0.0; float SUM_AUX2_L = 0.0; float SUM_AUX2_R = 0.0; float cvVolumeRatio[16]; //First Solo te...
#include <exception> #include "Amount.h" bool Amount::in_domain(Integral num) { return num != infinite_value; } void Amount::assert_in_domain(Integral num) { if (!in_domain(num)) throw std::domain_error("amount " + std::to_string(num) + " not within domain"); } void Amount::assure_addable(Integral a, Integral ...
#include <iostream> using namespace std; class User { private: int m_us_ID; string m_full_name; string m_email; string m_username; string m_password; string m_picture; // Constructors public: User(string full_name, string email, string username, string password, string picture); User(const User& us ); ~Us...
#include <glad/glad.h> #include <GLFW/glfw3.h> #include <iostream> #include <ShaderProgram.hpp> #include <Shader.hpp> #include <glm/gtc/type_ptr.hpp> ShaderProgram::ShaderProgram() : id(glCreateProgram()) { } ShaderProgram::ShaderProgram(const std::vector<Shader> &s) : id(glCreateProgram()) { for(auto i=s...
#include<bits/stdc++.h> using namespace std; struct node { int data; struct node* left = NULL; struct node* right = NULL; }; typedef struct node Node; Node* create_node(int value) { Node* temp = new Node(); temp->data = value; temp->left = NULL; temp->right = NULL; return temp; } void leaf_nodes(Node* root) ...
#include "player.h" void Player::createVariables() { this ->animationStates = PLAYER_ANIMATION_STATES::IDLE; } void Player::createTexture() { if(!this->textureSheet.loadFromFile("Images/postac_animacje_prawo.png")) { std::cout<<"Halo prosze wczytac gracza!"<< std::endl; } } void Player::cre...
#include "registration.h" #include "ui_registration.h" #include "QMessageBox" #include "mainwindow.h" #include "total_main.h" registration::registration(QWidget *parent) : QDialog(parent), ui(new Ui::registration) { ui->setupUi(this); socket = new QTcpSocket(this); connect(socket,SIGNAL(read...
/** * **** Code generated by the RIDL Compiler **** * RIDL has been developed by: * Remedy IT * Westervoort, GLD * The Netherlands * http://www.remedy.nl */ #ifndef __RIDL_TESTC_H_BEJIHBBJ_INCLUDED__ #define __RIDL_TESTC_H_BEJIHBBJ_INCLUDED__ #pragma once #include /**/ "ace/pre.h"...
/** * File name: ffsnetd.cpp * Desc: daemon process for FusionFS network transfer * Author: dzhao8@hawk.iit.edu * Known issues: the default port number is 9000; and is not changable * * Update history: * - 01/15/2013: add parent directory if necessary for upload mode. * - 07/18/2012: add mkdir(), this is not...
#include "SDL2DemoFramework.h" #include <DemoUtils/DemoTexture.h> #include <Demo/DemoCollection.h> #include <Demo/Demo3D/DeterministicTree.h> #include "Camera3D.h" int main(int argc,char *argv[]) { unsigned int TreeResX = 6; unsigned int TreeResY = 6; SDL2DemoFramework DemoFramework(800,600,nullptr,new Camer...
#include <iostream> #include <stdio.h> #include <vector> #include <algorithm> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int k; cin >> k; vector<int> v; // stact vector<int> output; for(int i=0; i<k; i++) { string str; int ...
#ifndef DiceInterface_h #define DiceInterface_h #include "Config.h" class DiceInterface { public: virtual void showDigit(int digit) = 0; }; DiceInterface* createDice(int kind); class traditional: public DiceInterface { public: void showDigit(int digit); private: void printDigit(int pins[], int si...
#include <iostream> int operate (int a, int b) { return a*b; } float operate (float a, float b) { return a/b; } int main() { int x=5, y=2; float n=5.0, m=2.0; std::cout << "Function 1: >" << operate (x,y) << "\n"; std::cout << "\n"; std::cout << "Function 2: >" << operate (n,m) << "\n"; std::cin.get(); ...
#pragma once class ASystemInfo { public: ASystemInfo(); ~ASystemInfo(); int NumberOfProcessors; };
#ifndef _neuron_ #define _neuron_ #include <stdio.h> #include <stdlib.h> #include <iostream> #include <string> #include "windows.h" #include <vector> using namespace std; static class neuron { public: int tips, memb; string name; int mas;//вес нейрона vector <int> memTips; vector <int> memMemb;/...
// -*- 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 pokes[1000100]; int desaf[1000100]; int main(){ int n; scanf("%d", &n); for(int i=0;i<n;i++){ scanf("%d", &desaf[i]); } int m; scanf("%d", &m); for(int i=0;i<m;i++){ scanf("%d", &pokes[i]); } sort(desaf, desaf+n); sort(pokes, pokes+m); int i=0, j=...
/*************************************************************************** qcanvas.h - description ------------------- begin : Tue Jul 23 2002 copyright : (C) 2002 by Marco Bubke email : marco@bubke.de *****...
#pragma once #include "data/cursor.h" namespace data { struct cursor_iterator: std::iterator<std::random_access_iterator_tag, double> { double get_value() const { data::pcursor_t cursor(master_->clone(index)); if (cursor->is_valid()) { return cursor->get_time(); } ...
/***************************************************************** * Filename: food.h * * Author: Patrick Cook * Start Date: 9-23-2020 * * Description: Interface for Food class. * *****************************************************************/ #ifndef FOOD_H #define FOOD_H #include <QImage> #include <QGraph...
#include "HeroPuppeteer.h" #include <SFML/Graphics.hpp> constexpr unsigned WINDOW_WIDHT = 800; constexpr unsigned WINDOW_HEIGHT = 600; // Функция создаёт окно определённого размера с определённым заголовком. void createWindow(sf::RenderWindow& window) { sf::VideoMode videoMode(WINDOW_WIDHT, WINDOW_HEIGHT); co...
//C++ program showing inheritance #include<iostream> using namespace std; #include<conio.h> class Person { private: int personid,age; string name; public: void read1() { cout<<"Enter the name,id and age of the person"; getline(cin,name); cin>>personid; cin>>age; } void pri...
/**************************************************************************** ** Meta object code from reading C++ file 'mainwindow.h' ** ** Created by: The Qt Meta Object Compiler version 67 (Qt 5.10.0) ** ** WARNING! All changes made in this file will be lost! *********************************************************...
/* * stopwatch.hpp * * Created on: Jul 12, 2020 12:07 * Description: * * Source: * [1] https://github.com/sailormoon/stopwatch * [2] https://github.com/rxdu/stopwatch * * Copyright (c) 2019 sailormoon <http://unlicense.org> * Copyright (c) 2020 Weston Robot Pte. Ltd. * * License: <http://unlicense.org> */...
#ifndef _HS_SFM_BUNDLE_ADJUSTMENT_BA_GCP_CONSTRAINED_ANALYTICAL_JACOBIAN_MATRIX_CALCULATOR_HPP_ #define _HS_SFM_BUNDLE_ADJUSTMENT_BA_GCP_CONSTRAINED_ANALYTICAL_JACOBIAN_MATRIX_CALCULATOR_HPP_ #include "hs_sfm/bundle_adjustment/ba_naive_analytical_jacobian_matrix_calculator.hpp" #include "hs_sfm/bundle_adjustment/...
#pragma once class GameTimer { public: GameTimer(); //~GameTimer(void); float TotalTime() const; float DeltaTime() const; void Reset(); void Start(); void Stop(); void Tick(); private: double mSecondsPerCount;//每秒计时次数 double mDeltaTime; __int64 mBaseTime;//各个编译器对int4支持不一样,__int64是win支持的64longlong类型 __int6...
//cpp #include "tic_tac_toe_manager.h" TicTacToeManager::TicTacToeManager(TicTacToeData& d) { games = d.get_games(); for (int i = 0; i < games.size(); i++) { update_winner_count(games.at(i)->get_winner()); } } void TicTacToeManager::save_game(std::unique_ptr<TicTacToe> &game) { update_winner_count(game->get_...
/** * @file motor.cpp * @date 2019/04/20 22:38 * * @author <a href="mailto:shuke.wang@memblaze.com">shuke.wang@memblaze.com</a> * * @brief motor * @note */ #include "motor.h" CondomMotor condomMotor; void CondomMotor::init(void) { } void CondomMotor::deinit(void) { } void CondomMotor::pushOut(PathType_e pathType)...
// This file has been generated by Py++. #ifndef KeyFrame_hpp__pyplusplus_wrapper #define KeyFrame_hpp__pyplusplus_wrapper void register_KeyFrame_class(); #endif//KeyFrame_hpp__pyplusplus_wrapper
#include<bits/stdc++.h> using namespace std; int n, m; string s[550]; bool existe(int i, int j){ return (i>=0) && (j>= 0) && (i < n) && (j < m) && (s[i][j] == '*'); } int main(){ std::ios_base::sync_with_stdio(false); cin.tie(); cout.tie(); long long marcadas = 0; cin >> n >> m; for(int i = 0; i < n...
/** * * @file ModelBase.cpp * @author Naoki Takahashi * **/ #include "ModelBase.hpp" namespace Kinematics { namespace Model { ModelBase::ModelBase(const std::string &new_model_file_name) { model_file_name = new_model_file_name; access_model_mutex = std::make_unique<std::mutex>(); } ModelBase:...
#include "CRPGServer.h" #pragma comment (lib , "ws2_32.lib") #pragma comment (lib , "winmm.lib") int main() { CRPGServer* zoneServer = new CRPGServer(); if (!zoneServer->Init(".\\ServerInfo.ini")) return -1; zoneServer->Run(); zoneServer->Cleanup(); SAFE_DELETE(zoneServer); system("pause"); return 0; }
class Solution { public: int maxProfit(vector<int>& prices) { if(prices.empty() || prices.size() == 1) return 0; int smallest = prices[0]; int profit = 0; for(int i = 1; i < prices.size(); i++) { profit = max(profit, prices[i] - smallest); smallest = m...
// CGlutPlayDialog.cpp : implementation file // #include "stdafx.h" #include "ComputerizedDanceClassroomApplication.h" #include "GlutPlayDialog.h" #include "afxdialogex.h" #include "SampleViewer.h" #include "PlayDialog.h" #include "NiTE.h" #include "ErrorDialog.h" #include "ComputerizedDanceClassroomApplicationDlg.h" ...
#include "Wall.h" /*//////////////////////////////////////////////////// PlaneArrayクラス 実装部 Plane構造体を平面壁の個数分確保し,平面壁全体の オペレーションを行うクラス.このクラスを介して Plane構造体に含まれている情報にアクセスする. ////////////////////////////////////////////////////*/ PlaneArray::PlaneArray():PI(3.14159265358979323846264338328){ plane = 0; planeN...
#include "surf.h" #include "extra.h" using namespace std; namespace { // We're only implenting swept surfaces where the profile curve is // flat on the xy-plane. This is a check function. static bool checkFlat(const Curve &profile) { for (unsigned i=0; i<profile.size(); i++) { ...
/* share_ptr虽然已经很好用了,但是有一点share_ptr智能指针还是有内存泄露的情况, * 当两个对象相互使用一个shared_ptr成员变量指向对方,会造成循环引用,使引用计数失效,从而导致内存泄漏。 */ /* 四种智能指针 auto_ptr(已废弃)、unique_ptr、shared_ptr、weak_ptr */ #include <iostream> #include <string> using namespace std; class shape { public: virtual ~shape() {} }; class shape_wrapper { public: shape_w...
if there are any vertics in graph whose removal splits the graph into some components,then such vertices are known as articulation vertices. Directed Graph: ( also known as diagraphdigraph) if the edges in graph have directions,then it is known as directed graph if in directed graph ,if there is age connecting...