text
stringlengths
8
6.88M
#include "DataProcess.h" DataProcess::DataProcess() { } DataProcess::~DataProcess() { } bool DataProcess::DataLoad(const char * filename,int numbers) { cv::FileStorage fs(filename, cv::FileStorage::READ); if (!fs.isOpened()) { std::cout << "Open File Error" << std::endl; return false; } st...
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ICharacter.hpp :+: :+: :+: ...
#include <iostream> #include <cstdio> using namespace std; struct Stack{ int top; unsigned capacity; int * array; }; int infixToPostfix(char * exp){ //Create a stack of capacity equal to expression size struct Stack * stack = createStack(strlen(exp)); if(!stack){ //See if stack was created successfully return...
#define SDL_PLUSPLUS_INIT #include <sdl/sdl> #include <SDL2/SDL_video.h> #define LOG(...) fprintf(stdout, __VA_ARGS__) namespace sdl { namespace detail { graphic_context::graphic_context(const window &_w): id(0), context_flags(0), w(_w) { memset(attributes, 0, sizeof(attributes));...
#pragma once #include "glfw3.h" #include "Engine2d.h" #include <string> namespace Engine2d { class DebugCircle { public: std::string name; GLfloat lineVertices[32]; DebugCircle() {}; DebugCircle(float x, float y, float radius, std::string name = ""); void draw() const; private: float x = 0; float y =...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 2010-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 DOM_ACCOUNTMANAGER_SUPPORT #includ...
#include <stdio.h> int main() { int a[3][4]={1,2,3,4,5,6,7,8}; int (*p)[4]=a;//数组的指针,指向大小为4的一维数组 printf("%d\n",*(p)[2]); return 1; }
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2011 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #ifndef OP_WIDGET_H #define OP_WIDGET_H #include "modules/pi/OpI...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define show(x) for(auto i: x){cout << i << " ";} #define showm(m) for(auto i: m){cout << m.x << " ";} typedef long long ll; typedef pair<int, int> P; int main() { int n, m; cin >> n >> m; ...
// // appliquerFiltre.cpp // main // // Created by Wilfried Kamga on 2017-12-01. // #include <stdio.h> #include "common.hpp" using namespace tp3; void appliquerFiltre(const cv::Mat& image, cv::Mat& gradients, const cv::Mat_<float>& noyau, const int ligneDest, const int colonneDest, const ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int a, b, c, d, e, k; bool flag = false; cin >> a >> b >> c >> d >> e >> k; if(b - a > k) flag = true; else if(c - a > k) flag = true; else if(d - a > k) flag = true; else if(e - a > k) flag = true; ...
#include <Digraph.h> #include <DFSearcher.h> bool Digraph::is_acyclic() const { for(auto& n : nods) { if(DFSearcher(*this,n.first).isReachable(n.first)) return false; } return true; }
// Created on: 2003-08-22 // Created by: Sergey KUUL // 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.1 as p...
#ifndef __BANK_HPP__ #define __BANK_HPP__ #include <iostream> #include "Account.hpp" // Definisikan TransactionFailedException di sini // TransactionFailedException merupakan anak dari kelas BaseException, memiliki: // - exc bertipe BaseException* // - constructor menerima argumen exc // - printMessage yang menuliska...
#ifndef SHERLOCK_H #define SHERLOCK_H #include "../Bricks/port.h" #include <vector> #include <string> #include <mutex> #include <memory> #include <thread> #include <type_traits> #include <iostream> // TODO(dkorolev): Remove it from here. #include "../Bricks/net/api/api.h" #include "../Bricks/time/chrono.h" #include...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2008 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Yngve Pettersen ** */ #include "core/pch.h" #if defined(_NA...
#include <iostream> #include <math.h> using namespace std; int main(){ int primecount = 1; int numprim = 2; int i = 1; bool amprime = true; // int root = numprim/2; cout<<"Initialization\n"; while(primecount <= 10001){ double root = sqrt(numprim); for( int i = 1; i <= root; i++){ // cout<<"numprime =...
/* * source.cpp * * Created on: 2021. 6. 9. * Author: dhjeong */ #include <stdio.h> class test{ public: void run() { printf("hello\n"); } };
#ifndef OBJECTSTATUS_H #define OBJECTSTATUS_H #include "Array.h" class Object; class ObjectStatus { friend class Object; private: ObjectStatus(void); ObjectStatus(const ObjectStatus&); public: const Array<Object*>& getAttachedObjects(void); void attach(Object*); void detach(Object*); bool isReadyCrash(void...
class Solution { public: bool isBipartite(int V, vector<int>adj[]){ vector<int> color(V,-1); for(int i = 0;i<V;i++){ if(color[i]==-1){ color[i]= 0; queue<int> q; q.push(i); while(!q.empty()){ int currentVertex = q.front(); q.pop(); for(auto ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2011-2012 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef __OPBATCH_REQUEST_H__ #define __OPBATCH_REQUEST_H__ #in...
/* * Copyright (c) 2020 sayandipde * Eindhoven University of Technology * Eindhoven, The Netherlands * * Name : image_signal_processing.cpp * * Authors : Sayandip De (sayandip.de@tue.nl) * Sajid Mohamed (s.mohamed@tue.nl) * * Date : March 26, 2020 * * Function ...
/* * TInfoBox.cpp * * Created on: May 27, 2017 * Author: Alex */ #include "TInfoBox.h" #include <efl_extension.h> void popup_close_cb(void *data, Evas_Object *obj, void *event_info); TInfoBox::TInfoBox(const char* text):TPopupBox() { elm_popup_align_set(myPopup, 0.5, 0.5); evas_object_size_hint_weigh...
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* configFileParser.cpp :+: :+: :+: ...
#pragma once #include "framework.h" class DftProduct{ protected : int m_nPdCode; // 상품코드 string m_sPdName; // 상품명 string m_sPdCompany; // 제조사 string m_sPdSellerNM; // 판매자 int m_nStock; // 재고 수량 int m_nPrice; // 가격 public : DftProduct(); DftProduct(int code, string name, string company, string seller, int...
// // Created by peto184 on 26-Oct-17. // #ifndef PPGSO_CAMERA_H #define PPGSO_CAMERA_H #include <memory> #include <glm/glm.hpp> #include <ppgso/ppgso.h> #include "src/playground/entities/player.h" class Player; class Camera { public: glm::vec3 up{0,1,0}; glm::vec3 position{0,0,0}; glm::vec3 target{0,0,...
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- // // Copyright (C) 1995-2003 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 // #ifndef __PLUGIN_PAT...
/* kamalsam */ #include<iostream> using namespace std; int main() { int t,i; cin>>t; for(i=0;i<t;i++) { long long third,j,lthird,sum,num,first,diff; cin>>third>>lthird>>sum; num=(2*sum)/(third+lthird); diff=(lthird-third)/(num-5); first=third-(2*diff); cou...
#include "ShapesBlocks.h" void SqrBaseRectBlocks::sortLengthOfCylinder(){ sort(length.begin(), length.end()); cout << "Sorted \n"; for (auto x : length) cout << x << endl; }
/** * Copyright (c) 2022, Timothy Stack * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of condi...
#include "catch.hpp" #include "../Input.h" TEST_CASE("fetcDataFromFile function") { SECTION("Blank reviews file") { Input reviewsInput; reviewsInput.fetchDataFromFile("blankReviews.csv"); REQUIRE(reviewsInput.getReviews().empty()); REQUIRE(reviewsInput.getSentiments().empty()); } SECTION("Multiple review...
#include "msg_0x27_attachentity_stc.h" namespace MC { namespace Protocol { namespace Msg { AttachEntity::AttachEntity() { _pf_packetId = static_cast<int8_t>(0x27); _pf_initialized = false; } AttachEntity::AttachEntity(int32_t _entityId, int32_t _vehicleId) : _pf_entityId(_entityId) , _pf_vehicleId(_vehicleId) { ...
/* -*- 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. * * @author Cihat Imamoglu (cihati) */ #include "core/pch.h" #inc...
#ifndef GAMEHANDLER_H #define GAMEHANDLER_H #include "GameLayer.h" class GameHandler { public: WindowRef window; GameLayer* UI; GameLayer* MainLayer; GameLayer* Background; GameHandler(WindowRef ref); void setWindow(WindowRef window); ~GameHandler(); void drawGame(); }; #endif
#include "TestView.h" MY_IMPLEMENT_DYNCREATE(CTestView, CMyView) CTestView::CTestView() { } CTestView::~CTestView() { }
/* -*- 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. ** */ #ifndef DOM_LSCONTENTHANDLER #define DOM_LSCONTENTHANDLER #if...
#include <iostream> #include <string.h> #include <vector> #include <bitset> #include <map> #include <fstream> #include <algorithm> #include "../lib/structs.cpp" #include "../lib/trie.cpp" /* #ifndef STRUCTS_I #define STRUCTS_I #include "../lib/structs.cpp" #endif #ifndef XCHECK_I #define XCHECK_I #include "../moves/xc...
class BMP2_HQ_CDF; class BMP2_HQ_CDF_DZ: BMP2_HQ_CDF { scope = 2; displayName = "$STR_VEH_NAME_BMP2_CDF"; vehicleClass = "DayZ Epoch Vehicles"; commanderCanSee = 2+16+32; gunnerCanSee = 2+16+32; driverCanSee = 2+16+32; crew = ""; typicalCargo[] = {}; class TransportMagazines {}; class TransportWeapons {}; ...
// File: fileio.cpp // Written by Joshua Green #include <iostream> #include "fileio.h" #include <string> #include <cstdio> #include <iostream> using namespace std; fileio::fileio() { _buffer = 0; _rdbuffer = 0; _file = 0; _clear(); } fileio::~fileio() { close(); } void fileio::_cl...
/******************************************************************************** ** Form generated from reading UI file 'stats.ui' ** ** Created by: Qt User Interface Compiler version 5.13.2 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! **************************************...
/* * DISK READ/WRITE MONITOR * diskrw version 0.1 */ #include <windows.h> #include <pdh.h> #include "resource.h" // conf #define WCLSNAME TEXT( "disk read/write" ) #define WTITLE NULL #define MYWM_NOTIFYICON (WM_APP + 17) #define TM_INTERVAL 500 // time-out value, in milliseconds #define TI...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2006 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * @author karie * */ #include "core/pch.h" #include "adjunct/...
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <cstdio> #include <QDebug> #include <librealsense/rs.hpp> #include <opencv2/opencv.hpp> #include <opencv2/core.hpp> #include <opencv2/highgui.hpp> #include <opencv2/imgproc.hpp> namespace Ui { class Mainwindow; } class Mainwindow : public QMai...
#include <iostream> #include <string> #include "stack.h" #include "queue.h" using namespace std; int main(){ string name = "Abdulmalek"; cs2420::Stack<char> s; for(char c : name){ s.push(c); } while(!s.empty()){ cout << s.pop(); } cout << endl; return 0; }
// Copyright 2018 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 "chrome/browser/web_applications/web_app_registrar.h" #include "chrome/browser/web_applications/components/web_app_helpers.h" #include "chrome/b...
/* Copyright 2021 University of Manchester Licensed under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http: // www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
#include <Qt3D/qglbuilder.h> #include <Qt3D/qglbezierpatches.h> #include "qtjambiglbuilder.h" QtJambiGLBuilder::QtJambiGLBuilder(QGLMaterialCollection *materials) : QGLBuilder(materials){} QtJambiGLBuilder::~QtJambiGLBuilder(){} void QtJambiGLBuilder::addPatches(const QGLBezierPatches &patches){ *this << patches;...
#pragma once // Traver_DLG 对话框 class Traver_DLG : public CDialogEx { DECLARE_DYNAMIC(Traver_DLG) public: Traver_DLG(CWnd* pParent = NULL); // 标准构造函数 virtual ~Traver_DLG(); // 对话框数据 #ifdef AFX_DESIGN_TIME enum { IDD = IDD_DIALOG6 }; #endif protected: virtual void DoDataExchange(CDataExchange* pDX); // DD...
#include "mainwindow.h" #include "ui_mainwindow.h" QString dirs[12]= {"-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-"}; //Очень важно: это массив полных названий приложений, которые нужно будет потом открывать, итак суть: //У нас 12 клавиш, на каждую своё приложение, поэтому мы создаём глобальный массив стр...
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> // UnityEngine.ParticleSystem[] struct ParticleSystemU5BU5D_t808643063; // UnityEngine.ParticleSystem struct ParticleSystem_t56787138; // System.Object struct Il2CppObject; // UnitySt...
#include <iostream> using namespace std; void make_map(int xx, int yy, int wide, int height) // xx, yy는 시작 좌표 { for (int y = yy; y + height + 3; y++) { if () // 시작좌표일 때 || 마지막 좌표일 때 { for (int x = xx; x + wide + 3; x++) { cout << "■"; } } else { // 그 라인의 첫 번째와 마지막 좌표에만 ■...
#include<vector> #include<iostream> using namespace std; class Solution1{ public: int line; int tot; int chessboard[3][50]; vector<int> reslte; Solution1(int a){ line=a; tot=0; reslte.assign(line,0); for(int i=0;i<3;i++){ for(int j=0;j<50;j++){ chessboard[i][j]=0; } } cout<<"start porject.......
#ifndef _МояИгра_Н #define _МояИгра_Н #include <SFML/Graphics.hpp> //аудио #include <SFML/Audio.hpp> //графика #include <sstream> //работа с текстом #include <random> //случайные числа #include <list> //массив обьектов //скаченые библиотеки совместимости с программами SpriteDecomposer и Tiled #include "Аним...
#include "stdafx.h" StockInputException::StockInputException(string inmessage) { message = "StockInputException: "; if (inmessage != "") { message.append(inmessage); } else { "An error occured while trying to read stock data from your input file."; } } string StockInputException::what() { return message; }
#pragma once #include "Commonheader.h" #include "Window.h" #include "TrackBall.h" //入力を管理するマネージャー static class InputManager { public: enum ButtonFlag{ FLAG_SPACE = 1, FLAG_P = 1 << 1, FLAG_R = 1 << 2, FLAG_T = 1 << 3, FLAG_B = 1 << 4 }; enum MoveFlag{ FLAG_UP = 1, FLAG_RIGHT = 1 << 1, FLAG_DOWN = 1...
#include "axis.hpp" using namespace Ogre; void AxisObject::addBox(ManualObject* obj, Vector3 dim, Vector3 pos, ColourValue color, short boxMask) { if(!obj) return; obj->begin("Axis", Ogre::RenderOperation::OT_TRIANGLE_LIST); dim/=2; Ogre::Real l = dim.x; Ogre::Real h = dim.y; Ogre::Real w = dim.z; obj->p...
#include"Convert.h" //Prototype string plusString(string a, string b); string MultiStringTo2(string str); string Power2String(int exp); string Div2String(string num, bool& bit); bool* Convert::DecToBin(QInt num) { bool* result = new bool[128]; for (int i = 127; i >= 0; i--) { result[i] = num.GetBit(i); } re...
#ifndef _FINCHSTD_H_ #define _FINCHSTD_H_ namespace finchstd { int inpInt(const char *); } #endif
#include "StaticObjectPotionView.h" #include "Core.h" void StaticObjectPotionView::initView(StaticObjectModel* staticObjectModel) { m_staticObjectModel = staticObjectModel; //Obtain the atlas key looking up where the mesh is. Could be any mesh. m_atlasKey = Core::singleton().textureManager().findAtlas("cpotion");...
/* * Copyright 2016 Robert Bond * * 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 <bits/stdc++.h> using namespace std; struct Cosa{ vector <int> arreglo; int id; const bool operator < (const Cosa otro ) const{ return id < otro.id; } }; vector<Cosa > soluciones; bool existe[2097155]; long long int problema[25]; long long int N, G, aprobatoria = 0...
// 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 Lesser General Public License version 2.1 as published // by the Free Software Foundation, with spe...
#include <iostream> using namespace std; int n, m; char matrix[51][51]; int ans = 987654321; int check(int iN, int iM){ int flag = (iN + iM) % 2; char base = matrix[iN][iM]; int ret = 0; for (int i = iN; i <= iN + 7; i++){ for (int j = iM; j <= iM + 7; j++){ if (((i + j) % 2 == ...
#ifndef MESHLOADER_H #define MESHLOADER_H //-------------------------------------------------------------------------------------------------------------- #include "Mesh/mesh.h" #include <assimp/scene.h> #include <assimp/Importer.hpp> #include <assimp/postprocess.h> //----------------------------------------------...
#ifndef __PLAYER_H__ #define __PLAYER_H__ #include "common.hpp" #include "board.hpp" #include "gametree.hpp" #define MAX(X, Y) (((X) > (Y)) ? (X) : (Y)) class Player { public: Player(Side side); ~Player(); Move *doMove(Move *opponentsMove, int msLeft); Board *board; // Board used to store Othel...
#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 <map> typedef long long LL; typedef unsigned long long ULL; #define PI 3.141592653589...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-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 __SECURE_MIME_FUNCTIONS_H__ #define __SECURE_MIME_FUNCTI...
struct treeNode { int val; treeNode* parent; treeNode* LeftChild; treeNode* RightChild; }
//Tugas Kendali Motor Servo #include <Servo.h> Servo servo1;//buat objek motor servo 1 Servo servo2; // buat objek motor servo 2 //maksimum 8 objek servo yang bisa dibuat dari library ini int sudut= 0; //variabel untuk menyimpan sudut posisi servo void setup() { servo1.attach(9); serv...
#include "predict.h" // import file to test #include <math.h> #include <random> #include "configfile.h" #include "ut.hpp" using namespace boost::ut; using namespace boost::ut::bdd; /** * I went through the math and came up with a way to test. * The motion model is defined as follows: * \f[ * \vec{x}(t) = [x(t), ...
/* * userList.cpp * * Created on: Apr 7, 2019 * Author: dgv130030 */ #include <iostream> #include <iomanip> #include <utility> #include <string> #include "stack.h" #include "userList.h" bool userList::find(std::string userid) const { // return true if the user id exists and false otherwise return ...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 1995-2007 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * Arjan van Leeuwen (arjanl) */ #include "core/pch.h" #ifdef M2_SUPPORT #include "a...
#include<stdio.h> struct node { int x; //城市编号 int s; //转机次数 }; int main() { struct node que[2501]; int e[51][51] = {0}, book[51] = {0}; int head, tail; int i, j, n, m, a, b, cur, start, end, flag = 0; scanf("%d %d %d %d", &n, &m, &start, &end); //初始化二维矩阵 for(i = 1; i <= n; i++) for(j = 1; j <= n; j++) if...
#include <iostream> #include <vector> using namespace std; typedef vector<double> Vec; typedef vector<Vec> Mat; int main(){ int i, j, m, n; cout << "Enter the number of rows in the matrix \n"; cin >> m; cout << "Enter the number of columns in the matrix \n"; cin >> n; // Allocate space for the vectors Vec...
class Solution { public: vector<vector<int>> threeSum(vector<int>& nums) { if(nums.size()<3) { vector<vector<int>> v; return v; } sort(nums.begin(),nums.end()); vector<vector<int>> result; for(int i=0;i<nums.size()-2;++i) { ...
// // GameBegin.h // GetFish // // Created by zhusu on 15/5/12. // // #ifndef __GetFish__GameBegin__ #define __GetFish__GameBegin__ #include "cocos2d.h" #include "ButtonWithSpriteManage.h" #include "Fish.h" USING_NS_CC; class GameBegin : public CCLayer { public: static const int DEAD_TYPE_NODEAD = 0; ...
#include <string> #include <iostream> #include <vector> using namespace std; int find(int l, int r,int n){ long long m = (l+r)/2; if(m*m==n){ return m; } if(l>r){ return r; } if(m*m>n){ find(l,m-1,n); } else if(m*m<n){ find(m+1,r,n); } } int main(){ int A; cin>>A; cout<<fi...
#include<iostream.h> #include<conio.h> void main() { clrscr(); int x; cout<<"Enter a value for x:"; cin>>x; int s = x * x; cout<<"The Square Root of x:"<<s; getch(); }
// Created on: 2004-11-23 // Created by: Pavel TELKOV // Copyright (c) 2004-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 as ...
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com> // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free So...
#pragma once #include <QWidget> namespace Ui { class AddAppraisedRangeForm; } class AppraisedRange; class AddAppraisedRangeForm : public QWidget { Q_OBJECT public: explicit AddAppraisedRangeForm(QWidget *parent = 0); ~AddAppraisedRangeForm(); void setAppraisedRange(const AppraisedRange &appraisedRang...
#include <iostream> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/socket.h> #include <arpa/inet.h> using namespace std; #define PORT 8822 void die(char *s) { perror(s); exit(1); } int main() { int sockfd; if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) { ...
#include "zerodisplaycomponentprovider.h" using namespace std; namespace sbg { template<int n> DisplayComponentProvider<n> makeZeroDisplayComponentProvier() { return {Vector<n, double>(), Vector<freedom(n), double>(), Vector<n, double>{1}}; } template DisplayComponentProvider<2> makeZeroDisplayComponentProvier<2>(...
#ifndef BOTTOMNAVIGATION_H #define BOTTOMNAVIGATION_H #include "bottombutton.h" #include <QDesktopServices> #include <QEvent> #include <QHBoxLayout> #include <QProcess> #include <QUrl> #include <QMap> #include <DWidget> #include <dimagebutton.h> DWIDGET_USE_NAMESPACE class BottomNavigation : public DWidget { ...
/* * Copyright (c) 2014, Majenko Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list o...
/************************************************************************ * @project : sloth * @class : Line * @version : v1.0.0 * @description : 存储一行文字 * @author : Oscar Shen * @creat : 2017年2月27日21:42:05 * @revise : ************************************************************************ *...
#include<iostream> #include<string> using namespace std; class Solution { public: string convert(string s, int numRows) { //简化版:找规律,循环周期n=2*numRows-2,第一行和第numRows行,按照n间隔摆放 //其他行,每次摆放两个字符,分别按照n-2*(i-1)和2*(i-1)间隔摆放 if(numRows==1) return s; string res; int n=2*numRows-2; for(int i=1;i<=numRows;i++) { in...
#include<stdio.h> #include<conio.h> struct game { int ma; char ten[50]; float tien; char tacgia[100]; }; void them1maychoigame(game a[], int &n) { printf("nhap ma game: "); scanf_s("%d", &a[n].ma); printf("nhap ten: "); gets_s(a[n].ten); printf("nhap gia tien: "); scanf_s("%f", &a[n].tien); printf("nhap t...
#include <iostream> #include <vector> #include <stdlib.h> #include <time.h> using namespace std; struct Node { int i; Node* pLeft; Node* pRight; Node(int iIn) : i(iIn), pLeft(nullptr), pRight(nullptr) {} }; void InsertToTree(Node*& pRoot, Node* pNew) { if (!pRoot) { pRoot = pNew; return; } if (pNew->i ...
#include "pch.h" #include "Input_Keyboard.h" KeyboardEvent::KeyboardEvent() { m_eventType = Event::Invalid; m_key = 0u; } KeyboardEvent::KeyboardEvent(const Event type, const unsigned char key) { m_eventType = type; m_key = key; } bool KeyboardEvent::isPressed() const { return m_eventType == Event::Pressed; } ...
#include"BTree_head.h" int main() { system("color F0"); system("title 图书管理系统"); InitLibrary(); int i; printf("——————————\n"); printf("图书管理系统\n"); printf("——————————\n"); while (1) { printf("1:书本入库 2:借书 3:还书 4:清书 \n5:显示图书 6:查书 7:预约 8:时间链\n0:退出系统\n"); printf("——————————\n"); scanf_s("%d", &i); printf("——...
/* leetcode 486 * * * */ #include <vector> #include <deque> #include <algorithm> using namespace std; class Solution { public: vector<vector<int>> mem; // mem[left][right]: biggest numbers we can get in situation nums[left, right] vector<int> sum; // sum[n]: sum between nums[0, n] int helper(vect...
#pragma once #include "misc.h" #include <QPushButton> using namespace std; enum combinations{ nothing, pair_r, double_pair, set_t, less_streit, big_streit, full_house, kare, poker }; class dice { private: // цена кости double value; //псевдографическая модель QString model; QPushButton *diceButton; ...
#include "Client.h" #include "Server.h" #ifdef WIN32 #define EXPORT __declspec(dllexport) #endif extern "C" { struct NativeServer { Server * engine; }; struct NativeClient { Client * engine; }; struct NativeMsgArg { MsgArg * msg; }; #pragma region Server EXPORT int __stdcall Server_Initiali...
#include <bits/stdc++.h> using namespace std; int main() { int n,p=1; cin>>n; int a[n]; cout<<"Enter Elements"; for(int i=0;i<n;i++) cin>>a[i]; sort(a,a+n); for(int j=0;j<n;j++) { if(a[j]==a[j+1]) cout<<a[j]<<" "; } for(int k=0;k<=n;k++) {...
#pragma GCC optimize("Ofast") #include <algorithm> #include <bitset> #include <deque> #include <iostream> #include <iterator> #include <string> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #include <unordered_map> #include <unordered_set> using namespace std; void abhisheknaiidu()...
#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> typed...
class Solution1 { public: bool increasingTriplet(vector<int>& nums) { int num1 = INT_MAX, num2 = INT_MAX; for(int num : nums){ if(num1 >= num){ num1 = num; }else if(num2 >= num){ num2 = num; }else{ return true; ...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> #define INF 0x3f3f3f3f #define eps 1e-8 #define pi acos(-1.0) using namespace std; typedef long long L...
////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2007, Gogul Balakrishnan, Akash Lal // University of Wisconsin, Madison. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the fo...