text
stringlengths
8
6.88M
/*The tree node has data, left child and right child class Node { int data; Node* left; Node* right; }; */ Node *lca(Node *root, int v1,int v2) { int small = v1; int large = v2; if (v1 > v2) { small = v2 ; large = v1 ; } ...
#include "rna_transcription.h" char transcription::to_rna(char RNA) { return RNA == 'G' ? 'C' : RNA == 'C' ? 'G' : RNA == 'T' ? 'A' : RNA == 'A' ? 'U' : '?'; } string transcription::to_rna(string RNA) { string newRNA; for (auto kv : RNA) newRNA += to_rna(kv); return newRNA; }
#include "ConnectFile.h" void ConnectFile::importDauSach(string line, ConTroDauSach &data) { data = new DauSach; string temp = ""; int n = 0; for (;line[n] != ','; n++) { temp += line[n]; } data->ISBN = temp; temp = ""; n++; for (;line[n] != ','; n++) { temp += line[n]; } data->tenSach = temp; temp =...
//! Bismillahi-Rahamanirahim. /** ========================================** ** @Author: Md. Abu Farhad ( RUET, CSE'15) ** @Category: /** ========================================**/ #include<bits/stdc++.h> #include<stdio.h> using namespace std; #define ll long long #define scl(n) scan...
#include <iostream> int main() { const int v2 = 0; int v1 = v2; int & r1 = v1; r1 = v2; r1 = 30; std::cout << "v2 = " << v2 << std::endl; //int & r3 = v2; //int null = 0, *p = (int *)null; int null = 0, *p = NULL; return 0; }
#include "gameengine.h" #include <chrono> #include <thread> #include <QCoreApplication> #include <QRandomGenerator> #include <QThread> static MyEnums::PlayerType mapUnsignedToSignType(const unsigned player) { switch (player) { case 1: return MyEnums::PlayerType::Nought; case 2: return MyE...
#include <Servo.h> Servo servo1; Servo servo2; int currentPos = 0; void setup() { Serial.begin(9600); servo1.attach(9); servo2.attach(8); } void servoWrite(int pos) { servo1.write(pos); servo2.write(pos); delay(50); } void serialReset(){ Serial.end(); Serial.begin(9600); } void l...
N = input().strip() print(N[::-1])
/************************************************************* * > File Name : P2264.cpp * > Author : Tony * > Created Time : 2019/10/14 20:49:10 * > Algorithm : set **************************************************************/ #include <bits/stdc++.h> using namespace std; inline...
#ifndef _CONFIG_H_INCLUDED #define _CONFIG_H_INCLUDED #include <string> #include "common.h" #include "pixmap.h" #include "fuzzy.h" #ifdef _WINDOWS #include <windows.h> #include <stdio.h> #include <fcntl.h> #include <io.h> #include <iostream> #include <fstream> #include <conio.h> #ifndef _USE_OLD_IOSTREAMS using nam...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once WINRT_EXPORT namespace winrt { namespace ABI::Windows::Services::TargetedContent { struct ITargetedContentAction; struct ITargetedContentAvailabilityChangedEventArgs; struct ITargetedContent...
/* * SPDX-FileCopyrightText: (C) 2015-2022 Daniel Nicoletti <dantti12@gmail.com> * SPDX-License-Identifier: BSD-3-Clause */ #ifndef STATS_H #define STATS_H #include <Cutelyst/cutelyst_global.h> #include <QObject> namespace Cutelyst { class EngineRequest; class StatsPrivate; class Stats { Q_DECLARE_PRIVATE(St...
//! Bismillahi-Rahamanirahim. /** ========================================** ** @Author: Md. Abu Farhad ( RUET, CSE'15) ** @Category: /** ========================================**/ #include<bits/stdc++.h> #include<stdio.h> using namespace std; #define ll long long #define scl(n) scan...
/** * * @file CM730ControlTable.hpp * @brief CM730 control table * @auther Naoki Takahashi * **/ #pragma once #include "../../Communicator/Protocols/DynamixelVersion1.hpp" namespace IO { namespace Device { namespace ControlBoard { namespace CM730ControlTable { constexpr Communicator::Protocols...
#ifndef CELLO_COMPONENT_INFO #define CELLO_COMPONENT_INFO #include <string> #include <map> #include <vector> #include <gameplay.h> using std::string; using std::map; using std::vector; using gameplay::Vector3; #define COMPONENT_INFO(className) static cello::ComponentInfo<className> getInfo() \ { \ ...
class Solution { public: int maxProfit(vector<int>& inventory, int orders) { int result = 0; inventory.push_back(0); sort(inventory.begin(), inventory.end()); int count = 1; long temp = 0; long n; for(int i = inventory.size()-1; i > 0; i--) { ...
#include "display_object.h" namespace loss { DisplayObject::DisplayObject(DisplayObject *parent) : _parent(parent) { } Eigen::Projective3f &DisplayObject::transform() { return _transform; } void DisplayObject::parent(DisplayObject *parent) { _parent = parent; ...
#ifndef _C_DBTASK_SQLOPER_H #define _C_DBTASK_SQLOPER_H #include <iostream> #include <vector> #include "common.h" #define UNUSED(x) (void)x enum DB_TYPE { DB_ORACLE = 0, DB_MYSQL = 1, }; class _c_dbTaskSqlOper { public: static _c_dbTaskSqlOper& getInstance(); bool executeCreatDb(DB_TYPE databaseType, PDB_PARAM ...
#include<bits/stdc++.h> using namespace std; #define ff first #define ss second #define int long long #define pb push_back #define mp make_pair #define pii pair<int,int> #define vi vector<int> #define mii map<int,int> ...
#include "include/world.h" #include "include/intersection.h" #include "include/plane.h" #include "gtest/gtest.h" #include <cmath> class WorldFixture : public ::testing::Test { protected: virtual void SetUp() { world = new raytracer::World(); light = new raytracer::Light(); transform ...
#include "DialogueBox.h" #include "Textures.h" #include "GameWindow.h" #include "App_WebBrowser.h" #include "Website.h" DialogueBox::DialogueBox() { } DialogueBox::DialogueBox(GameWindow* gamewindowP, Textures* texturesP, Website* websiteP, int x, int y, dialogueBoxType type) { this->gameWindowP = gamewindowP; ...
// Section 11 // Function Definitions // Area of a circle nd volume of a cylinder #include <iostream> #include <cmath> using namespace std; //function prototypes double calc_volume_cylinder(double radius, double height); double calc_area_circle(double radius); void area_circle (); void volume_cylinder(); const double...
/* problem : Implement a stack that stores integers, then program process the commands condition : 5 commands are given push,pop(if stack is empty, printout -1),size,empty(if stack is empty print 1, otherwise print 0),top(if stack is empty, printout -1) Example -Input 14 push 1 push 2 top size empty pop pop pop size em...
/** * Copyright (C) 2017 Alibaba Group Holding Limited. All Rights Reserved. * * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * ...
/*************************************************************************** dialogoordenarcasos.cpp - description ------------------- begin : mar sep 16 2003 copyright : (C) 2003 by Oscar G. Duarte email : ogd...
class Solution { public: int maxScore(vector<int>& cardPoints, int k) { int lsum=0, rsum=0, n=cardPoints.size()-1; for(int i=0; i<k; i++){ lsum+=cardPoints[i]; } int maxm=lsum; for(int i=0; i<k; i++){ rsum+=cardPoints[n-i]; lsum-=c...
/* Foward List: * Thuộc tính: + Foward-list là một singly linked list + Cấu trúc tuần từ (Sequence) + Danh sách liên kết (Linked list) + Cấp phát động (Allocator-aware) * Template parameters <T, Alloc>: + T: Kiểu dữ liệu cần chứa (Type of ele contained) + Allo...
#pragma once #include <tudocomp/util.hpp> #include <tudocomp/Compressor.hpp> #include <tudocomp/Range.hpp> #include <tudocomp_stat/StatPhase.hpp> #include <tudocomp/compressors/lz_pointer_jumping/FixedBufferPointerJumping.hpp> #include <tudocomp/compressors/lz_pointer_jumping/DynamicBufferPointerJumping.hpp> #includ...
#include "CCollectDlg.h" #include <process.h> CCollectDlg::CCollectDlg(int _objectIndex) : m_objectIndex(_objectIndex) { m_curSettingData.msgOptions[WM_CREATE] = true; m_curSettingData.msgOptions[WM_SHOWWINDOW] = true; m_curSettingData.msgOptions[WM_WINDOWPOSCHANGED] = true; m_curSettingData.msgOptions...
// Fill out your copyright notice in the Description page of Project Settings. #include "MenuButton.h" #include "Runtime/UMG/Public/Blueprint/WidgetTree.h" #include "UObject/ConstructorHelpers.h" bool UMenuButton::Initialize() { auto success = Super::Initialize(); WidgetTree->RootWidget = ButtonCus...
/* * Copyright (c) 2014, Julien Bernard * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DIS...
//Дан целочисленный массив размера N. Удалить из массива все элементы, встречающиеся ровно два раза, и вывести размер полученного массива и его содержимое. #include <iostream> #include <locale.h> using namespace std; void shift(int i, int N, int* A) { for (int j = i; j < N; j++) { A[j] = A[j + 1]; //записываем...
/***************************************************************************************************** * 剑指offer第34题 * 把只包含质因子2、3和5的数称作丑数(Ugly Number)。例如6、8都是丑数,但14不是,因为它包含质因子7。 习惯上我们把1当做是第一个丑数。求按从小到大的顺序的第N个丑数。 * * Input: * Output: 第N个丑数 * * Note: * 关键在于思路 链接:https://www.nowcoder.co...
#pragma once template <typename Type> tensor<Type>& tensor<Type>::transpose() { auto const copy = *this; cuda_blas::_transpose(copy.data_, data_, shape_); std::swap(shape_.first, shape_.second); return *this; } template <typename Type> tensor<Type> transpose(tensor<Type> tensor) { return tensor.transpose(); }...
/*************************************************************************** * Filename : WindowsWindow.h * Name : Ori Lazar * Date : 29/10/2019 * Description : Contains the windows OS specific window setup declarations. .---. .'_:___". |__ --==| [ ] :[| |__| I=[| / / ____| |-/.____.' ...
#include "timer.hpp" #include "object.hpp" #include "event.hpp" namespace GameEngine { Timer::Timer(void) { mNode.key = 0; mEvent = Event::sDummy; mEventLoop = &EventLoop::sMain; mPool = NULL; } Timer::Timer(tick_t tick, EventLoop *eventLoop, Event *event) { mNode.key = tick; mEventLoop = e...
#include <iostream> #include <queue> #include <list> #include <cstdio> using namespace std; int main ( int argc , char * argv[] ) { int t; list<int> node[61]; int m[61][61]; cin >> t; getchar(); while ( t-- ) { char ch; int n = 0; node[0].clear(); while ( (ch = getchar()) != '\n' ) { n++; ...
// distance.cpp // increment counter variable with ++ operator // uses unnamed temporary object #include <iostream> using namespace std; #include "distance.h" //Display as 2'-9" format void Distance::ShowDist() const { std::cout << feet() << "\'- " << inches() << "\"" << std::endl; } // Create operator to combine...
#ifndef GEOMETRYVIEWPROVIDER_H_ #define GEOMETRYVIEWPROVIDER_H_ #include <QObject> #include <QPair> #include <QHash> #include "moduleBase/ModuleType.h" class vtkActor; class vtkPolyData; namespace GUI { class MainWindow; } namespace Geometry { class GeometryData; class GeometrySet; class GeometryDatum; } nam...
// GetAngle.cpp : 实现文件 // #include "stdafx.h" #include "ImageProcessing.h" #include "GetAngle.h" #include "afxdialogex.h" // CGetAngle 对话框 IMPLEMENT_DYNAMIC(CGetAngle, CDialog) CGetAngle::CGetAngle(CWnd* pParent /*=NULL*/) : CDialog(CGetAngle::IDD, pParent) , angle(0) { } CGetAngle::~CGetAngle() { } void CGet...
#ifndef CALCULATION_H #define CALCULATION_H #include "ssFrameLib.h" #include <vector> using namespace std; /* * this header file contain the device id and calculate the point coordinate * function. */ const unsigned char RFANS_PRODUCT_MODEL_V6G_X16_0X32 = 0X32; const unsigned char RFANS_PRODUCT_MODEL_V6G_X32_0X33 = 0X3...
/* * UDPConnection.hpp * * Created on: 13 Jun 2018 * Author: Thomas Maters * Email : thomasmaters@hotmail.com (TG.Maters@student.han.nl) */ #ifndef SRC_UDPCONNECTION_HPP_ #define SRC_UDPCONNECTION_HPP_ #include "../../Messages/SensorMessage.hpp" #include "../ConnectionInterface.hpp" #inclu...
#include <stdio.h> long long next_val(long long prev_val) { long long div = 4294967296; return (prev_val * 214013 + 2531011) % div; } int l2i(long long prev_val) { return (int)(prev_val % 10000 + 1); } int main() { int c; scanf("%d",&c); while(c--) { int k,n; int f = 0; int r = 0; long long f_value =...
#pragma once template <class T> class LLQueue { private: struct Node { T data; Node *next; Node(const T &data) : data(data), next(nullptr) {} }; Node *Front; Node *Rear; int count; public: LLQueue(); LLQueue(const LLQueue<T> &); ~LLQueue(); const LLQueue<T> &operator=(const LLQueue<T> &); //Capacity...
// -*- C++ -*- #include "ImageAnalyzer.hh" #include <fstream> #include <iostream> #include <opencv2/dnn.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/highgui.hpp> namespace { const std::string& class_name("ImageAnalyzer"); } //______________________________________________________________________________...
// // Created by phith on 25.06.2021. // #ifndef TESTPROJEKT_TEST_H #define TESTPROJEKT_TEST_H class Test { public: char testchar = 'a'; }; #endif //TESTPROJEKT_TEST_H
#ifndef EFECTO_COLISION_I_H #define EFECTO_COLISION_I_H #include "objeto_juego_i.h" #include "espaciable.h" #include "efecto_colision_recogedor_i.h" namespace App_Interfaces { class Efecto_colision_I: public virtual Objeto_juego_I { public: ~Efecto_colision_I(); virtual void efecto_colision(App_Interfaces::E...
#include <iostream> #include <cassert> #include "AVLTree.h" using namespace std; int main() { int commandCount = 0; std::cin >> commandCount; assert( commandCount >= 0 ); AVLTree<int> tree{}; while (commandCount--){ int command = 0, value = 0; cin >> command >> value; s...
#pragma once #include <Windows.h> #include "logging.h" extern "C" { BOOL WINAPI ctrlHandler(DWORD ctrlType); } namespace RemoteGamepad { class StateManager { public: static StateManager& instance() { static StateManager manager{}; return manager; } ...
// // Created by vybirto1 on 15.3.18. // #ifndef ROGUE_CSDLCOLOR_H #define ROGUE_CSDLCOLOR_H #include <cstdint> class CSDLColor { public: static CSDLColor BLACK; static CSDLColor WHITE; CSDLColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a); CSDLColor(const CSDLColor &a); uint8_t getR() const;...
#include "Printer.h" Printer::Printer(const char* text, size_t n, const char* pat, size_t m): text(text), n(n), pat(pat), m(m) {} /* * Acrescenta a ocorrência que se inicia em 'matchingStart' na linha correspondente */ void Printer::addMatching(int matchingStart) { int lineSt = matchingStart, lineEnd = matchingStart...
// Copyright Epic Games, Inc. All Rights Reserved. /*=========================================================================== Generated code exported from UnrealHeaderTool. DO NOT modify this manually! Edit the corresponding .h files instead! ========================================================================...
#include "Global.h" #define MAX_LINE_SIZE 5000 int main(int argc, char*argv[]) { int S = atoi(argv[1]); int N,K; cin >> N >> K ; cerr << N << " " << K <<endl; string line; getline(cin, line); // clears the endl at the first line string *LinesSampled = new string [S]; srand48(1973); for (int ...
/** * @file UsbTypes.h * @author Lukas Schuller * @date Tue Nov 5 21:40:55 2013 * * @brief * */ #ifndef USBTYPES_H #define USBTYPES_H #include <libusb.h> #include <system_error> #include <memory> namespace Usb { // typedef std::shared_ptr<libusb_transfer> TransferPtr; typedef libusb_transfe...
#pragma once #include "Command.h" class PlayerInfoCommand : public Command { public: PlayerInfoCommand(); ~PlayerInfoCommand(); void Run(list<string>* parameters, Game * game); };
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "UObject/NoExportTypes.h" #include "Interfaces/PlayerPawnState.h" #include "Pawns/PlayerPawn.h" #include "TimerManager.h" #include "PPState_ROLL.generated.h" /** * */ UCLASS() class RPG_AP...
#include <iostream> #include <PCANBasic.h> #include <ros/ros.h> //Vehicle Information Msg #include "vehicle_msgs/abs.h" #include "vehicle_msgs/esc.h" //ioniq chassis const std::string topic_abs= "abs"; const std::string topic_esc = "esc"; #define Can PCAN_USBBUS2 const double scale_factor = 0.03125; int main(int ar...
#pragma once #include <core/document/DocumentModel.hpp> #include <Scenario/Document/Constraint/Slot.hpp> #include <Scenario/Document/TimeNode/Trigger/TriggerModel.hpp> #include <Scenario/Document/ScenarioDocument/ScenarioDocumentModel.hpp> #include <Scenario/Document/State/ItemModel/MessageItemModel.hpp> #include <Scen...
#include<iostream> #include<vector> #include<chrono> using namespace std; int64_t simpleSolver(int64_t N, int64_t e1, int64_t e2){ int64_t sum = 0; int64_t e3 = e1 * e2; for (int64_t e = e1; e < N; e += e1) sum += e; for (int64_t e = e2; e < N; e += e2) sum += e; for (int64_t e = e3; e < N; e += e3) sum -= ...
/*********************************************************************** * created: 11/6/2011 * author: Martin Preisler *************************************************************************/ /*************************************************************************** * Copyright (C) 2004 - 2011 P...
// // sceneManager.cpp // led_matrix // // Created by Alex on 17.11.15. // // #include "ofMain.h" #include "scenes.h" #include "sceneManager.h" void sceneManager::setup(){ currentScene = 0; intro.setup(); mirror.setup(); sceneChange = false; scenes.push_back(&intro); sce...
/* ASSIGNMENT 4 - COEN 244 Jean-Baptiste WARING 40054925 FAROUQ HAMEDALLAH 40087448 HOSPITAL MANAGEMENT SYSTEM */ #include "./account.h" using namespace std; Account::Account(){ balance = 0; } Account::Account(double t){ balance = t; } void Account::pay_amount(double a){ balance = balance - a; } void Ac...
#pragma once #include <algorithm> using namespace std; template <typename T> class stack { private: int* array; int capacity; int top; public: stack(int stackcapacity); void push(T item); void pop(); T& Top(); void ChangeSize1D(T*&, const int, const int); bool isEmpty(); }; template <typename T> void stack<T...
#include "../Include/Factory_Line.h" #include "../Include/Botton.h" #include "../Include/Line.h" #include "../Include/PainterForLine.h" #include "../Include/StorerForLine.h" Factory_Line::Factory_Line() { id = 7; } Botton * Factory_Line::generateBotton() { Botton* tmp = new Botton; tmp = new Botton; tmp->setSize(...
#include <gtest/gtest.h> #include <ostream> #include <istream> #include <sstream> #include <vector> #include <tags/tagmanager.h> #include <tags/tag.h> TEST(tag_test, can_add_elements) { const std::vector<core::UID> element_ids { core::UID::generateRandom(), core::UID::generateRandom(), core::UID::gen...
// Copyright (c) 2015 University of Szeged. // Copyright (c) 2015 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 "sprocket/browser/ui/window.h" #include "base/android/jni_string.h" #include "content/public/...
#include <iostream> #include <sstream> using namespace std; int main () { string name = "Varun Ramani"; int age = 15; /* If I need to concatnate name and age, this: name + age does not work, since age and name are two different types. I can add together two strings l...
#include "MissionImpossible/ad.hpp" #include "MissionImpossible/derivatives.hpp" #include <gtest/gtest.h> #include <vector> using namespace MissionImpossible; TEST(Nested, Rosenbrock) { AD<AD<double>> x0(3), x1(4), y; y = (1 - x0) * (1 - x0) + 10 * (x1 - x0 * x0) * (x1 - x0 * x0); // remark: y[x0] type i...
#pragma once #include "Characters.h" #include <string> using namespace std; /* Özet: S?n?f olu?turulurken yerine koyulacak alfabe küçük harflere kar??l?k gelmektedir. Örnek yerine koyulan alfabe a?a??dad?r ve Program?n Türkçe format?na uygun olacak biçimde kay?t edilmi?tir.*/ class YerineKoyma : public Characters ...
#ifndef STICKUINO_COMPONENTS_LIGHTSENSOR_H #define STICKUINO_COMPONENTS_LIGHTSENSOR_H #include "Component.h" namespace Stickuino { namespace Components { /// <summary> /// A light sensor. /// </summary> class LightSensor : public Component { public: /// <summary> /// Creates a new LightSensor. ///...
// This file is subject to the terms and conditions defined in 'LICENSE' in the source code package #ifndef JACTORIO_INCLUDE_PROTO_ABSTRACT_HEALTH_ENTITY_H #define JACTORIO_INCLUDE_PROTO_ABSTRACT_HEALTH_ENTITY_H #pragma once #include "proto/abstract/entity.h" namespace jactorio::proto { struct HealthEntityData :...
/* Copyright (c) 2005-2023, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in source and binary forms...
#include "sdw_file.h" #include "sdw_string.h" #if !defined(__ANDROID__) void fu16printf(FILE* a_pFile, const wchar_t* a_szFormat, ...) { va_list vaList; va_start(vaList, a_szFormat); wstring sFormatted = FormatV(a_szFormat, vaList); va_end(vaList); U16String sString = WToU16(sFormatted); fwrite(sString.c_str(), ...
#include <windows.h> #include <fstream> #include <stdio.h> #include <ctime> #include "detours.h" #include "wrapper.h" #include "IFPLoader.h" #pragma comment(lib, "detours.lib") void PrepareOutputStreams(); inline bool isKeyPressed(unsigned int keyCode); extern std::ofstream ofs; extern std::wofstream ofsW; std::m...
#ifndef DIALOGCREATEPOINT_H_ #define DIALOGCREATEPOINT_H_ #include "geoDialogBase.h" namespace Ui { class CreatePoint; } namespace GeometryWidget { class GeoPointWidget; class GEOMETRYWIDGETSAPI CreatePointDialog : public GeoDialogBase { Q_OBJECT public: CreatePointDialog(GUI::MainWindow* m, MainWidget::P...
#include "Config.hpp" #include "ConfigImpl.hpp" #include <memory> namespace engine { Config& Config::GetInstance() { static ConfigImpl config; return config; } } // namespace engine
#ifndef RESOURCESSYSTEM_H_ #define RESOURCESSYSTEM_H_ #include"../Defs.h" #include "../Game loaders/model.h" class PhysicsSystem; class ResourcesSystem { friend class Scene; friend class RenderingSystem; friend class MovementSystem; Model** models; Shader* ModelShader; Shader* lightingShader; public: Resourc...
#include "stdafx.h" #include "RestCommand.h" RestCommand::RestCommand() { } RestCommand::~RestCommand() { } void RestCommand::Run(list<string>* parameters, Game * game) { Player* p = game->getPlayer(); if (p->getCurrentHealth() < p->getTotalHealth()) { int chance = 20; int randomEnemy = rnd.generateInt(0, 10...
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <cstring> #include <queue> #include <sstream> #include <cmath> #include <unordered_set> using namespace std; struct UndirectedGraphNode { int label; vector<struct UndirectedGraphNode *> neighbors; UndirectedGraphNode(int...
// ConsoleApplication1.cpp : 定义控制台应用程序的入口点。 // inv_link6逆解函数 pose_initial_goal 插补函数 #include <math.h> #include "stdafx.h" #include <iostream> #include <Eigen/Dense> #include<ctime> #include<vector> #include"interpolation_quater.h" #include "IK_group.h" //#include"RRT.h" using namespace Eigen; using namespace st...
#include<iostream> #include<cmath> double deg_func(int n, int k) { double res = 0; for(int i = 1; i <= n; ++i) { res += pow(i, k); } return res; } int main() { int n; int k; std :: cin >> n; std :: cin >> k; std :: cout << '\n' << deg_func(n, k); }
#include <gtest/gtest.h> #include <vector> #include <deus/unicode_view_impl/EncodingImpl.hpp> //------------------------------------------------------------------------------ // FIXTURE //------------------------------------------------------------------------------ class ASCIIFi...
#ifndef SHS2605_AUTONOMOUSBEHAVIOR_H #define SHS2605_AUTONOMOUSBEHAVIOR_H #include <Behaviors/IBehavior.h> #include <Actions/ActionController.h> #include <Hardware/Drive/MecanumDriveTrain.h> #include <Hardware/Drive/IQuadRectangularDriveBase.h> #include <Sensing/IAngularInput.h> #include "AutonomousActions/TurnActi...
#include<stdio.h> int main() { char zimu; for (zimu = 'a'; zimu <= 'z'; zimu++) printf("%3d\n", zimu); }
#pragma once #include <boostGraphCFG.h> #include "rose.h" #include <vector> #include <set> #include <map> #include <iterator> #include <boost/foreach.hpp> #include <boost/graph/adjacency_list.hpp> #include <boost/graph/topological_sort.hpp> namespace ssa_private { using namespace std; using namespace boost; ...
#pragma once #include <iostream> #include "Customer.h" #include "Video.h" using namespace std; class Link { public: void SettingHead(Customer* cHead,Video *vHead); };
// // Copyright Jason Rice 2017 // 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) // #ifndef NBDL_WEBSOCKET_DETAIL_MESSAGE_SENDER_HPP #define NBDL_WEBSOCKET_DETAIL_MESSAGE_SENDER_HPP #include <nbdl/promise.hpp> #...
/* * Copyright (C) 2018-2019 wuuhii. All rights reserved. * * The file is encoding with utf-8 (with BOM). It is a part of QtSwissArmyKnife * project. The project is a open source project, you can get the source from: * https://github.com/wuuhii/QtSwissArmyKnife * https://gitee.com/wuuhii/QtSwissArmyKnife...
#include "ofApp.h" // for time stamps #include <ctime> using namespace ofxCv; using namespace cv; void ofApp::setup() { // init shaders //shader.load("shadersES2/mix-shader"); #ifdef TARGET_OPENGLES shader.load("shadersES2/mix-shader"); #else if (ofIsGLProgrammableRenderer()) { shader.load("shadersGL3/mix-...
#include <iostream> #include <cstring> using namespace std; string love = "I love that "; string hate = "I hate that "; string love_end = "I love it"; string hate_end = "I hate it"; int main(int argc, char *argv[]) { int n; cin >> n; string result; for (int i = 1; i <= n; i++){ if (i == n){ if (i & 1) resul...
#include <bits/stdc++.h> using namespace std; void rvereseArray(int arr[], int start, int end) { while (start < end) { int temp = arr[start]; arr[start] = arr[end]; arr[end] = temp; start++; end--; } } int main() { int arr[] = {1, 2, 3, 4, 5, 6}; int n = sizeof(arr) / sizeof(arr[0]); cout<<"o...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.Devices.Scanners.1.h" WINRT_EXPORT namespace winrt { namespace ABI::Windows::Foundation::Collections { #ifndef WINRT_GENERIC_80646519_5e2a_595d_a8cd_2a24b4067f1b #define WI...
#include <string> typedef enum { typeCon, typeId, typeOpr } nodeEnum; /*constant, identifier, or operation*/ /* constants */ typedef struct { int value; /* value of constant */ } conNodeType; /* identifiers */ typedef struct { int i; /* subscript to sym array */ } idNodeT...
#include<string> #include<sstream> #pragma once using namespace std; class Property { public: Property::Property(bool rental, int value, string address); ~Property(); bool getRental(); int getValue(); string getAddress(); virtual double getTax(); int getID() const; virtual string toString(); int ID = 0; p...
//tic tac toe implementation file #include <iostream> #include <iomanip> #include "ticTacToe.h" #include <string> using namespace std; int PLAYER1WINS = 0; int PLAYER2WINS = 0; double PLAYER1KDRAT = 0.00; double PLAYER2KDRAT = 0.00; void ticTacToe::play() { bool done = false; char player1 = ' '; ...
#include "register_types.h" #if defined(__APPLE__) #include "ios/LocalNotification.h" #endif void register_localnotification_types() { #if defined(__APPLE__) ClassDB::register_class<GodotLocalNotification>(); #endif } void unregister_localnotification_types() { }
#include <algorithm> #include <iostream> #include <vector> #define LL long long #define MOD 1000000007 using namespace std; struct Matrix { int n, m; LL a[51][51]; Matrix (int n, int m, LL init) { this->n = n; this->m = m; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { a[i][j] = init; ...
#include <iostream> using namespace std; void Qsort(int a[],int low,int high) { if(low>=high) return; int first=low; int last=high; int k=a[first]; while (first<last) { while (first<last&&a[last]>=k) last--; a[first]=a[last]; whil...
#include<bits/stdc++.h> using namespace std; struct SegmentTree{ int s,e; int val; int lazy = 0; SegmentTree *l,*r; int init(int *a, int start, int end){ s = start; e = end; if(s!=e){ l = new SegmentTree; r = new SegmentTree; return val = (l->init(a,s,(s+e)/2))^(r->init(a,(s+e)/2+1,e));...
// // Item.h // Boids // // Created by chenyanjie on 4/27/15. // // #ifndef __Boids__Item__ #define __Boids__Item__ #include "spine/spine-cocos2dx.h" typedef enum { ItemStateFly = 1, ItemStateReady = 2, ItemStateDisappear = 3 }eItemState; class Item : public cocos2d::Ref { private: int _item_id; ...