text
stringlengths
8
6.88M
// http://www.esp8266learning.com/esp8266-lm75-temperature-sensor-example.php // https://github.com/jlz3008/lm75 // I set device address to 0 soldering these pins (see above picture): // 1. A0 and GND together. // 2. A1 and GND together. // 3. A2 and GND together. // After soldering all three pins - A0 , A1 and A2 t...
# include<iostream> using namespace std; float taghsim(float,float[],float[],int,int,float); void sort(float[],float[],float[],int); int main(){ int n; float W; cout<<"please enter total weight "<<"\n"; cin>>W; cout<<"please enter number of items "<<"\n"; cin>>n; float w[n]; float p[n]; int i; for(i=0;i<n;i++...
/* * UDPTransportStreamer.cpp * * Created on: 5 Apr 2011 * Author: two */ #include "UDPTransportStreamer.h" UDPTransportStreamer::UDPTransportStreamer() { // TODO Auto-generated constructor stub } UDPTransportStreamer::UDPTransportStreamer(struct sockaddr_in addr, int fdSocket, socklen_t fromLen) { m_C...
#include <iostream> #include <math.h> #include "TerrainRenderer.h" #include "Keyboard.h" #include "GL.h" TerrainRenderer::TerrainRenderer() { terrainShader.addShader("shaders/terrain.vert", GL_VERTEX_SHADER); terrainShader.addShader("shaders/terrain.tcs", GL_TESS_CONTROL_SHADER); terrainShader.addSha...
 /* 题目描述 请实现一个函数用来匹配包括'.'和'*'的正则表达式。模式中的字符'.'表示任意一个字符,而'*'表示它前面的字符可以出现任意次(包含0次)。 在本题中,匹配是指字符串的所有字符匹配整个模式。例如,字符串"aaa"与模式"a.a"和"ab*ac*a"匹配,但是与"aa.a"和"ab*a"均不匹配 */ #include<iostream> using namespace std; #include<vector> #include<string> /* 请实现一个函数用来匹配包括'.'和'*'的正则表达式。模式中的字符'.'表示任意一个字符,而'*'表示它前面的字符可以出现任意次(包含0次)。 在本题中,...
#include <algorithm> #include <fstream> #include <set> #include <vector> extern "C" { #include "nebstructs.h" #include "nebcallbacks.h" #include "nebmodules.h" #include "nebmods.h" #include "broker.h" #ifdef HAVE_ICINGA #include "icinga.h" #else #include "nagios.h" #endif } #include "cereal/cereal.hpp" #include "cere...
#include "Event.h" #include <string> #include <iostream> using namespace std; Event::Event(int _time, int _place, Passenger* _passenger){ this->time = _time; this->place = _place; this->passenger = _passenger; }
#ifndef DISPLAY_DEVICE_MANAGER_H #define DISPLAY_DEVICE_MANAGER_H #include <string> class DisplayDeviceManager { static DisplayDeviceManager displayManager; public: DisplayDeviceManager() {} static DisplayDeviceManager* getDisplayManager() { return &displayManager; } int SetDisplayState(bool turnON = true);...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int n, m; cin >> n >> m; vector<int> x(m), y(m-1); for(int i=0; i<m; i++) cin >> x[i]; sort(x.begin(), x.end()); for(int i=1; i<m; i++) y[i-1] = x[i] - x[i-1]; sort(y.begin(), y.end()); int las...
#pragma once #include <ionir/passes/pass.h> namespace ionir { struct DeadCodeEliminationPass : public Pass { IONSHARED_PASS_ID; explicit DeadCodeEliminationPass( ionshared::Ptr<ionshared::PassContext> context ); void visitBasicBlock(ionshared::Ptr<BasicBlock> node) ov...
// Copyright (c) 2014-2015 Dropbox, Inc. // // 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 agr...
/* * Copyright(c) 2018 WindSoul Network Technology, Inc. All rights reserved. */ /** * Desc: Module初始化的工具类。应对联机模式下客户端和服务端初始化差异问题 * Author: * Date: 2019-04-05 * Time: 16:55 */ #pragma once #include "Engine/World.h" #include "Constants/EnumDefine.h" #include "Unreal/Module/ModuleListManager.hpp" #include "Unreal/Cha...
#pragma once class GameCursor; enum MonsterID; class ShowMonsters : public GameObject { public: bool Start() override; void Update() override; void OnDestroy() override; void SetWindowActive(bool active) { m_isActive = active; } private: void InitFont(); void InitButtons(); void InitSideButtons(); void Butt...
#include <bits/stdc++.h> #define REP(i, a, b) for(int i = (int)a; i < (int)b; i++) #define fastio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define pb push_back #define mp make_pair #define st first #define nd second #define vi vector<int> #define ii pair<int, int> #define ll long long int #define MAX 20001...
#include <stdio.h> #include <conio.h> void start(); void showRectangular(); void showSquare(); void showDiagonal(); void showScalarDiagonal(); void showUnitary(); void showAddition(); void showSubtraction(); void showScalarMultiplication(); void showMultiplication(); void showTranspose(); void showSymetric(); void sho...
#define WIFI_RECONNECT_WAIT 20000 // in milliSeconds #define WIFI_AP_OFF_TIMER_DURATION 60000 // in milliSeconds #define WIFI_CONNECTION_CONSIDERED_STABLE 300000 // in milliSeconds #define WIFI_ALLOW_AP_AFTERBOOT_PERIOD 5 // in minutes #include "src/Globals/ESPEasyWiFiEvent.h" // **...
#include <iostream> #include <stdio.h> #include <cstdlib> #include <unistd.h> #include <time.h> #include <string.h> #include <string> #include <sstream> #include <vector> #include "ros/ros.h" #include "image_transport/image_transport.h" #include "cv_bridge/cv_bridge.h" #include "sensor_msgs/image_encodings.h" #include...
#include "qn_optimizer/qn_optimizer.h" #include <iostream> // TUNABLE PARAMETERS const double min_a = -4.75; const double min_b = 2.0; const double initial_guess_a = 0.0; const double initial_guess_b = 0.0; double objective_function(const Eigen::VectorXd& variables) { return std::pow(variables(0) - min_a, 2.0) +...
/* * Copyright (C) 2013 Tom Wong. All rights reserved. */ #include "gtdocnote.h" #include "gtdocmessage.pb.h" #include "gtserialize.h" #include <QtCore/QDebug> GT_BEGIN_NAMESPACE GtDocNote::GtDocNote(NoteType type, const GtDocRange &range) : m_type(type) , m_range(range) { Q_ASSERT(isValid()); } GtDocN...
/* Q. Create class MyString which contains character pointer (use new operator) Write a C++ program to overload following operators 1. To change case of each alphabet from given string 2. To print characte present at specified index */ #include<iostream> #include<stdlib.h> #include<string.h> #include<ct...
/************************************************************************/ /* 字符串移动(字符串为*号和 26 个字母的任意组合,把*号都移动到最左侧,把 字母移到最右侧并保持相对顺序不变),要求时间和空间复杂度最小 */ /************************************************************************/ #include <iostream> #include <string> #include <algorithm> using namespac...
#include "Bank.h" // Lalalalalalalalala
#include "Item.h" Item::Item() { } void Item::Update() { } void Item::Draw() { } Item::~Item() { }
#define BREADBOARD //#define BUILD_ONE // master bedroom //#define BUILD_TWO // gameroom // breadboard with a wemos, and nothing else //#define WEMOS /* * module is a WeMos D1 R1 * flash size set to 4M (1M SPIFFS) or 4MB (FS:1MB OTA:~1019KB) (latest esp board sw uses this) * OR * module is a esp12e * flash ...
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved. #include "AnimationTestGameModeBase.h"
#pragma once #include <iberbar/Base/Platform.h> namespace iberbar { class CFpsTick { public: void update( int64 nElapsedTime ) { m_iFrameCount ++; m_fFpsTimeSlice += nElapsedTime; // if ( m_iFrameCount == 5 ) // { // float lc_fFpsTimeCur = GetElapseTimeS(); // m_fFpsTimeSlice = lc_fFp...
#include "integration.hpp" #include <cmath> #include "../datastructures/multi_tree_view.hpp" #include "bases.hpp" #include "gmock/gmock.h" #include "gtest/gtest.h" using datastructures::static_for; namespace Time { TEST(Integration, Monomials) { Bases B; B.elem_tree.UniformRefine(4); static_for<10>([&](auto ...
#include <iostream> #include <sstream> #include <string> #include <vector> #include <cstring> #include <limits.h> #include <pwd.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include "util.h" namespace util { using namespace std; vector<string> argv_to_strvec(int count, char** const argv...
#ifndef VECTOR_H #define VECTOR_H namespace phys { class Vector { public: Vector(); Vector(double x, double y, double z); double getX() const; double getY() const; double getZ() const; Vector sign(); Vector operator+ (Vector rhs); Vector operator- (Vector rhs); Vector operator* (Vec...
// Created on: 1994-01-10 // Created by: Yves FRICAUD // Copyright (c) 1994-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 GNU L...
#include "employee.h" void Employee::setOffice(string str) { switch(str[0]) { case '0': office_ = "Millwright"; break; case '1': office_ = "Electronics"; break; case '2': office_ = "Developer"; break; default: office_ = "NO OFFICE"; ...
/* * @Fichier : classControl.h * @Auteur : Adam Martineau * @Date : 1/dec/2018 * @Bref : librairie pour controler et intéragire avec le robot * @Environnement : PlatformIO (visual studio code) * @Compilateur : c++ * @Matériel : arduino mega * @Revision : v2 */ //INCLUDES #include <LibRobus.h> #include <avr/e...
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); ...
#include <stdio.h> #include <string.h> #include <iostream> #include <sstream> #include "aruco.h" #include "math.h" #include "cvdrawingutils.h" #include <opencv2/opencv.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/highgui/highgui.hpp> //#define CAMERA_NUM 1 using namespace cv; using namespace std; usi...
#include <iostream> using namespace std; int main(void) { // 01 auto func = []() { cout << "Hello World 01" << endl; }; func(); // 02 []() { cout << "Hello World 02" << endl; }(); // 03 [](int i, int j) { cout << "Hello World 03 : i + j = " << i + j << end...
#include <iostream> #define MAX 100001 using namespace std; int n; int matrix[MAX]; int sums[MAX]; // 시간복잡도 n^2 void noDp(){ int ret = 0; for(int i = 0; i < n; i++){ int sum = 0; for(int j = i; j < n; j++){ sum += matrix[j]; if(ret < sum){ ret = sum; ...
/* * TApplication.h * * Created on: Apr 11, 2017 * Author: Alex */ #ifndef TAPPLICATION_H_ #define TAPPLICATION_H_ #include <app.h> #include <Elementary.h> #include <system_settings.h> #include <efl_extension.h> #include <dlog.h> #ifdef LOG_TAG #undef LOG_TAG #endif #define LOG_TAG "colorlines" #if !de...
#include "NeuroNet.h" #include <random> #include <fstream> NeuroNet::NeuroNet() { input_nodes = 0; hidden_nodes = 0; output_nodes = 0; training_rate = 0.0; } NeuroNet::NeuroNet(int input_nodes, int hidden_nodes, int output_nodes, double training_rate) { this->input_nodes = input_nodes; this->hidden_nodes = hid...
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved. #pragma once #include "Core.h" #include "UnrealTournament.h" #include "AllowWindowsPlatformTypes.h" #include <mmdeviceapi.h> #include <audioclient.h> #include "LetMeTakeASelfie.generated.h" UCLASS(Blueprintable, Meta = (ChildCanTick)) class ALetMeTakeASel...
/* URL to Check the Data on Cloud using sylvesterf as Author and Channel ID 223662 https://thingspeak.com/channels/223662 */ #define TINY_GSM_MODEM_SIM800 #include <TinyGsmClient.h> ...
/////////////////////////////////////// // // Computer Graphics TSBK03 // Conrad Wahlén - conwa099 // /////////////////////////////////////// #include "Program.h" #include "GL_utilities.h" #include <iostream> Program::Program() { // Set all pointers to null screen = NULL; glcontext = NULL; cam = NULL; // W...
#ifndef __IGDRAWING_H__ #define __IGDRAWING_H__ #include "igWidget.h" #include <SFML/Graphics.hpp> const igButton& DrawButton(const igButton& button); const igCheckbox& DrawCheckbox(const igCheckbox& checkbox, sf::Texture& thickTexture); const igTextbox& DrawTextbox(const igTextbox& textbox); const igLabel& DrawLa...
// Created on: 1992-02-04 // Created by: Christian CAILLET // 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 "model.h" Model::Model() : m_leg(1.0), h_in(1.0), h_out(1.0) { } Model::~Model() { } /** * @brief Model::updateOscillator * @param state * @param dt */ void Model::updateOscillator(const State &state, const double &dt) { // Update our neural oscillator with the current state variables and the elapse...
#include "precompiled.h" #include "skybox/jsskybox.h" #include "skybox/skybox.h" #include "script/script.h" namespace jsskybox { JSBool jsreset(JSContext *cx, uintN argc, jsval* vp); } void jsskybox::init() { script::gScriptEngine->AddFunction("system.render.skybox.reset", 0, jsskybox::jsreset); } JSBool jsskybox:...
#include "conflict_battle_records.hpp" #include "config/options_ptts.hpp" #include <limits> namespace nora { namespace scene { conflict_battle_records::conflict_battle_records() { auto ptt = PTTS_GET_COPY(options, 1u); gamedb_ = make_shared<db:...
#pragma once #include "cDistrict.h" class cAssetDistrict : public cDistrict { public: cAssetDistrict(); virtual ~cAssetDistrict(); // begin of iDistrict virtual bool Actioon(); // end of iDistrict // begin of cAssetDistrict virtual bool SetSold(); virtual bool SetOwner(); virtual unsigned int GetPrice(); ...
//Phoenix_RK /* https://leetcode.com/problems/unique-paths-ii/ Example 1: Input: [ [0,0,0], [0,1,0], [0,0,0] ] Output: 2 Explanation: There is one obstacle in the middle of the 3x3 grid above. There are two ways to reach the bottom-right corner: 1. Right -> Right -> Down -> Down 2. Down -> Down -> Right -> R...
//************************************************************************** // File......... : VRHostController.cpp // Project...... : VR // Author....... : Liu Zhi // Date......... : 2018-11 // Description.. : Implementation file of th...
#include "../stdafx.hpp" #include "WinTerm.hpp" #ifndef MOUSE_WHEELED static const ::DWORD MOUSE_WHEELED = 4; #endif // MOUSE_WHEELED #ifndef MOUSE_HWHEELED static const ::DWORD MOUSE_HWHEELED = 8; #endif // MOUSE_HWHEELED static const ::DWORD SCRIPT_MODE_TRUE_TYPE_FONT = 9; static const ::DWORD BOX_DRAWING_RASTER_...
#include "node.h" #include "codegen.h" #include "parser.hpp" #include <string> using namespace std; static LLVMContext TheContext; static IRBuilder<> Builder(TheContext); static Function* mainFunc; static vector< pair <llvm::Type *,string > > pscVec; int curLang ; /* Compile the AST into a module */ void CodeGenC...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "OnlineSessionSettings.h" #include "Engine/GameInstance.h" #include "MenuSystem/MenuInterface.h" #include "Interfaces/OnlineSessionInterface.h" #include "OnlineSubsystem.h" #include "COOP_Ga...
#include "Firebase_Client_Version.h" #if !FIREBASE_CLIENT_VERSION_CHECK(40319) #error "Mixed versions compilation." #endif /** * Google's Firebase QueryFilter class, QueryFilter.h version 1.0.7 * * This library supports Espressif ESP8266 and ESP32 * * Created December 19, 2022 * * This work is a par...
void someFunc() { const char p[] = R"(a\ b c)"; }
/** * @file valknut/core/internal/integral_types.hpp * * @brief This internal header declares fixed size integral types * * @note This is an internal header file, included by other library headers. * Do not attempt to use it directly. */ #ifndef VALKNUT_CORE_INTERNAL_INTEGRAL_TYPES_HPP_ #define VA...
#include "Brain.hpp" #include <iomanip> const std::string Brain::identify(void) const { std::stringstream stream_ptr; const Brain *brain_ptr = this; const void *ptr_adr = static_cast<const void*>(this); stream_ptr << "0x" << std::uppercase << std::hex << (long long)(ptr_adr); return (stream_ptr.str()); } void...
#include "VampireState.h" VampireState::VampireState(const std::string& name, int health, int damage, bool isUndead) : UnitState (name, health, health, damage, isUndead) { std::cout << " creating VampireState " << std::endl; } VampireState::~VampireState() { std::cout << " deleting VampireState " << std::endl...
/* GT_EXTERNAL_LEGEND(2010) */ #ifndef GEN_KILL_TRANSFORMER_GUARD #define GEN_KILL_TRANSFORMER_GUARD 1 #include <iostream> #include <climits> #include <cassert> #include "wali/SemElem.hpp" /*! * @class GenKillTransformer_T * * GenKillTransformer_T is a templated class that implements the semiring * needed for a...
#ifndef ZOMBIE_HPP # define ZOMBIE_HPP # include <string> # include <iostream> class Zombie { private: std::string name_; std::string type_; Zombie(); public: Zombie(const std::string &name, const std::string &type); ~Zombie(); void set_name(const std::string &new_name); void announce(void) const; }; ...
/* * main.cpp * * Created on: Apr 1, 2015 * Author: eddy */ #include <iostream> #include <ncurses.h> #include "Game.h" //testing only #include "Window.h" int main(void){ // initscr(); // refresh(); // Window win; // win.create("test", 'x', 5, 9, 3, 35); // win.print_number(2); // getch(); // endwin(); ...
SRC_URI += "file://add-subdir-objects-option.patch" libslp-location-dev_files += "${prefix}/lib/lib*.so"
#include <fstream> #include <string> #include <set> #include <vector> #include <assert.h> #include <windows.h> #include "../Md5Utils/Md5Utils.h" void ScanFiles(const std::string& dir, std::set<std::string>& names) { WIN32_FIND_DATAA finddata; std::string searchstring = dir + "*"; HANDLE hfine = FindFirstFi...
#include "stdafx.h" #include "CAct_Dist.h" #include "../../Monster.h" #include "../ACTEffect.h" #include "../../../GameData.h" void CAct_Dist::Fire(Monster* me, Monster* target, const wchar_t* effectPath, const wchar_t* soundPath, float range, float baseDamage, CVector3 effectScale) { RotateToTarget(me, target); ...
#include <iostream> #include <functional> #include <map> #include <iterator> #include <any> #include <string> #include <vector> #include "CPPO.h" using namespace std; // CPPO implementation vector<string> nusstudios::core::mapping::strsplit(string s, string delimiter) { vector<string> result = {}; size_t pos...
#ifndef PERSPECTIVE_CUBE_HPP_ #define PERSPECTIVE_CUBE_HPP_ #include <string> namespace perspective_cube { extern const std::string module_name; int run(int argc, char **argv); } #endif // PERSPECTIVE_CUBE_HPP_
#include<fstream> #include<iostream> #include<stdexcept> using namespace std; void funcOne() throw(exception); void funcTwo() throw(exception); int main(int argc,char** argv) { try { funcOne(); } catch(exception& e) { cerr<<"Exception caught!\n"; exit(1); } return (0); } ...
/**************************************************************************************** * Copyright (c) 2010 www.projectiris.co.uk * * Michael Boyd <mb109@doc.ic.ac.uk>, Dragos Carmaciu <dc2309@doc.ic.ac.uk>, * * Francis Giannaros <kg109@doc.ic.ac.uk>, Thomas ...
#include<iostream> #include <torch/nn/module.h> #include <torch/nn/modules/linear.h> struct TestModuleImpl : public torch::nn::Cloneable<TestModuleImpl> { using torch::nn::Module::register_module; torch::nn::Linear l1{nullptr}, l2{nullptr}, l3{nullptr}; #if 0 TestModuleImpl() : l1(register_module("l1", t...
#ifndef MAMIFER_H #define MAMIFER_H #include "animal.h" #include <string.h> class mamifer : public animal { public: mamifer(){} mamifer(std::string price, int x):animal(price,x){} std::string Specie(); }; #endif // MAMIFER_H
#include <iostream> #include "Fraction.h" using namespace std; int main() { Fraction f1(1, 2); Fraction f2(1, 3); Fraction f3 = f1.add(f2); f1.display(); cout << "+"; f2.display(); cout << "="; f3.display(); cout << endl; Fraction f4 = f1.sub(f2); f1.display(); cout << "-"; f2.display(); cout << "=";...
#pragma once #include "commands.hpp" namespace yama { //////////////////////////////////////////////////////////////////////////////// //! The game engine; divorced from system specifics. //////////////////////////////////////////////////////////////////////////////// class engine { public: engine(); ~engin...
/************************************************************************/ /* 28、搜狐笔试题:给定一个实数数组,按序排列(从小到大) * ,从数组从找出若干个数,使得这若干个数的和与M最为接近,描述一个算法,并给出算法的复杂度 */ /************************************************************************/ #include <map> #include <vector> using namespace std; class Solution{ public: Solution...
#include<iostream> #include<queue> #include<stack> #include<vector> #include<stdio.h> #include<algorithm> #include<string> #include<string.h> #include<sstream> #include<math.h> #include<iomanip> #include<map> #define N 1005 #define M 25005 using namespace std; int root[N]; long long cost[N]; struct edge{ int from, t...
// -*- LSST-C++ -*- /* * LSST Data Management System * Copyright 2012-2015 AURA/LSST. * * This product includes software developed by the * LSST Project (http://www.lsst.org/). * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as publ...
#include "../include/drift_diffusion.h" void Drift_diffusion::set_boundaries_space(void) { scaled_boundaries tmp_boundaries; list<scaled_layer_params>::iterator tmp_layer; /* Device params */ double V_build_scaled = layers_params_scaled.device.V_build_scaled; double V_a_scaled = layers_params_scaled.device.V_a_s...
#ifndef TREEVIEW_H #define TREEVIEW_H #include <QMainWindow> #include <QString> #include <QTreeView> #include <QTreeWidget> #include <QTreeWidgetItem> #include <QMimeData> #include <QDrag> #include <QDragEnterEvent> #include <QDragMoveEvent> // se usan estos? #include <QDialog> #include <QMutex> #include <QThread> ...
#include <iostream> using namespace std; template<class T> struct MyIter { typedef T value_type; T *ptr; MyIter(T * p=0):ptr(p){} T& operator* (){return *ptr;} }; template <class I> typename I::value_type func(I ite) {return *ite;} int main() { MyIter<int> ite(new int(8)); cout<<func(ite)<<endl; }
/***************************************************************************************************************** * File Name : quicksort.h * File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\tutorials\nptel\DSAndAlgo\lecture10\quicksort.h * Created on : Dec 31, 2013 :: 12:49:24 PM * Author...
#include <iostream> #include <fstream> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <vector> #include <math.h> using namespace std; struct toado{ int h,c; }; toado doMove(toado oldLoc,int h){ toado newLoc; newLoc.h = oldLoc.h + huong[h].h; // cap nhat toa do hang moi theo huon...
#include <iostream> #include <vector> using namespace std; vector< vector<int> > aumentar( vector< vector<int> > ) ; vector<int> almacenar( vector<int> ) ; void mostrarMatriz( vector< vector<int> > ) ; int main() { vector< vector<int> > matriz( 3 , vector<int>(3) ) ; // matriz original vector<...
/* * MessageManager.cpp * * Created on: Jun 11, 2017 * Author: root */ #include "MessageManager.h" #include "Context.h" #include "../util.h" #include "Session.h" #include "Service_Handler.h" #include "../Log/Logger.h" #include <assert.h> #include "EpollMain.h" #include "../Encrypt/md5.h" namespace CommBaseO...
#include <iostream> #include <algorithm> #include <vector> using namespace std; int n; string temp, max1 = "", max2 = "", original, possible1, possible2; vector<pair<string, char>> allStr; bool mark(string x, char order) { for (int i = 0; i < 2 * n - 2; i++) { if (allStr[i].first == x && allStr[i].sec...
#ifndef _DIAGRAM_D_H #define _DIAGRAM_D_H #include "diagrams_a.hpp" #include "diagrams_b.hpp" #include "diagrams_c.hpp" class C; class D : virtual protected A, private B { public: C m_c; }; #endif
#pragma once #include <string> #include <thread> class c_task { public: c_task(std::string id); private: std::string generate_prototype(int length); std::string calc_hash(std::string &prot); int get_random(int minimum, int maximum); char get_rand_char(); void check_hash(std::string &hash); pri...
#include "SettingManagerUI.hpp" #include <QHBoxLayout> #include <QDebug> #include "SettingProfileEditorUI.hpp" #include "SettingDeviceEditor.hpp" #include <QTimer> SettingManagerUI::SettingManagerUI(int defaultItem, QWidget *parent) : QUtilsFramelessDialog(parent) { initLayout(); initConnecti...
#include <iostream> #include <unordered_set> #include <algorithm> #include <cctype> using namespace std; bool isPalindromePermu(string s){ unordered_set<char> charSet; transform(s.begin(), s.end(), s.begin(),[](unsigned char c) -> unsigned char {return tolower(c);}); for(char c: s){ if(c != ' '){ ...
/* * Copyright (c) 2011 Pierre-Etienne Bougué <pe.bougue(a)gmail.com> * Copyright (c) 2011 Florian Colin <florian.colin28(a)gmail.com> * Copyright (c) 2011 Kamal Fadlaoui <kamal.fadlaoui(a)gmail.com> * Copyright (c) 2011 Quentin Lequy <quentin.lequy(a)gmail.com> * Copyright (c) 2011 Guillaume Pinot <guillaume.pino...
// // Created by OLD MAN on 2020/1/7. // //小蒜给了若干个四位数,请求出其中满足以下条件的数的个数: // //个位数上的数字减去千位数上的数字,再减去百位数上的数字,再减去十位数上的数字的结果大于零。 // //输入格式 // 输入为两行,第一行为四位数的个数 n,第二行为 n 个的四位数,数与数之间以一个空格分开。(n≤100) // //输出格式 // 输出为一行,包含一个整数,表示满足条件的四位数的个数。 #include <iostream> using namespace std; int main(){ int n,m=0; ci...
#include <stdio.h> int main(){ int n; printf("Nhap so n: "); scanf("%d",&n); printf("Tat ca cac so chan tu 1 den %d la: ",n); for(int i=1;i<=n;i++){ if(i%2==0){ printf("%d",i); } } }
/* Copyright (c) 2014 Mircea Daniel Ispas This file is part of "Push Game Engine" released under zlib license For conditions of distribution and use, see copyright notice in Push.hpp */ #pragma once #include "Core/Path.hpp" #include "Core/Noncopyable.hpp" #include <memory> #include <cstdint> namespace TexturePacker...
#include<iostream> using namespace std; int main() { long n,t; cin>>n>>t; long a[100000]; for(long i=0;i<n;i++) { cin>>a[i]; } while(t--) { long s1, s2; cin>>s1>>s2; long min=a[s1]; for(long i=s1;i<=s2;i++) { if(min>a[i]) ...
#include<stdio.h> #include<math.h> int main(int argc, char const *argv[]) { int t,x,y,len,count; scanf("%d",&t); for (int k = 1; k<=t; k++) { count = 0; scanf("%d%d",&x,&y); for (int i = x; i <= y; i++) { for (int j = 2; j <= sqrt(x); j++) { if (x%j==0) { break; } else count+...
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ma...
#include <stdlib.h> #include <math.h> class GraphList{ public: int *data; unsigned int sampling=0; GraphList(unsigned int sampling); void push(int); bool check_peek(); bool what_peek(); }; GraphList::GraphList(unsigned int _sampling){ unsigned int smp=0; if(_sampling > 3){ if(_sampling%2==0){...
/* unfinished, meant to calculate Newton's Laws based on various inputs */ #include <iostream> #include "SecondLaw.h" using namespace std; int main() { cout << "Calculate Newton's Laws" << endl; cout << "Enter '999' for the missing variable to solve for." << endl; double friction; double mass; double accelerat...
/* Copyright (c) 2022 Xavier Leclercq Released under the MIT License See https://github.com/ishiko-cpp/test-framework/blob/main/LICENSE.txt */ #include "DirectoryComparisonTestCheckTests.hpp" using namespace Ishiko; DirectoryComparisonTestCheckTests::DirectoryComparisonTestCheckTests(const TestNumber& nu...
#include<iostream> #include<cmath> using namespace std; int main() { for (unsigned i = 1; i < 10; i++) { cout << pow(i,2) + pow(i - 1,2) << endl; } return 0; }
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- // // Copyright (C) 2003 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 // #include "core/pch.h" #include "KioskResetDialog.h" ...
#ifndef __OBJCATPATH_H #define __OBJCATPATH_H #include "TModelArray.h" #include "db_rec.h" //------------------------------------------------------------------------- namespace wh{ //------------------------------------------------------------------------- namespace object_catalog { //--------------------------------...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2010 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #include "core/pch.h" #ifdef CSS_ANIMATIONS #include "modules/s...