text
stringlengths
8
6.88M
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2010-2011 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" #ifdef SVG_SUPPORT #include "modules/s...
#include "BlackScholesMertonPut.hpp" BlackScholesMertonPut::BlackScholesMertonPut(double _S0, double _E, double _r, double _sigma, double _T) : BlackScholesMerton(_S0, _E, _r, _sigma, _T) {} double BlackScholesMertonPut::calculate(const double t) { double time_diff = this->T - t; double d1 = this->cal...
/* https://www.acmicpc.net/problem/1193 */ #include <iostream> using namespace std; int main(void) { int num; scanf("%d", &num); int i; for (i = 1; num > 0; i++) num -= i; i -= 1; // i가 홀수인 줄은 내림차(높->낮) // i가 짝수인 줄은 오름차(낮->높) if (i % 2 == 1) printf("%d/%d", 1 - num, i + num); else printf("%d/%d", i +...
#include "cnn_multi_tracker.h" #include "../game/object_info.h" #include "detector/detector.h" namespace ice { CNNMultiTracker::CNNMultiTracker() : key_max_(0) { OnInit(); } CNNMultiTracker::~CNNMultiTracker() { OnDestroy(); } void CNNMultiTracker::OnInit() { } void CNNMultiTracker::OnDestroy() { //...
// Fill out your copyright notice in the Description page of Project Settings. #include "kinect2ArrayProject.h" #include "k2Array.h" #include <math.h> //General Log DEFINE_LOG_CATEGORY(logK2Array); // Sets default values Ak2Array::Ak2Array() { // Set this actor to call Tick() every frame. You can turn this off ...
/* LIBRARIES */ #include <LiquidCrystal_I2C.h> #include <PID_v1.h> #include "constants.h" #include "SD_management.h" #include "voltage_management.h" #define DEBUG /* #ifdef DEBUG ... #endif */ /* VARIABLES AND CONSTANTS */ /***************Voltage output**********************/ // Readeable values from ADC ...
/** * Copyright 2008 Matthew Graham * 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...
#include "GnMeshPCH.h" #include "GnGamePCH.h" #include "GInfoBasic.h" #include "GActorInfoDatabase.h" void GInfoBasic::LoadDataFromQuery(GnSQLiteQuery* pQuery) { mHP = (gint32)pQuery->GetIntField( COL_HP ); mStrength = (guint32)pQuery->GetIntField( COL_STRENGTH ); mMoveSpeed = (float)pQuery->GetFloatFiel...
#include "MeshComponent.h" #include "../core/resources/RenderObject.h" #include "../core/GameCore.h" #include "TransformComponent.h" namespace Game { MeshComponent::MeshComponent() : mRenderObject() { } void MeshComponent::loadMesh(const char *path) { mRenderObject.load(path); } void MeshComponent::update() { ...
#include "abstractphysicpoint.h" namespace sbg { AbstractPhysicPoint::~AbstractPhysicPoint() = default; double AbstractPhysicPoint::getMass() const { return _mass; } void AbstractPhysicPoint::setMass(const double mass) { _mass = mass; } }
#include <Keyboard.h> // exemplo: quero a tecla "F5", será KEY_F5 // para ter acesso a todas as teclas especias visite: https://www.arduino.cc/reference/en/language/functions/usb/keyboard/keyboardmodifiers/ // altere a tecla abaixo conforme a necessidade, basta alterar a parte do "F" char tecla = KEY_F8; void setup(...
#include "StatusTextManager.h" #include "StatusText.h" #include <SFML/Graphics/RenderWindow.hpp> namespace Platy { namespace Game { std::vector<StatusText> StatusTextManager::myStatusTexts; void StatusTextManager::Update(float& someDeltaTime) { for (auto i = myStatusTexts.size(); i > 0; i--) { myS...
#ifndef AM_PM_CLOCK_H_ #define AM_PM_CLOCK_H_ #include <ostream> class am_pm_clock { int hours; int minutes; int seconds; bool am; public: am_pm_clock(): hours(12), minutes(0), seconds(0), am(true) { } /* * Default constructor - initial time should be midnight */ am_pm_cl...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 2002-2006 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * Owner: julienp */ #ifdef FEATURE_SCROLL_MARKER //The followin...
// // Created by yshhuang on 2019-03-01. // #include <opencv2/opencv.hpp> void example2_5(const cv::Mat &image) { cv::namedWindow("Example2_5-in", cv::WINDOW_AUTOSIZE); cv::namedWindow("EXAMPLE2_5-out", cv::WINDOW_AUTOSIZE); cv::imshow("Example2_5-in", image); cv::Mat out; cv::GaussianBlur(image,...
// // Created by manout on 17-3-11. // #include "common_use.h" /* * Given an array and a value, remove all instances of that value in * place and return the new length. The order of elements can be changed. * it doesn't matter what you leave beyond the new length. */ int remove_element()(vector<int> &nums,...
// https://practice.geeksforgeeks.org/problems/subset-sum-problem/0 #include <iostream> using namespace std; bool findSum(int sum, int n, int a[]) { bool dp[sum + 1][n + 1]; for (int i = 0; i <= n; i++) dp[0][i] = true; for (int i = 1; i <= sum; i++) dp[i][0] = false; for (int i = 1; i...
#ifndef wali_PRINTABLE_GUARD #define wali_PRINTABLE_GUARD 1 /* * @author Nicholas Kidd */ #include <string> #include <iostream> namespace wali { /*! * @class Printable * @brief Interface defining the print method * * A Printable object must define a print method. * * The Printable class provid...
#ifndef MASTERS_PROJECT_AMERICANBINOMIALDIVIDENDRECURSIVEMETHOD_H #define MASTERS_PROJECT_AMERICANBINOMIALDIVIDENDRECURSIVEMETHOD_H #include "DiscreteDividendMethod.hpp" template<typename X> class AmericanBinomialDividendRecursiveMethod : public DiscreteDividendMethod<X> { public: AmericanBinomialDividendRecursiv...
/* Copyright (c) 2016, Los Alamos National Security, LLC All rights reserved. Copyright 2016. Los Alamos National Security, LLC. This software was produced under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National Laboratory (LANL), which is operated by Los Alamos National Security, LLC for the ...
#include <iostream> #include <istream> #include <string> using namespace std; int num_words(string str); void add_commas(string &str); // finds commas in the pargraph and returns the words previous and next to it. void get_words(int i, string &str); // adds a comma before or after (where) a give `word` in a `paragrap...
#pragma once #include "zombie.h" class zombie_type4 : public zombie { public: zombie_type4(BaseEngine* pEngine); ~zombie_type4(void); };
/* -*- 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. * */ #ifndef MDE_WIDGET_H #define MDE_WIDGET_H #include "modules/...
////////////////////////////////////// // // Example #4: Vna System Settings // ////////////////////////////////////// // Display settings bool isDisplayOn = vna.settings().isDisplayOn(); vna.settings().isDisplayOff(); vna.settings().displayOff(); vna.settings().displayOn(); ...
#ifndef EDITJSONFILE_H #define EDITJSONFILE_H #include <QMainWindow> #include <QTableWidget> #include <QMessageBox> #include "SRC/Analyzer/DataTypes/election.h" namespace Ui { class EditJsonFile; } class IntTableWidgetItem : public QObject, public QTableWidgetItem { Q_OBJECT public: IntTableWidge...
namespace json { template<typename T> class ConvValueAs; template<typename T> class ConvValueFrom; template<> class ConvValueAs<StringView<char> > { public: static StringView<char> convert(const Value &v) { return v.getString(); } }; template<> class ConvValueFrom<StringView<char> > { public: static Value conv...
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- // // Copyright (C) 2006-2011 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" #ifdef WEBFEEDS_BACKEND_SUPPORT #include "...
// Created on: 1993-01-09 // Created by: CKY / Contract Toubro-Larsen ( SIVA ) // 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 ...
#include<bits/stdc++.h> using namespace std; typedef long long ll; using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); ll l1,l2,r1,r2,k; cin>>l1>>r1>>l2>>r2>>k; ll minn=min(r1,r2); ll maxn=max(l1,l2); ll ans=minn-maxn+1; if(maxn>minn){ cout<...
#ifndef MODEL_H #define MODEL_H #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <assimp/Importer.hpp> #include <assimp/scene.h> #include <assimp/postprocess.h> #include <string> #include <fstream> #include <sstream> #include <iostream> #include <map> #include <vector> #include "model/mesh.h" ...
#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>...
// Copyright (c) 2017 Mikael Simberg // // 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) // Simple test verifying basic resource_partitioner functionality. #include <pika/ass...
#include<bits/stdc++.h> using namespace std; #define mod(n,m) n>=0?n%m:n%m+m; int exgcd(int a,int b,int &x,int &y) { if(b==0) { x=1; y=0; return a; } int r=exgcd(b,a%b,x,y); int t=x; x=y; y=t-a/b*y; return r; } int T; int n; int C[20],P[20],L[20];...
#include <mutiplex/Connector.h> #include <mutiplex/EventLoop.h> #include <mutiplex/ByteBuffer.h> #include <mutiplex/Timestamp.h> #include <mutiplex/Connection.h> using namespace muti; void read_cb(ConnectionPtr conn, ByteBuffer* buffer, uint64_t timestamp) { printf("%s->%s\n", conn->local_address().to_string().c_...
#include "OleDbConnection.hpp" #ifndef ELYSIUM_CORE_DATA_OLEDB_OLEDBTRANSACTION #include "OleDbTransaction.hpp" #endif Elysium::Core::Data::OleDb::OleDbConnection::OleDbConnection() : DbConnection() { _InitializationResult = CoCreateInstance(CLSID_SQLNCLI11, NULL, CLSCTX_INPROC_SERVER, IID_IDBInitialize, (...
// Created on: 1996-12-11 // Created by: Robert COUBLANC // Copyright (c) 1996-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...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-1999 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 DOM3_LOAD #include "modules/dom...
#include <bits/stdc++.h> using namespace std; #define TESTC "" #define PROBLEM "10041" #define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0) int main(int argc, char const *argv[]) { #ifdef DBG freopen("uva" PROBLEM TESTC ".in", "r", stdin); freopen("uva" PROBLEM ".out", "w", stdout); #endif int kase; ...
// Copyright (c) 2020 The Orbit Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ORBIT_QT_ORBIT_GL_WIDGET_WITH_HEADER_H_ #define ORBIT_QT_ORBIT_GL_WIDGET_WITH_HEADER_H_ #include <QWidget> namespace Ui { class OrbitGlWidgetWi...
// g2o - General Graph Optimization // Copyright (C) 2011 R. Kuemmerle, G. Grisetti, W. Burgard // 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 cod...
// Created on: 1992-11-02 // 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 <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <iostream> #include <sstream> #include <vector> #include <string> #include <algorithm> #include <map> #include <mutex> #include <memory> #include <thread> #include <chrono> #include <opencv2/core.hpp> #include <opencv2/highgui.hpp> #include <GL/gl...
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/BannerMerchant.g.uno. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Fuse.Animations.IResize.h> #include <Fuse.Binding.h> #include <Fuse.Controls.Panel.h> #include <Fuse.Drawing.ISurfaceDrawable.h> #incl...
#pragma once #include "calculateproteinprobability.h" class CCalProteinProbSiblingSP : public CCalculateProteinProbability { public: CCalProteinProbSiblingSP(CListMassPeptideXcorr* pLMX,CListProtein* pLP):CCalculateProteinProbability(pLMX,pLP){}; void calculateProteinProbability(); ~CCalProteinProbSiblingSP(void); ...
#include "control_block.h" #include <iostream> #include <Windows.h> #include <ctime> #include <cstdlib> #include <conio.h> #define COL GetStdHandle(STD_OUTPUT_HANDLE) #define DARK_BLUE SetConsoleTextAttribute(COL, 0x0001); #define GREEN SetConsoleTextAttribute(COL, 0x0002); #define PURPLE SetConsoleTextAttribute(...
#include "OleDbTransaction.hpp" Elysium::Core::Data::OleDb::OleDbTransaction::OleDbTransaction() { } Elysium::Core::Data::OleDb::OleDbTransaction::~OleDbTransaction() { } const Elysium::Core::Data::IDbConnection & Elysium::Core::Data::OleDb::OleDbTransaction::GetConnection() const { return DbTransaction...
/* * Copyright (c) 2008-2015, Hazelcast, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required ...
#ifndef UTIL_H #define UTIL_H #include <Debug.h> #include <stdlib.h> #include <GL/opengl.h> #include <string> #ifdef __ANDROID__ #include "AssetManager.h" #include <sndfile\sndfile.h> #endif namespace gg { struct tgaHeader { GLubyte idLength; GLubyte colorMapType; GLubyte type; GLushort width; ...
#include <bits/stdc++.h> #include "afd.hpp" #include "afn.hpp" using namespace std; int main(){ AFN afn; afn.addInitial(0); afn.addFinal(5); afn.addTransition(0,'a',1); afn.addTransition(1,'a',0); afn.addTransition(0,AFN::E,2); afn.addTransition(0,'c',4); afn.addTransition(2,'b',3); afn.addTransition(3...
#pragma once #include "Render/DrawSubPass/BaseSubPass.h" namespace Rocket { class GeometrySubPass : implements BaseSubPass { public: void Draw(Frame& frame) final; }; }
// Created on: 2003-01-22 // Created by: data exchange team // Copyright (c) 2003-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...
#include <iostream> #include <fstream> using namespace std; int main(int argc, char* argv[]) { ifstream dna_file (argv[1]); char x; string rna=""; while (dna_file.get(x)){ if(x=='T'){ rna+='U'; }else{ rna+=x; } } cout << rna ; }
/* * @lc app=leetcode.cn id=375 lang=cpp * * [375] 猜数字大小 II */ // @lc code=start #include<iostream> #include<vector> using namespace std; class Solution { public: int getMoneyAmount(int n) { vector<vector<int>> dp(n+1, vector<int>(n+1,0)); for(int len=2;len<=n;len++) { for(int ...
#include <Unixfunc.h> #include <iostream> using namespace std; /* Posix多线程pthread详解 前言 不论是子线程还是主线程,实质上都共同属于同一个进程,这大大的减小了系统的开销。 另外,多线程与多进程的使用实质上主要掌握 创建 等待 退出 这三个点 ||创建|等待|退出| |多进程|fork|wait|exit| |多线程|pthread_create|pthread_join|pthread_exit| 同时,多线程也有自己的线程清理函数 pthread_cleanup_push(pop). 一.线程创建 pthread_create * in...
#include <ostream> #include <vector> #include "perm.h" #include "explicit_transversals.h" namespace cgtl { void ExplicitTransversals::create_edge( unsigned origin, unsigned destination, unsigned label) { if (_orbit.find(destination) == _orbit.end()) { _orbit[destination] = Perm(_degree); _orbit[origin] =...
#include "imgui/imgui.h" #include "EventListener.h" #include "GameData.h" #include "GUI.h" #include "Hacks/ESP.h" #include "Hacks/Misc.h" #include "Hooks.h" #include "Interfaces.h" #include "Memory.h" #include "SDK/Engine.h" #include "SDK/GlobalVars.h" #include "SDK/InputSystem.h" #ifdef _WIN32 #include <intrin.h> ...
#ifndef assume_h #define assume_h #include <chuffed/core/sat-types.h> #include <chuffed/core/sat.h> #include <chuffed/support/misc.h> // Helper for pushing a failure back to externally visible literals. // WARNING: This assumes explanations are not lazy. template <class P> void pushback_reason(const P& is_extractable,...
/* * validator.h * * Created on: 14. 12. 2016 * Author: ondra */ #ifndef IMMUJSON_VALIDATOR_H_ #define IMMUJSON_VALIDATOR_H_ #include <vector> #include "path.h" #include "stringview.h" #include "string.h" #include "value.h" namespace json { class Validator { public: virtual ~Validator() {} static S...
/* -*- mode: c++; tab-width: 4; c-basic-offset: 4 -*- */ group "clipboard"; require init; require USE_OP_CLIPBOARD; include "modules/dragdrop/clipboard_manager.h"; include "modules/pi/OpClipboard.h"; include "modules/doc/frm_doc.h"; include "modules/doc/html_doc.h"; include "modules/logdoc/htm_elm.h"; include "modules...
//By SCJ //#include<iostream> #include<bits/stdc++.h> using namespace std; #define endl '\n' #define INF 100000000 bool A[20][20],a[20][20]; bool count(int i,int j) { return a[i][j-1]^a[i][j+1]^a[i-1][j]^a[i+1][j]; } int main() { ios::sync_with_stdio(0); cin.tie(0); int T;cin>>T; for(int ca=1;ca<=T;++ca) { memset...
#ifndef ANIMATEDSPRITE_H #define ANIMATEDSPRITE_H class AnimatedSprite { public: AnimatedSprite(); virtual ~AnimatedSprite(); protected: private: }; #endif // ANIMATEDSPRITE_H
#ifndef DRAWINGS_H #define DRAWINGS_H #endif // DRAWINGS_H #include <cmath> #include "opencv2/opencv.hpp" #include "opencv2/imgcodecs.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/videoio.hpp" #include <opencv2/highgui.hpp> #include <opencv2/video.hpp> #include <opencv2/gapi/gscalar.hpp> #include <opencv2/gap...
#pragma once #include <Tanker/DeviceKeys.hpp> #include <Tanker/Trustchain/DeviceId.hpp> #include <tconcurrent/coroutine.hpp> #include <memory> namespace Tanker { namespace DataStore { class ADatabase; } class DeviceKeyStore { public: DeviceKeyStore(DeviceKeyStore const&) = delete; DeviceKeyStore(DeviceKeyStore...
#include <iostream> using namespace std; struct punct { double x, y; }; int apartine(double x, double y, punct a, punct b ) { double min1, min2, max1, max2; if(a.x > b.x) { min1 = b.x; max1 = a.x; } else { max1 = b.x; min1 = a.x; } if(a.y > b.y) ...
#include "openglwidget.h" #include <QRect> #include <QDebug> OpenglWidget::OpenglWidget(QWidget* parent) :QGLWidget(parent) { fullScreen = false; angle = 0.0; initWidget(); initializeGL(); } void OpenglWidget::initializeGL() { glShadeModel(GL_SMOOTH); glClearColor(0.0, 0.0, 0.0, 0.0); ...
#include <iostream> #include <Eigen/Core> #include <algorithm> #include <memory> #include "../mean_curvature_solver.h" #include "../utilities.h" #include "../uniform_lb_operator.h" #include "../cotangent_lb_operator.h" using SolverPtrT = std::unique_ptr<mcurv::MeanCurvatureSolver>; char *getCmdOption(char **begin, ch...
#ifndef _DX11_RENDER_TARGET_H_ #define _DX11_RENDER_TARGET_H_ #include <vector> #include "RenderTarget.h" #include "d3d11.h" namespace HW{ class DX11Texture; class DX11RenderTarget : public RenderTarget{ public: DX11RenderTarget(const String& name, RenderSystem* system); virtual ~DX11RenderTarget(); virtual...
#include "ContainerException.hpp" const char * ContainerException::what() const noexcept { return "Errore sconosciuto Container"; } const char * ContainerCellNotFoundException::what() const noexcept { return "Nessuna voce trovata con la chiave inserita"; } const char * ContainerDuplicateKeyException::what() cons...
/* * File: main.cpp * Author: Tom * * Created on 13 January 2012, 6:55 PM */ #include <cstdlib> #include <iostream> using namespace std; int main(int argc, char** argv) { int number = 20; int lower = number/2 + 1; long long increment = number * (number - 1); long long result = 0; numb...
#include <cstdio> #include <memory.h> #include <vector> #include <assert.h> #include <cmath> #include <algorithm> using std::vector; using std::random_shuffle; typedef long long ll; typedef long double ld; struct Tp { ll x, y, z; char label; } p[11]; struct Tpd { ld x, y, z; Tpd() { x = y = z...
#include <iostream> #include <vector> using namespace std; int main() { std::vector<string> vs1; cout << "Now vs1 has " << vs1.size() << " element" << endl; // cout << "this is vs1" << endl; // for (size_t i = 0;i < vs1.size();i++) { // cout << i << ": " << vs1[i] << endl; // } // return 0; vs1.push_...
//Write a program to read two integer values m and n and to decide and print whether m ia a multiple of n. #include<iostream> using namespace std; int main() { int m,n; cout<<"Enter two integers"<<endl; cin>>m>>n; if(m%n==0) cout<<"m is multiple of n"<<endl; else cout<<"m is not multiple of ...
#include "Adder.h" double Adder::plus(double left, double right) { return left + right; }
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #include <cstdlib> #include <cmath> using namespace std; typedef long long ll; #define INF 10e10 #define rep(i,n) for(int i=0; i<n; i++) #define r...
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QTreeWidgetItem> #include <QMainWindow> #include "headers/treemodel.h" #include "headers/dbconnector.h" #include "headers/dialog_add.h" QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } QT_END_NAMESPACE class MainWindow : public QMainWindow { Q_OBJECT publi...
#include<iostream> #include<vector> #include<algorithm> #include<iterator> #include<stack> using namespace std; #define inf 99999 struct TreeNode { int val; TreeNode* left; TreeNode* right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; //空指针传参,代码把函数的第一个参数的值压入栈中存储,而空指针指向为空,不存在值*p,因此给*p一个临时变量和主函数并不是同一个*p vo...
/* * Pwm.h * * Created on: 28/11/2019 * Author: frank */ #ifndef PWM_H_ #define PWM_H_ class Pwm { public: Pwm(); }; #endif /* PWM_H_ */
#include <cstdlib> #include <cstring> #include <vector> #include <iostream> #include <fstream> #include "vid.h" #include "kmziaes.h" #include "stegan.h" #include "client.h" using namespace std; int main(int argc, char* argv[]) { string fileDataName,fileKeyVigName,fileKeyAesName,fileContainName; string host,po...
/** * Definition for a binary tree node. * struct TreeNode { * ll val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(ll x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(ll x, TreeNode *left, TreeNode *right) : val(...
// // Keyboard.cpp // Odin.MacOSX // // Created by Daniel on 04/06/15. // Copyright (c) 2015 DG. All rights reserved. // #include <assert.h> #include "Keyboard.h" namespace odin { namespace io { Keyboard::Keyboard() { for (auto& key : m_keyStates) key = false;...
#include <stdio.h> void main() { int total=0; int num; int numcount=0; int average; printf("this can display average\n"); printf("press 999 to quit\n"); while(num!=999) { printf("enter number %d: ",numcount + 1); scanf("%d",&num); if (num != 999) { numcount++; total=total+num; } } average...
#include"conio.h" #include"stdio.h" void main(void) { int a; clrscr(); printf("Enter no."); scanf("%d",&a); switch(a) { case 1: printf("One"); break; case 2: printf("Two"); break; case 3: printf("Three"); break; case 4: printf("Four"); break; case 5: printf("Five"); break; ...
#include <iostream> #include <windows.h> #include <cstdlib> using namespace std; void gotoxy(int x, int y){ HANDLE hcon; hcon = GetStdHandle(STD_OUTPUT_HANDLE); COORD dwPos; dwPos.X = x; dwPos.Y = y; SetConsoleCursorPosition(hcon, dwPos); } int main(){ int hora,min,seg; cout<<"\t\t\tRELOJ DIGITAL"<<endl; cou...
#include<bits/stdc++.h> using namespace std; int t,n; int a[23],ans[23]; int flag=0; void dfs(int index,int cnt,int sum) { int x; if(sum>t) return; if(sum==t) { flag=1; for(int i=0; i<cnt; i++) { if(i<cnt-1) printf("%d+",ans[i]); ...
//栈(Last in first out, LIFO) //top始终指向栈顶元素 #include <iostream> using namespace std; template<class ElemType> class Stack{ private: const static int MaxSize = 50; ElemType data[MaxSize]; int top; public: Stack(); //初始化栈 bool Pop(); //出栈 bool Pus...
/* -*- 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. */ #include "core/pch.h" #if defined DOM_WIDGETMANAGER_SUPPORT || ...
/*! * \file adt.cpp * \author Simon Coakley * \date 2012 * \copyright Copyright (c) 2012 University of Sheffield * \brief Implementation of model data type */ #include "./adt.h" /*! * \brief Model data type constructor * \param[in] n The data type name, default "" * \param[in] d The data type description,...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 1995-2007 Opera Software ASA. 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 "PluginPathDialog.h" #include "modu...
/* * @author : dhruv-gupta14 * @date : 28/12/2018 */ #include<bits/stdc++.h> using namespace std; int main() { int flag=0,x=0; string str1; getline(cin,str1); string str2; getline(cin,str2); int n = str1.length(); int m = str2.length(); if(str1 == str2) cout << "...
#include<stdio.h> #include<iostream> #include<string.h> #include<conio.h> using namespace std; int main() { int a=1,b=2; char * str = "hello", * s2 = "I am not going to print"; char * ptr = str; char least = 127; // printf("hi"); while (*ptr++) { ...
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { vector <int>v; int temp,n,i,j,k,size,h,m,s,count; while(1) { v.clear(); cin>>temp; if(temp==0)break; else v.push_back(temp); while(1) { cin>>temp; if(temp==0)break; else v.push_back(temp)...
#include <iostream> using namespace std; int updateterms(int terms[][2],int j,int i) { int result = terms[0][0]; for(int k=1;k<j;k++) { terms[k][0] = terms[k][0]*(i)/(i+1-terms[k][1]);//to update term multiply by x-1 which is i and divide by x-1-b which is i-terms[k][1] result += terms[k][0]; } return result;...
/* * TLinesBoard.cpp * * Created on: Apr 12, 2017 * Author: Alex */ #include "TLinesGame.h" #include <cstdlib> TBallsHolder::TBallsHolder(): holder("BallsHolder") { if (holder == 0 ) genNewBalls(); else load(); }; void TBallsHolder::genNewBalls(){ for (int i=0;i<3;i++) balls[i] = rand() % 7 +1;...
#ifndef FILEWORKSPACEWIDGET_H #define FILEWORKSPACEWIDGET_H #include <memory> #include <QWidget> #include "FileWorkspaceViewModel.h" namespace Ui { class FileWorkspaceWidget; } namespace PticaGovorun { class FileWorkspaceWidget : public QWidget { Q_OBJECT private: std::shared_ptr<FileWorkspaceViewModel> model...
#include "Tablero.h" using std::cout; using std::endl; //constructor Tablero::Tablero(){ matriz=NULL; crearMatriz(); } //destructor Tablero::~Tablero(){ for (int i = 0; i < 11; ++i) { delete[] matriz[i]; matriz[i] = NULL; } delete[] matriz; } void Tablero::imprimirMatriz(){ for (int i = 0; ...
// This file was generated based on /usr/local/share/uno/Packages/Fuse.Nodes/1.3.1/Input/Gesture.uno. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Uno.Object.h> namespace g{namespace Fuse{namespace Input{struct GesturePriorityConfig;}}} namespace g{ namespace Fuse{ namespac...
/* * 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 applicable law or ag...
#include<iostream> #include<windows.h> using namespace std; int count; string player1,player2; char player='X'; char matrix[3][3]={'1','2','3','4','5','6','7','8','9'}; void draw(){ system("cls"); /*cout <<"Enter the First palyer name :\n"; cin >> player1; cout <<"Enter the Second player name :\n"; ci...
#include "CalGroupPanel.h" #include "ui_CalGroupPanel.h" using namespace RsaToolbox; #include <QDebug> CalGroupPanel::CalGroupPanel(QWidget *parent) : QWidget(parent), ui(new Ui::CalGroupPanel) { ui->setupUi(this); _model = NULL; QObject::connect(ui->calButton, SIGNAL(clicked()), ...
/* -*- 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 VEGA_PRINTER_LISTENER_SUPPORT #inc...