text
stringlengths
8
6.88M
void phase1() { //Phase 1 switch (c_state) { /* Start state send #1 and change state */ case READY: serial_write(MOV_1); c_state = SCANNING; delay(500); break; /* Scan state Move head while waiting for the END_MOV */ case SCANNING: while (scan(...
/* * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd. * * Author: kirigaya <kirigaya@mkacg.com> * 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 3 of the License, or...
#include "rank_merger.hpp" #include "prepare.hpp" #include "utils/log.hpp" #include "utils/assert.hpp" #include "utils/proto_utils.hpp" #include "utils/game_def.hpp" #include "config/guanpin_ptts.hpp" #include "config/utils.hpp" #include <list> #include <limits> namespace nora { namespace { st...
// // Cliente.cpp // ExamenFinal_Pregunta2 // // Created by Daniel on 01/12/14. // Copyright (c) 2014 Gotomo. All rights reserved. // #include "Cliente.h" Cliente::Cliente(){ nombre = apellidoM = apellidoP = sexo = direccion = "Vacio"; edad = telefono = 0; } Cliente::Cliente(int){ cout<<"Nombre: "; ...
// // 9461.cpp // baekjoon // // Created by 최희연 on 2021/06/21. // #include <iostream> using namespace std; long long arr[101]; long long pado(int n){ arr[1] = 1; arr[2] = 1; arr[3] = 1; if( n > 3 ){ if(arr[n-2] == 0) arr[n-2] = pado(n-2); if(arr[n-3] == 0) a...
#pragma once class CAct_FanShaped { //public: // void DamageCacl(); //private: // int m_cost = 50; // bool m_first = true; // CVector3 m_efPos = CVector3::Zero(); // CVector3 m_laserVec = CVector3::Zero(); // CEffect* m_efk = nullptr; // CVector3 m_efs = { 5,5,5 }; // float m_laserTheta = 0.f; // float m_near = 0.2f; }...
#include<stdio.h> #include<iostream> #include<vector> #include<sys/types.h> #include<unistd.h> using namespace std; /* #define SUB(x, y) x-y //macro expansion *&element-offset=value lack of legal left value // #define ACCESS_BEFORE(element, offset, value) *SUB(&element, offset) = value #define ACCESS_BEFORE(element,...
#ifndef MASTERS_PROJECT_CALCULATOR_H #define MASTERS_PROJECT_CALCULATOR_H #include <fstream> #include <stack> #include <map> #include "../libs/json/json.hpp" #include "../greekjet/greekjet3/GreekJet3.h" #include "../binomial_method/case/Case.hpp" #include "../binomial_method/method/BinomialMethod.hpp" #include "../bla...
#include "GnSystemPCH.h"
// // EPITECH PROJECT, 2018 // zappy // File description: // Text.cpp // #include "Text.hpp" Text::Text(irr::gui::IGUIStaticText *list, int id) { _idx = 0; _id = id; _Text = list; } Text::Text() { } Text::~Text() { } void Text::setPos(int pos) { _Text->setPos(pos); } int Text::getPos(void) const { auto pos =...
#include<cstdio> #include<cstring> #define MAXN 101 using namespace std; double a[MAXN][MAXN+1]; double x[MAXN]; int n,m; inline double ab(double x) { return x<0?-x:x; } void swap(double &x,double &y) { double tm=x;x=y;y=tm; } int gaosi() { double mx; int w; bool flag=true; for(int k=1;k<...
#include <stdio.h> #include <stdlib.h> #include "Table.h" #include "AllocSvrConnect.h" #include "Logger.h" #include "Configure.h" #include "IProcess.h" #include "RedisOprs.h" #include "CoinConf.h" #include "GameCmd.h" Table::Table():m_nStatus(-1) { } Table::~Table() { } void Table::init() { timer.init(this); stop...
//Q 3 #include"stdio.h" #include"conio.h" int factorial(int); void main() { clrscr(); int number = 0; printf("\nEnter an integer value: "); scanf(" %d", &number); printf("\nThe factorial of %d is %d\n", number, factorial(number)); getch(); } int factorial(int N) { if( N < 2 ) return N; else ...
#include <QMessageBox> #include <QPixmap> #include <iostream> #include "mainwindow.h" #include "ui_mainwindow.h" #include "graph.h" #include "vertex.h" #include "edge.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); QPixmap pix("salesman....
#include "cFreeParking.h" #include <iostream> cFreeParking::cFreeParking() { } cFreeParking::~cFreeParking() { } bool cFreeParking::Actioon() { std::cout << "cFreeParking::Actioon()" << std::endl; return true; }
#ifndef AD2_SlvFlw_H #define AD2_SlvFlw_H using namespace std; const double re = 70; double rei = 1 / re; int nlast = 5000, nlp = 50; class SlvFlw { public: static void slvflw(double& dt, vector<vector<double>>& x, vector<vector<double>>& y, vector<vector<double>>& u, v...
// // ShipManage.cpp // GetFish // // Created by zhusu on 14/12/19. // // #include "ShipManage.h" #include "Ship.h" ShipManage::ShipManage() { } ShipManage::~ShipManage() { } bool ShipManage::init() { if(ActorManage::init()) { _screenSize = CCDirector::sharedDirector()->getWinSize(); ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2007 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. ** It may not be distributed under any circumstances. */ /** @mainpage img The img module is responsible for the followin...
// // Model.h // Odin.MacOSX // // Created by Daniel on 16/10/15. // Copyright (c) 2015 DG. All rights reserved. // #ifndef __Odin_MacOSX__Model__ #define __Odin_MacOSX__Model__ #include "Drawable.h" #include "Resource.h" #include <vector> #include <assimp/Importer.hpp> #include <assimp/scene.h> #include <assimp/...
#ifndef __MODULE_AYIN__ARROW__H #define __MODULE_AYIN__ARROW__H #include "Module.h" #include "Animation.h" #include "p2Point.h" #include "Path.h" #include "ModuleAyin.h" #include "SDL_mixer\include\SDL_mixer.h" struct SDL_Texture; enum arrow_state_2 { NOT_EXISTING_2, LEVEL_ONE_2, LEVEL_ONE_CHARGE_2, LEVEL_ONE_CH...
#pragma GCC optimize("Ofast") #include <algorithm> #include <bitset> #include <deque> #include <iostream> #include <iterator> #include <string> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #include <unordered_map> #include <unordered_set> using namespace std; void abhisheknaiidu()...
// cakebot.cpp // // Arduino Uno code to drive stepper on a ZMorph paste extruder // from an ABB robot with 24V digital data lines // using the Adafruit Motor Shield 2.3 // // Michael Dewberry 9/30/2016 #include <Adafruit_MotorShield.h> #include <AccelStepper.h> #include <Bounce2.h> #include "robotIO.h" RobotIO robo...
#include "AiPlayer.h" AiPlayer::AiPlayer(){ //ctor } AiPlayer::~AiPlayer(){ //dtor }
#include <iostream> #include <array> /*! * Reverse de order of elements inside the array. * @param arr Reference to the array with the values. */ template <std::size_t SIZE> void reverse( std::array< std::string, SIZE > & arr ) { /*codigo*/ }
#pragma once #include "GcPropertyEntity.h" #include "GcPropertyGridProperty.h" class GcSequenceInfoPropEntity : public GcPropertyEntity { private: class MainPropertyGridProperty : public GcPropertyGridProperty { public: MainPropertyGridProperty(const CString& strName, const COleVariant& varValue); protected: ...
#include "stdafx.h" #include "MapChip.h" #include "Level.h" MapChip::MapChip(const LevelObjectData& objData) { wchar_t filePath[256]; swprintf_s(filePath, L"Assets/modelData/%s.cmo", objData.name); m_model.Init(filePath); m_model.UpdateWorldMatrix(objData.position, objData.rotation, CVector3::One()); //静的物理オブジェクト...
#include<iostream> #include<stdio.h> #include<bits/stdc++.h> #include<algorithm> #include<cmath> #include<string> #include<cstring> #include<vector> #include<map> #include<queue> #include<set> #include<list> #include<unordered_map> #include<unordered_set> #define ll long long #define MAX 100000003 using namespace std; ...
#ifndef __stepPlayer__ #define __stepPlayer__ #include <d3dx9.h> #include "myMethod.h" class PLAY{ public: PLAY(); VOID PLAY::Init(); INT PLAY::GetPlayer( ); VOID PLAY::ChangePlayer( ); private: INT _player; }; #endif
../1084/D.cpp
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #include <iostream> #include <algorithm> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <memory.h> #include <math.h> #include <string> #include <string.h> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include <functional>...
/* * This app was the final project for CS 210 * Using python integration, it takes a text document of items purchased from a grocery * store, compiles them into a list, alphabetizes and counts the number of each item, * then displays the results in a list or in a histogram * * Python does the majority of work, whi...
#include "item.hpp" #include "sda/sda.hpp" #include "sdb/sdb.hpp" #include "sdc/sdc.hpp" int main(int argv, char** args) { // Object instances Item item; // Library calls sda(); sdb(); sdc(); return 0; }
#pragma once #include "utils/ptts.hpp" #include "proto/config_equipment.pb.h" using namespace std; namespace pc = proto::config; namespace nora { namespace config { using equipment_ptts = ptts<pc::equipment>; equipment_ptts& equipment_ptts_instance(); void equ...
// Created on: 1995-09-01 // Created by: Bruno DUMORTIER // Copyright (c) 1995-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...
#include "python_ltsssolver.hpp" std::vector<int> find_optimal_partition__LTSS(int n, std::vector<float> a, std::vector<float> b) { auto ltss = LTSSSolver(n, a, b); return ltss.get_optimal_subset_extern(); } float find_optimal_score__LTSS(int n, std::vector<float> a, std::vector<...
//https://www.spoj.com/problems/BAISED/ //Baised problem SPOJ #include<iostream> #include<bits/stdc++.h> #include<algorithm> using namespace std; #define ll long long int main() { ll t; cin>>t; while(t--) { ll n; cin>>n; ll arr[n]; for(ll i=0;i<n;i++) { string s; cin>>s; cin>>arr[i]; } sort(...
#include "stdafx.h" #include "Act_superBeam.h" #include "../Monster.h" #include "../../GameData.h" Act_superBeam::Act_superBeam() { m_ActionId = enSuperBeam; } bool Act_superBeam::Action(Monster* me) { if (m_target == nullptr) return true; if (m_first) { if (me->GetMP() < m_cost) return true; m_cBeam.Fire(...
#pragma once #include "BaseAgent.h" #include "Typedef.h" #include <stdint.h> class MoneyAgent : public BaseAgent { public: MoneyAgent(); virtual ~MoneyAgent(); virtual bool init(); virtual int OnConnected(); virtual int updateMoney(int uid, int64_t opmoney); protected: virtual int responsePacket(); };
//write a c++ program to find the second largest number (or middle) among three numbers. #include<iostream> using namespace std; int main() { int a,b,c; cout<<"Enter three number"<<endl; cin>>a>>b>>c; if(a>=b && b>=c || c>=b && b>=a) cout<<b<<" is second largest number"<<endl; else if(b>=a && a>...
// Qestion => Check if there exists two elements in an array such that their sum is equal to given k /* Brute Force Approach bool pairsum(int arr, int n, int k){ for(int i=0; i<n; i++){ for(int j=i+1; j<n;j++){ if(arr[i] + arr[j] == k){ cout<<i<<" "<<j<<endl; re...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- * * Copyright (C) 1995-2008 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * File : WindowsOpSkinElement.cpp */ #...
#include <cmath> #include "gwmessage/GWSetValueRequest.h" using namespace std; using namespace Poco; using namespace BeeeOn; GWSetValueRequest::GWSetValueRequest(): GWRequest(GWMessageType::SET_VALUE_REQUEST) { } GWSetValueRequest::GWSetValueRequest(const JSON::Object::Ptr object) : GWRequest(object) { } void GW...
#include <string> #include <math.h> #include "format.h" #include <stdexcept> using std::string; using std::to_string; // Helper function that takes in input and produces a formatted output as shown below // INPUT: Long int measuring seconds // OUTPUT: HH:MM:SS string Format::ElapsedTime(long seconds) { try{ ...
// // Controller.cpp // SampleProject // // Created by Li, Jian Hong on 1/25/18. // Copyright © 2018 CTEC. All rights reserved. // #include "Controller.hpp" #include <vector> using namespace std; Controller :: Controller() { } void Controller :: start() { // for (int index = 0; index < 10; index ++) //...
#pragma once #include "Common/Window.h" struct GLFWwindow; namespace Rocket { class WindowImplement : implements Window { public: WindowImplement(const WindowProps &prop) : Window(prop) {} virtual ~WindowImplement() = default; void Initialize() final; void Finalize() final; void* GetNativeWind...
#include <iostream> #include <vector> #include <set> using namespace std; int main() { int n, m, a, b, w; cin >> n >> m; vector<vector<pair<int, int>>> ss(n); vector<int> d(n, INT_MAX); d[0] = 0; for (int i = 0; i < m; i++) { cin >> a >> b >> w; a--, b--; ss[a].emplace_...
// // Created by hamon_e on 10/15/17. // #define BOOST_SPIRIT_THREADSAFE #include <boost/property_tree/json_parser.hpp> #include <boost/property_tree/ptree.hpp> #include <boost/filesystem.hpp> #include "HttpServer.hpp" #include "ssl/Base64.hpp" #include "json.hpp" HttpServer::HttpServer(IDataBase *db, Server *server,...
#include <iostream> #include <string> #include <fstream> #include <iterator> #include <vector> #include <termios.h> #include <unistd.h> #include <cctype> #include <algorithm> #include "Student.h" #include "Student_Store.h" #include "util.h" // Preprocessor macro variable when set to true // will skip password validat...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- * * Copyright (C) Opera Software ASA 2011 * * @author Fredrik Ohrn */ #ifndef ES_NATIVE_MIPS_H #define ES_NATIVE_MIPS_H #ifdef ES_NATIVE_SUPPORT #ifdef ARCHITECTURE_MIPS #include "modules/ecmascript/carakan/...
#include "Matching.h" // Scan two images' matched points and make pairs vector<keyPointPair> Matcher::scanPointPairs(map<vector<float>, VlSiftKeypoint>& f1, map<vector<float>, VlSiftKeypoint> f2){ // Use vlfeat's kdtree VlKDForest* forest = vl_kdforest_new(VL_TYPE_FLOAT, 128, 1, VlDistanceL1); float *data = new flo...
#include "init_data.h" using namespace std; using namespace cv; void get_data_and_name(cv::Mat&data, std::vector<std::string>&feature_name_v, const std::string path) { int DIM = 1024; ifstream list_file(path + "LIST.TXT"); string feature_name; ifstream feature_file; float temp; vector<float> temp_vec; feature_...
//hung.nguyen@student.tut.fi - student id: 272585 //sanghun.2.lee@student.tut.fi - student id: 272571 #ifndef CLASS_HH #define CLASS_HH #include <map> using namespace std; using products = map<string,double>; using stores = map<string,products>; using chains = map<string, stores>; class market{ public: market(); ...
#include <fstream> #include "Cell.h" using namespace std; //Constructor Cell::Cell(char Symbol) { this->row = 0; this->column = 0; this->symbol = Symbol; } //Destructor Cell::~Cell() { } //Constructor for easy creating a Cell Cell::Cell(size_t Row, size_t Column, char Symbol) { this->row = Row; this->column = ...
#include <iostream> #include <cstdio> #include <cmath> using namespace std; const int maxn = 10010; int dp[maxn], A[maxn]; int main() { int n; cin >> n; for(int i = 0; i < n; i++) { cin >> A[i]; } dp[0] = A[0]; for(int i = 1; i < n; i++) { dp[i] = max(A[i], dp[i - 1] + A[i]); } int k = 0; for(...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> using namespace std; const int MAXN = 2e4 + 100; const int MAXM = 2e5 + 100; struct Edge { int p,n...
#include "_pch.h" #include "wxDateTimeProperty.h" WX_PG_IMPLEMENT_PROPERTY_CLASS(wxDateTimeProperty, wxPGProperty, wxDateTime, const wxDateTime&, TextCtrl) //----------------------------------------------------------------------------- wxDateTimeProperty::wxDateTimeProperty(const wxString& label, const wxString& ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2012 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" #include "OpBar.h" #include "adjunct/quic...
#include "Fraction.h" #include <iostream> using namespace std; int main (void) { // Use this driver program to test cout <<. }
/************************************************************************/ /* File name : BkGnuPGInfo.cpp */ /************************************************************************/ /* Contents : BkGnuPG 制御情報アクセスクラス */ /* ...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4; c-file-style:"stroustrup" -*- * * Copyright (C) 2002-2008 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * Espen Sand */ #ifndef __X11UTILS_H__ #define __X11UTILS_H...
#include <iostream> #include <sstream> #include <fstream> #include <string> #include <iterator> #include <string.h> // OpenGL includes #define GL_GLEXT_PROTOTYPES #include <GLFW/glfw3.h> // CUDA Includes #include <cuda_runtime.h> #include <device_launch_parameters.h> #include <cuda_gl_interop.h> class Viewer { publ...
#pragma once #include "InformationManager.h" #include "MapTools.h" #include "BaseManager.h" InformationManager::InformationManager() { } void InformationManager::onStart() { m_enemyBases.clear(); m_bases.clear(); m_camperWorking = false; InformationManager::onFrame(); } void InformationManager::onFrame() { In...
/* * FriendMessage.cpp * * Created on: Jul 23, 2017 * Author: root */ #include "FriendMessage.h" #include "Log/Logger.h" #include "Network/Message_Facade.h" #include "Network/NetWorkConfig.h" #include "../MessageBuild.h" #include "MsgCommonClass.h" #include "MessageStruct/CharLogin/CharBaseInfo.pb.h" #includ...
#include <iostream> using namespace std; void resv(int a[], int start, int end){ for(start, end; start < end; start++, end--){ int t = a[start]; a[start] = a[end]; a[end] = t; } } int main(){ int n, k; cin >> n >> k; int a[n]; for(int i = 0; i < n; i++){ cin >> a[i]; } k = k % n; resv(a, 0, n-k-1); ...
#include "stdafx.h" #include "RgnGenerator.h" #include "RgnGeneratorDlg.h" #include "PreViewDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #endif CRgnGeneratorDlg::CRgnGeneratorDlg(CWnd* pParent /*=NULL*/) : CDialog(CRgnGeneratorDlg::IDD, pParent) { m_ViewDlg = NULL; } void CRgnGeneratorDlg::DoDataExchange(CDataExchan...
// Created by 송지원 on 2019-04-13. // #include <iostream> using namespace std; int input[10][10]; int relation[10][10]; int box_cnt[5]; //i,j 부터 사이즈 n 의 사각형이 있는지 확인하고 // 있을 시에는 box_cnt[n-1]을 1 증가시키고 1 리턴 // 없을 시에는 0 리턴 int check_sum(int i, int j, int n) { int cnt=0; for (int ii=i; ii<i+n+1; ii++) { ...
// Test Camera Controller Widget // // Copyright (C) 2008 // Center for Perceptual Systems // University of Texas at Austin // // jsp Thu Jun 12 09:59:39 CDT 2008 #include <QApplication> #include <QGridLayout> #include <QObject> #include "exception_enabled_app.h" #include "camera_controller_widget.h" #include "persist...
#ifndef EXECUTIVE_H #define EXECUTIVE_H #include "maxHeap.h" #include "minHeap.h" #include <fstream> #include <iostream> using namespace std; class executive { private: minHeap minheap; maxHeap maxheap; public: executive(string _filename); ~executive(); void Print(); }; #endif
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2007 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. * */ #ifndef FORMSUBMITTER_H #define FORMSUBMITTER_H #include "mo...
#include "e.h" #include "f.h" #include "g.h" #include "d.h" using namespace std; void d(){ e(); f(); g(); }
// // EPITECH PROJECT, 2018 // zappy // File description: // StaticTextManager.cpp // #include "StaticTextManager.hpp" StaticTextManager::StaticTextManager() { } StaticTextManager::~StaticTextManager() { } void StaticTextManager::addStaticText(StaticText txt) { list.push_back(txt); } void StaticTextManager::setVi...
// // main.cpp // Sorted_Doubly_Linked_List // // Created by 세광 on 2021/08/12. // #include "Application.hpp" int main(int argc, const char * argv[]) { Application app; app.Run(); return 0; }
/* * Copyright (C) 2018-2021 David C. Harrison. All right reserved. * * You may not use, distribute, publish, or modify this code without * the express written permission of the copyright holder. */ #include <vector> #include <functional> /* * Simple multi-threaded Radix Sort with support for Most Significant ...
/** * Copyright (c) 2016, Timothy Stack * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of condi...
#include <opencv2/opencv.hpp> #include <vector> #include <string> #include <Eigen/Core> #include <pangolin/pangolin.h> #include <unistd.h> using namespace std; using namespace Eigen; // 文件路径 string left_file = "../../../ch5/stereo/left.png"; string right_file = "../../../ch5/stereo/right.png"; // 在pang...
#ifndef CCL_HPP #define CCL_HPP #include "globals.hpp" std::tuple<cv::Mat, int> grassfire_4( cv::Mat img ); std::tuple<cv::Mat, int> grassfire_8( cv::Mat img ); std::tuple<cv::Mat, int> eq_label_set_8( cv::Mat img ); std::tuple<cv::Mat, int> eq_label_set_4( cv::Mat img ); std::tuple<cv::Mat, int> contour_tarck_8( cv:...
#include <iostream> #include <opencv2/opencv.hpp> #include <glog/logging.h> #include <fstream> #include <string> #include <sys/stat.h> #include <../ugv-share/defines.h> using namespace std; using namespace victl; bool b2v(string bfile, string vfile); bool v2b(string vfile, string bfile); int main(int argc, char** ar...
// This file is part of the xxxxxxxxx project. // This Source Code Form is subject to the terms of the Mozilla Public License, // v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. /* * File: OpenmvgIO.cpp * Author: xxxxxxxxx xxxxxxxxx ...
#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; vector<int> G[100100]; int sav[100100],rec[100100]; int main() { int n,m,k; while (scanf("%d%d%d...
#include "chunk.h" ChunkColumn::ChunkColumn(int x, int y){ xPos = x; zPos = y; } int ChunkColumn::getX() { return xPos; } int ChunkColumn::getZ() { return zPos; } Chunk *ChunkColumn::getChunks() { return chunks; }
#include <iostream> #include <cmath> #include <exception> using namespace std; double changeBin (double n){ double ans = 0.0; for (int i = 0; i< 32; i++){ if(n >= 1 / pow(2, i)){ n -= 1 / pow(2, i); ans += 1 / pow(10, i); cout << "ans: " << ans << endl; } ...
#include <cstdio> int main(){ int caini, pisici, gaini; scanf("%d", &caini); pisici = caini * 2; gaini = pisici * 2; printf("%d\n", caini + pisici + gaini); return 0; }
// Created on: 1992-08-26 // Created by: Jean Louis FRENKEL // Copyright (c) 1992-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<iostream> #include<math.h> #include <iomanip> #include<vector> using namespace std; int main(){ int n; float mi = 0; float sigma2 = 0; cout << "Digite um número inteiro: "; cin >> n; vector<float> values; float tmp; for(int i=0; i < n; i++){ cout << "(" << i+1 << "/" ...
#include <string> #include <msg_exception.hpp> namespace util { msg_exception::msg_exception(const char *message): msg_(message) {} msg_exception::msg_exception(const std::string message): msg_(message) {} const char* msg_exception::what() const throw() { return msg_.c_str(); } }
#include <iostream> using namespace std; //Use two pointer slow and fast //fast increments by 2 node and slow by one node //when fast reaches end slow reaches mid typedef struct Node { int key; Node *next; Node(int x) { key = x; } } Node; Node *insert(Node *head, int key) { Node *temp =...
// Minimize the Heights II // https://practice.geeksforgeeks.org/problems/minimize-the-heights3351/1 #include<bits/stdc++.h> using namespace std; int getMinDiff(int arr[], int n, int k) { int i, minValue=0; // sort(arr, arr+n); for(i=0; i<n; i++) { arr[i]=arr[i]-k<=0?arr[i]+k:min(arr[i]-k, m...
#ifndef ROOM_H #define ROOM_H #include "Rect.h" namespace ld { struct Room : public Rect { Room(int x, int y, int w, int h, const Room* master_ = nullptr) : Rect(x, y, w, h), master(master_) {} bool operator==(Room& room) const { return x == room.x && y == room.y && w == room.w && h == room.h;...
#ifndef BLOCDECORATOR_H #define BLOCDECORATOR_H #include "BaseBloc.h" #include "../Other/btMethods.h" #include <algorithm> namespace BehaviourTree { /* Base for a decorator bloc. Has only one and only child (not many, not 0 -> cannot be disconnected). */ class BlocDecorator : public BaseBloc ...
#include "LevelEditorModelLoader.h" #include "ImageLoader.h" #include "ObjLoader.h" #include "List.h" #include <iostream> LevelEditorModelLoader::LevelEditorModelLoader(Scene &scene, Font &font) { filename = new TextField(scene, font, glm::vec4(300, 300, 500, 50), "Enter Model Filename:"); apply = new B...
#include "optionset.hh" using namespace std; namespace S6M { OptionSet::OptionSet(ByteBuffer *bb, Mode mode, uint16_t optionsLength) : OptionSetBase(this, mode) { if (optionsLength > SOCKS6_OPTIONS_LENGTH_MAX) throw invalid_argument("Options length exceeds maximum value"); if (optionsLength % SOCKS6_ALIGNMENT) ...
/******************************************************** Scene4 : debugging camera path (free roaming to watch historical pos) *******************************************************/ #pragma once namespace Qwerty { class Scene_DebuggingCameraPos { public: void Init(Noise3D::IScene* pScene,Noise3D::...
#ifndef ONESHOT_TIMER_H #define ONESHOT_TIMER_H #include <chrono> #include <condition_variable> #include <functional> #include <mutex> #include <thread> #include <MessageQueue.h> using TimeoutFunction = std::function<void(void)>; class OneshotTimer { public: OneshotTimer(); OneshotTimer(const OneshotTimer& ...
#include <vector> #include <iostream> #include <memory> using namespace std; class BinaryPolynomialDivTwo { public: int countRoots(vector <int> a) { int ans = 0; if(a.at(0) == 0) ++ans; int cnt = 0; for(int i=0;i<a.size();++i) if(a.at(i)==1) ++cnt; if(cnt%2==0) ++ans; return ans; } };
#include <iostream> #include<stdio.h> #include<string.h> #include <vector> #include <string> #include <cctype> #include<math.h> using namespace std; // hashtable *head; string max_str; int max_count=0; typedef struct Array{ int count; unsigned int hash; struct Array * next; }hashtable; int hashfunction(str...
#pragma once #pragma once //使用するヘッダーファイル #include"GameL\SceneObjManager.h" //使用するネームスペース using namespace GameL; //描画関係の定数 #define GAME_BACK_X (250) #define GAME_BACK_Y (380) #define TITLE_BACK_X (225) #define TITLE_BACK_Y (490) #define GAME_DOBLE_FONT (50) //オブジェクト:クリア class CObjMenu : public CObj { public: CObjMe...
/* 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...
#pragma once #include <array> #include <cstdint> #include <vector> #include "defs.hh" #include "rom.hh" namespace mvm0 { class VMApi; class CPU { public: CPU(const ROM &rom); enum class Status { OK, NORMAL_EXIT, BAD_INS, SEGV, }; // Make CPU ready for execution void init(); // Run th...
#include "IA.h" IA::IA(TeamSprite ally) { teamAlly = ally; } IA::~IA() { //dtor } IA::IA(const IA& other) { //copy ctor } IA& IA::operator=(const IA& rhs) { if (this == &rhs) return *this; // handle self assignment //assignment operator return *this; } void IA::moveIA(){ int step=this->c...
#include<bits/stdc++.h> using namespace std; main() { int n, m; while(cin>>n>>m) { int p=0, ans; while(n!=0 && m!=0) { if(p==0) { ans=1; n--, m--; p++; } else if(p==1) { ...