text
stringlengths
8
6.88M
// not submit #include <bits/stdc++.h> using namespace std; class Solution { public: vector<int> maxDepthAfterSplit(string seq) { vector<int> ans; int n = seq.size(); int cnt = 0; for (char ch : seq) if (ch == '(') { ++cnt; } int marked = (cnt ...
#include "sort.h" #include "ui_sort.h" #include <QSqlDatabase> #include <QDebug> #include <QMessageBox> #include <QSqlError> #include <QSqlQuery> //sql语句 #include <QVariantList> #include "database.h" #include "enter.h" Sort::Sort(QWidget *parent) : QWidget(parent), ui(new Ui::Sort) { ui->setupUi(this); ...
#ifndef _COMMON_H_ #define _COMMON_H #pragma once #include <iostream> #include <fstream> #include <Windows.h> #include <assert.h> #include <stdio.h> #include <io.h> #include <stdexcept> using namespace std; #define MAX_PARA_NUM 30 #define TEST_FINISH_SUCCESS 0 #define TEST_FINISH_FAIL 1 #defi...
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFSPermissions.h" bool cmFSPermissions::stringToModeT(std::string const& arg, mode_t& permissions) { if (arg == "OWNER_REA...
#include "GApp.h" bool GApp::onInit(void) { if (SDL_Init(SDL_INIT_EVERYTHING) < 0) { return false; } if ((display = SDL_SetVideoMode(DISPLAY_WIDTH, DISPLAY_HEIGHT, 32, SDL_HWSURFACE | SDL_DOUBLEBUF)) == NULL) { return false; } int imgFlags = IMG_INIT_PNG; int imgInit = IMG_Ini...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define rep1(i, n) for(int i = 1; i <= (int)(n); i++) #define showmap(is, js, x) {rep(i, is){rep(j, js){cout << x[i][j] << " ";}cout << endl;}} #define show(x) {for(auto i: x){cout << i << " ";} cout...
/* ### * IP: GHIDRA * * 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 writin...
#ifndef GRAPH_HPP #define GRAPH_HPP #include "constants.hpp" class Graph { public: Graph(std::initializer_list<std::initializer_list<int>> data); Graph(graph_t g); auto distances() -> graph_t; void setThreads(int threads); private: auto print(const graph_t& t) -> void; auto prepareData(); graph_t m_dat...
#include <numeric> #include <functional> #include "LangStat.h" #include "assertImpl.h" #include "SphinxModel.h" namespace PticaGovorun { WordPart::WordPart(const std::wstring& partText, WordPartSide partSide) : partText_(partText), partSide_(partSide) { } int WordPart::id() const { return id_; } void W...
/* #include <ctype.h> #include <stdio.h> #include <stdlib.h> void expr(); void term(); void match(int symbol); void error(); int lookahead; int main() { lookahead = getchar(); expr(); putchar('\n'); return 0; } void expr() { term(); for(;;) if (lookahead == '+') { match('+'); ter...
#pragma once #include <GL/glew.h> #include <glm/glm.hpp> #include "Window.h" #include "Camera.h" #include "Terrain.h" class FPSCamera : public Camera { public: void update(Terrain terrain) ; private: float speedx = 0, speedy = 0, speedz = 0; unsigned int walkCounter = 0; };
/* #include "Niveau.h" #include "Mur.h" #include "Bonus.h" #include "BonusAccelererPerso.h" #include "BonusDetruireMur.h" #include "SFML/Graphics/Texture.hpp" #include "EasyDefines.h" #include "tinyxml/tinyxml.h" */
#ifndef manager_hpp #define manager_hpp #include <QXmlStreamReader> /** @file manager.h */ #include "singleton.h" //#include "noteediteur.h" #include "relation.h" class Relation; class Note; /*************************************** ** NOTESMANAGER ** ***************************************/ ...
#ifndef OPENGLWIDGET_H #define OPENGLWIDGET_H #include <QtOpenGL> #include <QMouseEvent> #include <QKeyEvent> class OpenglWidget : public QGLWidget { public: OpenglWidget(QWidget* parent = 0); protected: bool fullScreen; GLfloat angle; void getScreenInfo(); void initializeGL(); void initWidget(); voi...
// // Created by 周华 on 2021/5/1. // #include "Scene.h"
#ifndef __VIVADO_SYNTH__ #include <fstream> using namespace std; // Debug utility ofstream* global_debug_handle; #endif //__VIVADO_SYNTH__ #include "hrs_8_opt_compute_units.h" #include "hw_classes.h" struct img_img_update_0_write0_merged_banks_1_cache { // RAM Box: {[0, 1912], [0, 1079]} // Capacity: 1 // # ...
// Copyright (c) 2020 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #pragma once #include <pika/config.hpp> #ifdef PIKA_HAVE_THREAD_BACKTRACE_ON_SUSPENS...
#include <iostream> using namespace std; int main() { // int res = 13; // cout<<res<<"\n"; int temp1; int temp2; int temp3; int temp4; int temp5; int temp6; int temp; for( int i = 0; i <= 999; i++) { for( int j = 0; j <= 999; j++){ //Palindrome Check ...
class Solution { public: bool isAdditiveNumber(string num) { int len = num.size(); /* * 将字符串拆成3个部分,num[0]->num[i],num[i+1]->num[j],num[j+1]->num[end] * */ for(int i=0; i<=(len-1)/2-1; ++i){ if(num[0] == '0' && i >= 1) break; for(int j=i+1; j...
#ifndef CASPER_HPP #define CASPER_HPP #include "pac.hpp" class Pacman; class Casper : public Pacman { public: Casper(); ~Casper(); Casper(Casper &cpy); Casper &operator=(Casper & cpy); void setColor(int); void itermvCas(); void decrmvCas(); int* checkWay(std::vector<char*>, int , int); private: // i...
//candies #include<iostream.h> #include<conio.h> void main() { clrscr(); int n,i,j; int candies[100]; cout<<"Enter the number of kids : \t"; cin>>n; for(i=0;i<n;i++) { cout<<"Enter the candies for kid"<<"\t"<<i+1<<"\t :"; cin>>candies[i]; } cout<<"Enter the number of extra candies \n"; cin>>j; //largest element for(i...
#include<iostream> using namespace std; int a[100010],f[100010]; int main() {int t,n,ans,fir,pos; cin >> t; f[0]=0; for (int j = 1; j <= t; j++) {cin >> n >> a[1]; ans = f[1] = a[1]; for (int i = 2;i <= n; i++) {cin >> a[i]; f[i]=max(f[i-1],0)+a[i]; //cout << f[i] << " "; if (f[i] > a...
#include "data_struct.hpp" using namespace std; using namespace Eigen; // Vertex Helper Function Vertex convert_v(string x, string y, string z) { Vertex v; // convert the strings to float to store in Vertex struct v.x = stof(x); v.y = stof(y); v.z = stof(z); return v; } //Face Helper Functi...
/** Copyright (c) 2018 Mozart Alexander Louis. All rights reserved. */ /** * Include Guard */ #ifndef __BASE_ENTITY_HXX__ #define __BASE_ENTITY_HXX__ /** * Defines */ #define __ENTITY_FILE__ "file" #define __ENTITY_ID__ "id" #define __ENTITY_SPEED__ "speed" #define __ENTITY_TMX_LAYER__ "tmx_layer" /** * Include...
/* Question: Write a C++ program to create class Point Point has x and y as integer data memebers. Use copy constructor to copy one object to another. (Use Default and Parameterized Constructor to Initialize the appropriate objects) */ #include<iostream> using namespace std; class Point{ private: int x...
#ifndef LIST_H #define LIST_H #include <iostream> #include <string> #include <cstdlib> #include "wezel.h" template<typename T> class MyNode; template <typename T> // opisy w pliku .cpp class MyList{ public: MyList(); ~MyList(); bool empty(); void displayList(); void displayHead(); void addFr...
#include "Game.h" #include "Game_World.cpp" #include "Game_Physics.cpp" #include "Game_Camera.cpp" #include "Game_Renderer.cpp" #include "Game_Asset.cpp" #include "Game_Audio.cpp" #include <Windows.h> //TODO: This should later be removed. om_internal loaded_bitmap CreateTransparentBitmap(u32 Width, u32 Height) { loa...
#pragma once #include <QAbstractTableModel> #include "Entities/Statistics/GroupCorrelations/GroupCorrelations.h" class CorrelationsService; class CorrelationsModel : public QAbstractTableModel { Q_OBJECT public: explicit CorrelationsModel(int testId, int scaleId, QObject *parent = nullptr); // :: QAb...
// Fill out your copyright notice in the Description page of Project Settings. #include "BTDecorator_CheckDistance.h" #include "BossAIController.h" #include "Boss.h" #include "MainPlayer.h" UBTDecorator_CheckDistance::UBTDecorator_CheckDistance() : Super() { NodeName = "CheckDistance"; DistanceTrigger =...
//////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2020 Vladislav Trifochkin // // This file is part of [pfs-uri-geo](https://github.com/semenovf/pfs-uri-geo) library. // // Changelog: // 2020.07.12 Initial version /////////////////////////////////////////////////////...
#include <sys/ipc.h> #include <iostream> using namespace std; int main() { key_t ipcKey; ipcKey = ftok( "/home/tomabot/local/ipc/usingFtok/ipc.key", 'a' ); cout << "ipcKey=" << ipcKey << endl; return( 0 ); }
#include "stdafx.h" #include "../EditTool.h" #include "../Editor.h" #include "ModelTool.h" CModelToolRenderTargetListener::CModelToolRenderTargetListener() { mpSkyBoxNode = GetEditor()->GetSceneManager()->getSkyBoxNode(); } void CModelToolRenderTargetListener::preRenderTargetUpdate(const RenderTargetEv...
// https://oj.leetcode.com/problems/first-missing-positive/ // Coordinate each existing positive number in its "right" slot // (i.e. 1 in slot 0, 10 in slot 9) and find the missing one by // checking discrepancy in the array. class Solution { public: int firstMissingPositive(int A[], int n) { if (n <= 0) {...
// // CategoryTable.h // EECS 281 Project 3 // // Created by John West on 3/21/15. // Copyright (c) 2015 John West. All rights reserved. // #ifndef EECS_281_Project_3_CategoryTable_h #define EECS_281_Project_3_CategoryTable_h #include "Log.h" typedef unordered_map <string, LogVec> CatTable; class CategoryTable ...
#include <thread> #include <iostream> #include <exception> #include <epoll_event_listener.hpp> #include <worker.hpp> #include <pool_keeper.hpp> namespace thread_pool { worker::worker(thread_pool::pool_keeper& pool_keeper, int socket_fd) : socket_fd_(socket_fd), pool_keeper_(pool_keeper) { event_listener...
#include "PatchLib.h" #include <set> #include <map> #include "../Md5Utils/Md5Utils.h" void CompareHashSet(std::vector<Md5Digest>& hash_set, std::vector<Md5Digest>& hash_set_final, std::set<size_t> result) { size_t i = 0; for (; i < hash_set.size() && i < hash_set_final.size(); ++i) { if (hash_set[i...
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QMessageBox> #include <QString> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); display(); } MainWindow::~MainWindow() { delete ui; } void MainWindow::display() { ui->left_op...
#pragma once #include <windows.h> #include <iostream> #include <cstring> #include <math.h> struct uinfo { char name[6] = { '\0' }; BYTE cluSec; //每个簇扇区数 WORD dbrSec; //保留区扇区数 BYTE fatNum; //fat的数量 DWORD fatSec; //单个fat扇区数 WORD fsinfoSecNum; //fsinfo扇区号 DWORD emptyClu; DWORD nxtClu; }; char *Read(char *fil...
#include <Allocator.h> using namespace breakout; Allocator::Allocator(const size_t size) : m_memorySize{ size } { assert(size > 0); }; Allocator::~Allocator() { assert(m_allocationsNumber == m_deallocationsNumber); assert(m_allocatedMemorySize == m_deallocatedMemorySize); }
// -*- c++ -*- /* * Copyright 2016 EU Project ASAP 619706. * * 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 appli...
#include "train.hpp" #include "core/events.hpp" #include "core/utils.hpp" DISABLE_WARNING_PUSH_ALL #include <Mahi/Gui.hpp> DISABLE_WARNING_POP namespace OptimExplorer { void TrainWidget::render() { ImGui::Text("Hyperparameters"); ImGui::Separator(); ImGui::NewLine(); ImGui::SliderFloat("Learning Rate", &m_...
/*Author: Yuhang He *Date: August 18, 2016 *Email: yuhanghe@whu.edu.cn *Note: this script is implemented for computing the top-5 error rate for image feature retrieval */ //ASC indicate sorting in ascending order; //DESC indicates sorting in descending order; #include<iostream> #include<algorithm> #include<vector>...
/* * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping * Framework Based on Octrees * http://octomap.github.io * * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg * All rights reserved. License for the viewer octovis: GNU GPL v2 * http://www.gnu.org/licenses/old-licen...
#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> #include <numeric> #include <sstream> typ...
/*********************************************************\ * Copyright (c) 2012-2018 The Unrimp Team * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without * restriction, including wit...
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * LispC Number * Represents an integer or a floating point number * * I also potentially deviate from the Scheme standard by treating integers 0 & 1 as * boolean data types for logic. * * * * * * * * * * * * * * * * * * * * * * * *...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * 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. * * @author Adam Minchinton */ #ifndef RESOURCE_SETUP_H #define RE...
ReactDOMRe.renderToElementWithId <Page message="Hello World" /> "root";
#include "GnMainPCH.h" #include "Gn2DBackBuffer.h" Gn2DBackBuffer::~Gn2DBackBuffer() { }
#pragma once #include <iostream> class vector3 { public: static const vector3 ZERO; vector3() = default; vector3(double x, double y, double z); auto x() const -> double; auto y() const -> double; auto z() const -> double; auto operator==(const vector3& v) const -> bool; auto operator!=(const vector3& v) con...
//////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2011 Bryce Lelbach // Copyright (c) 2011-2017 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at ht...
/************************************************************************* > File Name: vect1.cpp > Author: JY.ZH > Mail: xw2016@mail.ustc.edu.cn > Created Time: 2018年07月29日 星期日 15时33分54秒 ************************************************************************/ #include <iostream> #include <string> #...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2009 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef _MODULE_DATABASE_WEBSTORAGE_DATA_ABSTRACTION_SIMPLE_IMPL_H_...
#include "WorldEconomy.h" WorldEconomy::WorldEconomy(int p_numCountries, int currentState) : numCountries(p_numCountries), curSt(currentState) { e = new Economy*[numCountries]; myStoch = new StochProc*[numCountries]; distr = uniform_real_distribution<double>(0.0, 1.0); gener = mt19937(WORLD_ECON_SEED); testdis...
#ifndef ___MESH_HPP___ #define ___MESH_HPP___ #include <vector> #include <common\vertex.hpp> #include <common\typedef.hpp> #define MESH_DEFAULT_VERTEX_CAPACITY 32 struct mesh { private: const int32 id; const int32 vbo; const int32 ibo; public: const std::vector<vertex> vertices; FINLIN...
/* ========================================== Copyright (c) 2016-2018 Dynamic_Static Patrick Purcell Licensed under the MIT license http://opensource.org/licenses/MIT ========================================== */ #pragma once #include "Dynamic_Static/Core/Defines.hpp" #include <functional> namespac...
#include <iostream> using namespace std; typedef long long ll; ll n, x, y; int main() { scanf("%lld", &n); while(n--) { scanf("%lld %lld", &x, &y); if((x - y) != 1) printf("Yes\n"); else printf("No\n"); } return 0; }
#ifndef TEST_API_SUIT_1 #define TEST_API_SUIT_1 #include <QObject> #include "YIM.h" #include "YIMPlatformDefine.h" extern "C" { extern void IM_SetMode(int mode); } class ImWrapper : public IYIMLocationCallback, public IYIMAudioPlayCallback, public IYIMContactCallback, ...
#pragma once #include "../../Toolbox/Toolbox.h" #include "Material.h" #include "../Shader/ShaderParameter/ShaderParameterColor.h" #include "../Shader/ShaderParameter/ShaderParameterBool.h" namespace ae { /// \ingroup graphics /// <summary>Curve shading settings for rendering.</summary> /// <seealso cref="Material"...
#ifndef STATUS_TEXT_MANAGER_H #define STATUS_TEXT_MANAGER_H #include <vector> namespace sf { class RenderWindow; } namespace Platy { namespace Game { class StatusText; class StatusTextManager { public: StatusTextManager() = delete; ~StatusTextManager() = default; static void Update(float& someD...
#pragma once #include <iberbar/Utility/Xml/Base.h> namespace iberbar { namespace Xml { PTR_CDocumentA __iberbarExports__ CreateRapidXmlDocumentA(); } }
#pragma once #include <sstream> #include <ostream> #include <unordered_map> #include <boost/property_tree/ptree.hpp> #include "EnumClassHash.hpp" #include "json.hpp" class Packet { public: enum class Field { ID, CRYPT, COOKIE, CHECKSUM, TIMESTAMP, PART, T...
/*Assignment 1 Part 2 for CS 1337.013 *Programmer: Medha Aiyah *Description: These are the functions that are used to read into the bin file to collect the information needed for the * drink machine. This information is recorded and displayed to make the drink machine work appropriately. */ //The header...
#ifndef LOAD_IBM_DATA_HPP #define LOAD_IBM_DATA_HPP #include <vector> std::vector<double> LoadIBMData(); #endif // LOAD_IBM_DATA_HPP
#include <iostream> #include <cstdio> #include <cstring> #include <string> using namespace std; string s1, s2, tmp; int main() { while(cin >> s1 >> s2) { if(s1.size() < s2.size()) { tmp = s1; s1 = s2; s2 = tmp; } int dp[s1.size() + 5][s1.size() + 5]; //构造足够大的数组 memset(dp, 0, size...
// Created on: 2013-12-20 // Created by: Denis BOGOLEPOV // Copyright (c) 2013-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 ...
string convert(string s, int numRows) { vector<string> vecStr; int n=numRows+numRows-2; if(numRows==1) n=1; for(int i=0; i<s.size(); i+=n) { if(i+n>s.size()) vecStr.push_back(s.substr(i)); else vecStr.push_back(s.substr(i,n)); } string retStr; for(int i=0; i<numRows; i++) { for...
#pragma once #include <iostream> #include "position.hpp" #include <boost/random/mersenne_twister.hpp> #define PI 3.14159265359 class StepGenerator { public: StepGenerator(); void generateNext(position& next, position last); private: double generateAngle(double lowBound, double highBound); ...
#include "AudioClassV2.h" #include "AZ3166WiFi.h" #include "Arduino.h" #include "WebSocketClient.h" #include "RGB_LED.h" #define MAX_RECORD_DURATION 5 #define SAMPLE_RATE 8000 #define BITS_PER_SAMPLE 16 #define BYTES_PER_SAMPLE 2 #define SAMPLE_CHANNELS 2 #define BYTES_PER_SECOND (SAMPLE_RATE * (...
#pragma once #include "MoveRawCalibration.h" #include "MoveManager.h" #include "Mat3.h" #include "MoveIncludes.h" #include "MoveOrientation.h" #define SWAP_MIN(min,value) if(min>value) min=value #define SWAP_MAX(max,value) if(max<value) max=value #define MAG_ITERATIONS 100 namespace Move { struct Mo...
#ifndef VERTEX_H_INCLUDED #define VERTEX_H_INCLUDED #include <string> namespace graph { struct Vertex { const std::string name; bool operator<(const Vertex& v) const { return (name < v.name); }; bool operator==(const Vertex& v) const { return (name == v.name); }; }; }...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2010 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #ifndef WINDOWS_GADGET_LIST_H #define WINDOWS_GADGET_LIST_H #ifd...
// Created on: 1993-03-16 // Created by: Christian CAILLET // Copyright (c) 1993-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<string> using namespace std; #include"olcConsoleGameEngine.h" struct sPoint2D { float x; float y; }; struct sSpline { vector<sPoint2D> points; sPoint2D GetSplinePoint(float t, bool bLooped = false) { // p0 = -x^3 + 2x^2 - x // p1 = 3x^3 - 5x^2 + 2 // p2 =...
/***************************************************************************************** * * * owl * * ...
#include <vector> #include <iostream> #include <math.h> #define GL_GLEXT_PROTOTYPES #include <GL/glut.h> #include "Spdr3dModel.hpp" static void displayInitializer( void ); static void displayFunc(); static void displayAxis( void ); static void displayFacet( Spdr3dFacet& facet, float fProgress=100 ); static void di...
#include <windows.h> #include <iostream> #include "resource.h" using namespace std; int main () { SetConsoleTitle("Cit Woodchip Shovel"); string choice; int x; int y; int run; int done = 0; string division; start: cout << "Cit Woodchip Shovel" ; cout << endl ...
#include "tile.h" Tile::Tile(int row, int col, QWidget* parent) :QPushButton(parent) { this->row = row; this->col = col; this->state = _empty; this->setText(QString("")); } bool Tile::isEmpty() { return (this->state == _empty); } void Tile::handleClicked(int player) { if( !this->isEmpty()...
// Copyright 2015 Stef Pletinck // License: view LICENSE file // Includes! 4 SFML #include <SFML/Graphics.hpp> #include <SFML/System.hpp> // Includes 4 Cpp #include <iostream> // My includies! #include "../headers/epengine.h" #include "../headers/texturemanager.h" // Let's get the ball rollin' int main(int argc, ch...
#ifndef __FACTORY_TEST_HPP_ #define __FACTORY_TEST_HPP_ #include "gtest/gtest.h" #include "factory.hpp" #include "string.h" TEST(FactoryTest, EvaluateSimpleAdd) { int len = 4; char** expression = new char*[len]; expression[0] = "./calculator"; expression[1] = "5"; expression[2] = "+"; express...
#include <iostream> using namespace std; int main(void) { char a; char &b = &a; cout<<"sizeof(b)="<<sizeof(b)<<endl; cout<<"sizeof(b)="<<sizeof(a)<<endl; return 0; }
#pragma once #ifdef _IS_WINDOWS_ #include "AllowWindowsPlatformTypes.h" #endif #include <google/protobuf/message_lite.h> //include other header file //#include "login.pb.h" #include <DataContainer.pb.h> //using namespace fh_proto; using namespace proto; using namespace google; typedef const ::google::protobuf:...
#ifndef PRODUCT_H #define PRODUCT_H #include <QString> class Product { private: QString id; QString nameProduct; double priceProduct; public: Product(); QString getId() const; void setId(const QString &value); QString getNameProduct() const; void setNameProduct(const QString &value); ...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <folly/io/SocketOptionMap.h> #include <quic/codec/Types.h> #include <quic/state/LossState.h> #include <qui...
/* BEGIN LICENSE */ /***************************************************************************** * SKFind : the SK search engine * Copyright (C) 1995-2005 IDM <skcontact @at@ idm .dot. fr> * $Id: table.h,v 1.47.2.5 2005/02/21 14:22:39 krys Exp $ * * Authors: Mathieu Poumeyrol <poumeyrol @at@ idm .dot. fr> * ...
#pragma once #include <string> class TextFileChunk { public: TextFileChunk(/* args */); ~TextFileChunk(); private: std::string m_chunk_value; };
// Copyright (c) 2011-2017 The Cryptonote developers // Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs // Copyright (c) 2018-2023 Conceal Network & Conceal Devs // // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php....
#include<bits/stdc++.h> using namespace std; main() { char as[10000]; while(gets(as)) { int maxi=0, ct=0, i; for(i=0; i<strlen(as); i++) { ct++; if(ct>maxi) maxi=ct; if(as[i]=='A'||as[i]=='E'||as[i]=='I'||as[i]=='O'||as[i]=='U'||as[...
#include <iostream> using std::endl; using std::cout; using std::cin; #include <vector> using std::vector; void foreach_vector(vector<int>::size_type index, vector<int> v) { if(index != 0) foreach_vector(index-1, v); cout << v[index] << endl; return; } int main() { vector<int> v = {1, 2, 3, 4...
#include <iostream> #include <vector> using namespace std; class MyArray{ public: MyArray(vector<unsigned int> input){ v = input; } int elementAt(int i) const{ // この関数はobjectを変更しない if(i < v.size()){ return v[i]; }else{ return -1; } } private: ...
#include <stdio.h> #include <iostream> #include <algorithm> #include <math.h> #include <vector> #include <deque> #include <string> #include <string.h> #include <queue> #include <stdlib.h> #include <set> typedef long long ll; typedef long double ld; typedef unsigned long long ull; const ld PI = acosl(-1.); using names...
#include <iostream> #include <vector> #include <queue> #include <algorithm> using namespace std; /* → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → */ #define int long long int #define ld long double #define F first #define S second #define P pair<int,i...
#include<cstdio> #include<iostream> using namespace std; //cycle_list struct listnode{ listnode*prev; listnode*succ; char ball; }; struct list{ listnode*list_head; void initialize(listnode*pnode,char ball){ list_head=pnode; list_head->prev=list_head; list_head->succ=list_head; list_head->ball=ball; } li...
#include "LowPower.h" #include <EEPROM.h> #define DEFAULT_SLEEP 8 #define L 2 #define R 13 #define CPU_FACTOR 2 int addr = 0; #define DOWN 320 #define UP 280 void up(int ms) { EEPROM.write(addr, 1); digitalWrite(L, LOW); digitalWrite(R, HIGH); delay(ms); digitalWrite(L, LOW); digitalWri...
#include <gtest/gtest.h> #include <Eigen/Dense> #include <solvers/sqp.hpp> #include <unsupported/Eigen/AutoDiff> using namespace sqp; namespace sqp_test_autodiff { template <typename SCALAR, typename DERIVED> struct NonLinearProblemAutoDiff : public NonLinearProblem<SCALAR> { using Scalar = SCALAR; using Vec...
/** * 2016 Mohd Fahmi Noorain * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * * DISCLAIMER * ...
#ifndef HISTORY_H #define HISTORY_H #include <QWidget> #include <QLabel> #include <QVBoxLayout> class QLineEdit; //class Button; class history : public QWidget { Q_OBJECT public: history(QWidget *parent = 0); history(); void his(); QLabel *getjurnal(); QWidget *getwindow(); private: //Q...
/*************************************************************************************************** modelrepository.h Simple file for storing and retrieving the model meshes by David Ramos ***************************************************************************************************/ #pragma once #include "CPR...
#include<stdio.h> struct node { int x; //横坐标 int y; //纵坐标 }; int main() { struct node que[2501]; int head, tail; int a[51][51]; int book[51][51] = {0}; int i, j, k, sum, max = 0, mx, my, n, m, startx, starty, tx, ty; //定义一个方向数组 int next [4][2] = {{0,1}, //向右走 {1,0}, //向下走 {0,-1}, //向左走 ...
#ifndef _ROOM_H #define _ROOM_H #include "Player.h" #include "Table.h" #include "CDL_Timer_Handler.h" #define MAX_ROOM_TABLE 300 class Room; class RoomTimer:public CCTimer { public: RoomTimer(){} ; virtual ~RoomTimer() {}; void init(Room* room); void startHeartTimer(); void stopHeartTimer(); private: R...