text
stringlengths
8
6.88M
// Copyright (c) 1991-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 Lesser General Public License version 2.1 as published ...
/* * MessageBuild.h * * Created on: Jun 11, 2017 * Author: root */ #ifndef MESSAGEBUILD_H_ #define MESSAGEBUILD_H_ #include "Smart_Ptr.h" #include "Network/MessageManager.h" #include "Network/NetWorkConfig.h" #include "./google/protobuf/message.h" #include "ServerManager.h" using namespace std; using name...
#include <cstdio> #include <iostream> #include <stack> using namespace std; struct ListNode{ int val; ListNode *next; ListNode(int x) : val(x) , next(NULL){} }; ListNode *hasCycle(ListNode *head){ ListNode *fast = head; ListNode *slow = head; if(head ==NULL || head->next ==NULL) return NULL; while(fas...
/* * 2013+ Copyright (c) Ruslan Nigatullin <euroelessar@yandex.ru> * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your ...
/* Blink Turns on an LED on for one second, then off for one second, repeatedly. Most Arduinos have an on-board LED you can control. On the Uno and Leonardo, it is attached to digital pin 13. If you're unsure what pin the on-board LED is connected to on your Arduino model, check the documentation at http:/...
#include <iostream> #include <fstream> #include <cctype> #include <vector> #include <list> #include <queue> #include <deque> using std::vector; using std::list; using std::string; using std::priority_queue; using std::deque; struct Vertex { unsigned index, weight; }; inline bool operator > (const Vertex& lhs, c...
#include<iostream.h> #include<conio.h> #include<graphics.h> #include<stdio.h> #include<stdlib.h> #include<dos.h> #include<math.h> #define pi 3.142 void main() { /*----------------------------------------------------------------------------------------------------------*/ void initialize(); void draw(int,int); vo...
#include "../headers/shop.h" #include "../headers/Safe_Input.h" #include "../headers/item.h" #include "../headers/party.h" #include "../headers/FileFunctions.h" #include <stdio.h> #include <stdlib.h> #include <assert.h> int getShopRange() { int cnt = lineCount("./files/Shop_List.txt"); return cnt; } shop* getShop(...
#include <iostream> using namespace std; int main () { char str[80]; char ch; cin.getline(str, sizeof (str)); int n = sizeof(str); cin >> ch; int i = 0, index; while(i < n) { if (str[i] == ch) { index = i; while (index < n) { str[index] =...
#include "Physics.h" #define MAX_LINEAR_VELOCITY 340.0f #define MAX_ANGULAR_VELOCITY (PI * 60.0f) //積分 void Physics::Integrate(RigidbodyState &state, unsigned int numRigidbodys, float timestep){ Quat dAng = Quat(state.m_angularVelocity, 0)*state.m_orientation*0.5f; state.m_position += state.m_linearVelocity * ti...
#include <iostream> #include <limits> using namespace std; int main() { //Variable for creating spaces for the triangles int space; //this loop creates the rows for the first triangle for (int i = 1; i <= 5; ++i) { //this loop populates rows with * for (int k = 1; k <= i; ++k) { cout << "*"; ...
#ifndef MENU_H #define MENU_H #include "../Shoikoth/person.hpp" class Menu { protected: public: void mainMenu() { cout<<"1.Log in."<<endl; cout<<"2.Sign up."<<endl; cout<<"3.Forgot Password."<<endl; } private: void display(Person* p) { if(p->getType() == "c") cMenu...
#include <iostream> #include <string> #include <vector> using namespace std; int main(){ vector<string> song{ "Happy", "birthday", "to", "you", "Happy", "birthday", "to", "you", "Happy", "birthday", "to", "Rujia", "Happy", "birthday", "to", "you"}; vector<string> names(100); ...
// File: Main.cpp // Author: Rionaldi Chandraseta - 13515077 // Written on 2017-03-31 #include <algorithm> #include <chrono> #include <fstream> #include "Matrix.h" #include "RCMatrix.h" #include "CTMatrix.h" int main() { std::chrono::time_point<std::chrono::system_clock> start, end; std::string FileName; std::...
#include <bits/stdc++.h> using namespace std; ofstream fout ("paint.out"); ifstream fin ("paint.in"); int main() { int a,b,c,d; fin >> a>>b>>c>>d; if (b < c || a > d){ fout << (b+d-a-c)<<"\n"; } else{ fout << max(b,d) - min(a,c)<<"\n"; } return 0; }
// // IMService.cpp // MyCppGame // // Created by 杜红 on 2017/1/22. // // #include "IMService.hpp" #include <string> #include <ctime> #include "cocos2d.h" USING_NS_CC; #include "YouMeVoiceEngineImp.hpp" IMService* IMService::_instance = NULL; extern string g_roomName; extern string g_userID; #include "AutoRandTest...
/* * Kimura * * Copyright (c) 2009-2010 Chris Barber <chris@cb1inc.com> * All rights reserved. * * Use and distribution licensed under the BSD license. See the * COPYING file in the root project directory for full text. */
/***************************************************************************************************************** * File Name : linearprobing.h * File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\tutorials\nptel\DSAndAlgo\lecture05\linearprobing.h * Created on : Dec 30, 2013 :: 11:59:03 AM *...
#pragma once #include "Vector.h" #include "Value.h" class GC; class Array { void append(Array *a) { append(a->buf(), a->size()); } void append(char *s, int size); static Array *alloc(GC *gc, Vector<Value> *vect); public: Vector<Value> vect; static Value sizeField(VM *vm, int op, void *data, V...
// kumaran_14 // #include <boost/multiprecision/cpp_int.hpp> // using boost::multiprecision::cpp_int; #include <bits/stdc++.h> using namespace std; // ¯\_(ツ)_/¯ #define f first #define s second #define p push #define mp make_pair #define pb push_back #define eb emplace_back #define rep(i, begin, end) for (__typeof...
/* * 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 <quic/api/QuicStreamAsyncTransport.h> #include <quic/client/QuicClientTransport.h> namespace quic { /** ...
#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...
// Created on: 1995-12-01 // Created by: EXPRESS->CDL V0.2 Translator // Copyright (c) 1995-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 te...
#ifndef _CCHECK_MNICK_h_ #define _CCHECK_MNICK_h_ #include <string> #include "CHttpRequestHandler.h" class CCheckMnick : public CHttpRequestHandler { public: CCheckMnick(){} ~CCheckMnick(){} virtual int do_request(const Json::Value& root, char *client_ip, HttpResult& out); }; #endif
#ifndef PGTOOLS_SIMPLEPGMATCHER_H #define PGTOOLS_SIMPLEPGMATCHER_H #include "../pseudogenome/PseudoGenomeBase.h" #include "../pseudogenome/readslist/SeparatedExtendedReadsList.h" #include "TextMatchers.h" namespace PgTools { using namespace PgSAIndex; struct PgMatch; class SimplePgMatcher { privat...
/**************************************************************************** ** Copyright (C) 2017 Olaf Japp ** ** This file is part of FlatSiteBuilder. ** ** FlatSiteBuilder is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free S...
class OsVersionChecker { public: bool IsOS(AnsiString szOsName); AnsiString GetSystemVersion(void); }; class SystemSoftware { private: public: // OSInfo OS; // SystemSoftware(); // ~SystemSoftware(); };
// MFCApplication1Dlg.cpp : implementation file // #include "stdafx.h" #include "MFCApplication1.h" #include "MFCApplication1Dlg.h" #include "afxdialogex.h" //#include <shellapi.h> #ifdef _DEBUG #define new DEBUG_NEW #endif // CMFCApplication1Dlg dialog CMFCApplication1Dlg::CMFCApplication1Dlg(CWnd* pParent /*=...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2003 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef MAILSTOREUPDATEDIALOG_H #define MAILSTOREUPDATEDIALOG_H ...
#include<bits/stdc++.h> using namespace std; main() { char main_string[1000], reserve[1000], output_string[1000]; int i, j; while(gets(main_string)) { int len1 = strlen(main_string); int pos = 0, k = 0; for(i=0; i<=len1; i++) { if(main_string[i]!= 32 && i<len1) { ...
//--------------------------------------------------------------------------- #ifndef udpsocketH #define udpsocketH #include <vcl.h> #include <winsock.h> #include "CommFunc.h" //udp socket对象,即是客户端又是服务器端 typedef void __fastcall (__closure *TOnUDPError)(int ErrorCode,const String &ErrorInfo); typedef void __fastcall (__...
//わからなかった問題の解説をひとつずつかみ砕いた int main(void) { int h, w; cin >> h >> w; string board[50]; for (int i = 0; i < h; ++i) cin >> board[i]; const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; //それぞれもとになるマスから上下左右斜めに1マスずれた座標 for (int i = 0; i < h; ++i) { // i回繰り返す(縦軸) for ...
 // LANScannerDlg.h: 头文件 // #pragma once #include "NIC.h" #include "Device.h" #include "EthernetFrame.h" #include "PDU.h" #include "ARP.h" // Declare user message ID #define WM_COMPLETE (WM_USER + 100) #define WM_HOST (WM_USER + 101) // CLANScannerDlg 对话框 class CLANScannerDlg : public CDHtmlDialog { // 构造 public: ...
// // Hora.cpp // Aeropuerto // // Created by Daniel on 01/11/14. // Copyright (c) 2014 Gotomo. All rights reserved. // #include "Hora.h" Hora::Hora(){ hour =0; minutes = 0; } Hora::Hora(int ñ){ std::string ho; std::string temp; std::cin>>ho; for(int i = 0;i < 2; i++){ temp += ho[...
#include <iostream> using namespace std; int main() { double x,y,z; cin>>x>>y>>z; if (x<0||y<0||z<0) cout<<"-1"; else if(x+y>z&&y+z>x&&z+x>y) if(x*x+y*y==z*z||y*y+z*z==x*x||z*z+x*x==y*y) cout<<"1"; else cout<<"0"; else cout<<"-1"; return 0; }
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2003 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef LINK_STYLE_DIALOG_H #define LINK_STYLE_DIALOG_H #include...
/* Solver for the linear hyperbolic equation du/dt + div (b u) = 0 by an explicit time-stepping method */ #include <solve.hpp> #include <python_ngstd.hpp> #include <general/seti.hpp> using namespace ngsolve; using ngfem::ELEMENT_TYPE; template<int D> class Convection { protected: shared_ptr<L2HighO...
#include <fstream> #include <stdio.h> #include "Errors.h" #include "SortedFile.h" #include "HeapFile.h" using std::ifstream; using std::ofstream; using std::string; extern char *catalog_path; extern char *dbfile_dir; extern char *tpch_dir; int SortedFile::Create(char *fpath, void *startup) { if (fpath == NULL || s...
#include <sstream> #include <cppunit/extensions/HelperMacros.h> #include <Poco/AtomicCounter.h> #include <Poco/Environment.h> #include <Poco/Event.h> #include <Poco/NumberParser.h> #include <Poco/Thread.h> #include <Poco/RunnableAdapter.h> #include <Poco/Net/SocketAddress.h> #include <Poco/Net/StreamSocket.h> #inclu...
// // EPITECH PROJECT, 2018 // zappy // File description: // StaticText.cp // #include "StaticText.hpp" StaticText::StaticText(irr::gui::IGUIStaticText *tx, int id) { _id = id; txt = tx; } StaticText::~StaticText() { } int StaticText::getId() const { return _id; } void StaticText::setText(const char *str) { ...
// // Created by glyphack on 7/11/19. // #ifndef CRAWLLALA_FOOD_H #define CRAWLLALA_FOOD_H #include <SFML/Graphics.hpp> #include <iostream> namespace game { /* Food: represents the Food object snake eats. It is represented by a sf::RectangleShape */ class Food { public: Food(sf::Rend...
#include <iostream> int firstConversion(int number, int system) { int convertNumber = 0; int index = 1; while (0 != number) { convertNumber += (number % system) * index; number /= system; index = index * 10; } return convertNumber; } void secondConversion(int number, int sys...
#include<iostream> using namespace std; struct node { int data; node *left, *right; }*root; node* addNode(int); void traverse(node *); int diameter(node *); int height(node *); int diameterOpt(node *, int *); int max(int, int); int main() { root = addNode(10); root->left = addNode(12); root->right = addNo...
/* * 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. */ #include <common/init/Init.h> #include <folly/Benchmark.h> #include <quic/state/QuicPriorityQueue.h> #include <vector> using nam...
#include "stdafx.h" #include <Windows.h> #include <Shlwapi.h> #include <assert.h> #include "DiskFile.h" IFile* OpenDiskFile(const char* name, IFile::OpenMode mode) { if(!PathFileExistsA(name) && mode != IFile::O_Truncate) return 0; else return new DiskFile(name, mode); } DiskFile::DiskFile(cons...
#include "_pch.h" #include "ViewBrowser.h" #include "globaldata.h" #include "wxDataViewIconMLTextRenderer.h" #include "wxComboBtn.h" #include "config.h" #include <wx/uiaction.h> using namespace wh; //----------------------------------------------------------------------------- //--------------------------------------...
#include "hmi_message_publisher/const_vars.h" #include <vector> namespace HMI { namespace SL4 { namespace hmi_message { using VectorDataType = std::vector<unsigned char>; /* * Define hmi_sl4 Lane general info Message * If the input was outside of the range, it would store the min/max value instead */ class Obstac...
#ifndef _SNOW_FILE #define _SNOW_FILE #include "comn.h" #include "SnowInfo.h" class SnowFile { std::map<std::string,SnowInfo> allRecords; public: SnowFile(){}; SnowFile(std::string filename) { InitFromFile(filename); }; bool InitFromFile(std::string filename) { std::ifstream fin(fil...
#ifndef _EVENT_H_ #define _EVENT_H_ using namespace irr; using namespace core; using namespace gui; class CEvent : public IEventReceiver { public: typedef enum { LeftButton, MiddleButton, RightButton } EButton; CEvent(); virtual bool OnEvent(const SEvent&); bool isKeyDown(...
/** * Copyright (c) 2014, 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 <climits> #include <cstdio> #include <string> #include <ostream> #include <sstream> #include <iomanip> #include "text_files.h" #include "linalg.h" #include "config.h" struct Result { vec2 current; vec2 current_std; double tau; double n_opt; double n_ac; }; double random_...
/*==================================================================== Copyright(c) 2018 Adam Rankin 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 without limitati...
#include "Voter.h" class VoterDB { public: VoterDB(); VoterDB(int v); void populate(ifstream &infile); int user_exists(string userid); Voter& get_voter(int i); float sum_donations() const; bool is_full(); void add_user(string last_name, string first_name, string userid, string password, string age, st...
// Example 5.1 : scope, memory management unique_ptr // Created by Oleksiy Grechnyev 2017, 2020 // Class Tjej is used a lot here, it logs Ctors and Dtors #include <iostream> #include <string> #include <memory> #include "Tjej.h" using namespace std; // Global variable Tjej glob("Globula Statika"); //=============...
/* * File: Waypoint.cpp * Author: mohammedheader * * Created on November 24, 2014, 2:22 PM */ #include "HelloWorldScene.h" #include "Waypoint.h" USING_NS_CC; Waypoint* Waypoint::create(HelloWorld* game, cocos2d::Vec2 location) { Waypoint *wayPoint = new (std::nothrow) Waypoint(); if (wayPoint && wayPo...
#include<iostream> #include<vector> #include<algorithm> using namespace std; struct ListNode { int val; ListNode* next; ListNode(int x) : val(x), next(NULL) {} }; void Init_ListNode(ListNode* head, vector<int> vec) { if (vec.size() == 0) { head = NULL; return; } ListNode* p; p = head; p->val = vec[0]; for...
#ifndef WINDOWSSVGFONT_H #define WINDOWSSVGFONT_H #ifdef SVG_SUPPORT #include "modules/svg/src/SVGFont.h" #include "modules/svg/src/SVGTransform.h" class OpFont; class WindowsSVGFont : public SVGSystemFont { private: static const int buffer_size; SVGTransform m_text_transform; SVGnumber m_size; public: Win...
#pragma once #include "myBook.h" class Gossip : public myBook{ private : int m_nMonth; public : Gossip() : m_nMonth(0) {}; Gossip(string title, string author, string company, int price, int month) : myBook(title, author, company, price), m_nMonth(month){ } Gossip(const char* title, const char* author, const char...
#pragma once #include <string> #include <fstream> using namespace std; class Config { public: Config(void); ~Config(void); static string strPPIFileName; static string strSequenceFileName; static string strGoldensetFileName; static string strPeptideProphetResult; static char cSplitChar; static int iRunTimes;...
// // main.cpp // baekjoon // // Created by 최희연 on 2021/05/03. // #include <iostream> using namespace std; int main(int argc, const char * argv[]) { // insert code here... int n, x; cin >> n >> x; for(int i=0;i<n;i++) { int a; cin >> a; if(a<x) cout<<a<<" "; ...
// // NetException.cpp // // $Id: //poco/1.4/Net/src/NetException.cpp#4 $ // // Library: Net // Package: NetCore // Module: NetException // // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. // and Contributors. // // SPDX-License-Identifier: BSL-1.0 // #include "_Net/NetException.h" #include...
#include <iostream> #include "servant/Application.h" #include "FightData.h" using namespace taf; using namespace std; taf::CommunicatorPtr g_connPtr; void doTest(bool bCout) { ServerEngine::FightDataPrx fightPrx = g_connPtr->stringToProxy<ServerEngine::FightDataPrx>("ServerEngine.FightDataServer.FightDataObj@tcp ...
#include "../include/CoinScoreManager.h" namespace gnGame { CoinScoreManager* CoinScoreManager::getIns() { static CoinScoreManager Instance; return &Instance; } void gnGame::CoinScoreManager::addScore() { ++coinScore.score; } void gnGame::CoinScoreManager::resetScore() { coinScore.score = 0; } in...
#include <iostream> void numTo(unsigned number, unsigned& sys) { if (number < sys) { std :: cout << number; return; } numTo(number / sys, sys); if (number % sys < 10) { std :: cout << number % sys; } else { std :: cout << char('A' + number % sys - 10); } } void ...
// StringFileReader // // A class for reading a file // // Last modified 2009-02-17 by Willi #ifndef TextReader_H #define TextReader_H #include <string> #include <iostream> #include <vector> #include <sstream> #include "CLArguments.h" ///Stuff from the "C++ AG" at school namespace cppag { ///A class for readin...
template <typename T> inline Matrix<T,4,4>::Matrix() : data{ Vector<T,4>(1,0,0,0), Vector<T,4>(0,1,0,0), Vector<T,4>(0,0,1,0), Vector<T,4>(0,0,0,1)} { } template <typename T> inline Matrix<T,4,4>::Matrix(T m00, T m01, T m02, T m03, T m10, T m11, T m12, T m13, T m20, T m21, T m22, T m23, T m30, T m31, T m32, T m3...
#include "switch.h" #include <iostream> Switch::Switch():Life() { Life::image.load("button.png"); //loads image Life::rect = image.rect(); //assigns image } Switch::~Switch() { std::cout << ("Switch deleted\n"); }
#ifndef CPVS_H #define CPVS_H #include <cassert> #include <string> #include <vector> #include <unordered_map> #include <memory> #include <exception> #include <cmath> #include <GL/glew.h> #include <GLFW/glfw3.h> using std::string; using std::vector; using std::shared_ptr; using std::unique_ptr; using std::array; usin...
#include<iostream> #include<vector> #include<list> using namespace std; class Graph{ int Vertices; list<int> *adj; void DFSUtil(int u,bool visited[]); public: Graph(int V); void addEdge(int u,int v); int countTree(); }; Graph::Graph(int V){ this->Vertices=V; this...
#include<stdio.h> #include<string.h> char ar1[1000000],ar2[1000000]; int main(int argc, char const *argv[]) { int len1, len2; int sum; scanf("%s%s",&ar1,&ar2); len1 = strlen(ar1); len2 = strlen(ar2); for (int i = 1; i <=3; ++i) { sum = (int)ar1[i]+(int)ar2[i]; printf("%d\n",s...
// Copyright (c) 2007-2016 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/executors/thread_pool_executor.hpp> namespace pika:...
#include<iostream> #include<vector> #include<queue> #include<set> using namespace std; const int d[]={2,3,5}; set<long long> s; priority_queue<long long,vector<long long>,greater<long long> > line; int main() { s.insert(1); line.push(1); for (int i = 1;; i++) {long long x=line.top();line.pop(); if ...
#include<string> #include<iostream> #include<vector> using namespace std; class Solution { public: ListNode* swapPairs(ListNode* head) { if (head == nullptr || head->next == nullptr) { return head; } ListNode* newHead = head->next; head->next = swapPairs(newHead->next);...
#pragma once #include <stdexcept> namespace dot_pp { namespace lexer { class TokenInfo; enum class TokenizerState; }} namespace dot_pp { namespace parser { enum class ParserState; }} namespace dot_pp { class ParserError : public std::runtime_error { public: ParserError(const std:...
#include<stdio.h> #include<stdlib.h> #include<conio.h> struct node { int data; struct node *prev; struct node *next; }; int countnodes(struct node *head); struct node *DLLtoBST(struct node **ptr,int n); void insert(struct node **ptr,int a) { struct node *newnode; ...
/**************************************************************** File Name: recyqueue.C Author: Tian Zhang, CS Dept., Univ. of Wisconsin-Madison, 1995 Copyright(c) 1995 by Tian Zhang All Rights Reserved Permission to use, copy and modify this software must be granted by the autho...
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ShrubberyCreationForm.cpp :+: :+: :+: ...
// This file is triangularView of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr> // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published b...
#pragma once #include "..\Common\Pch.h" #include "..\Graphic\Direct3D.h" class Material { public: Material(); ~Material(); void Initialize(); void SetMaterial(D3DXVECTOR4 ambient, D3DXVECTOR4 diffuse, D3DXVECTOR4 specular, FLOAT specularPower); void SetBuffer(RB_Type materialType); private: struct BufferD...
#include <bits/stdc++.h> using namespace std; string s; vector<int> mx1,mx2,mn1,mn2; int sum_1,sum_2; int main(){ cin>>s; for(int i=0;i<3;++i){ sum_1+=s[i]-'0'; mx1.emplace_back(9-(s[i]-'0')); mn1.emplace_back(s[i]-'0'); } for(int i=3;i<6;++i){ sum_2+=s[i...
// // include: rawdata.h // // last update: '18.xx.xx // author: matchey // // memo: // #ifndef PERFECT_VELODYNE_RAWDATA_H #define PERFECT_VELODYNE_RAWDATA_H #include <errno.h> #include <stdint.h> #include <string> #include <boost/format.hpp> #include <math.h> #include <ros/ros.h> #include <pcl_ros/point_cloud.h> #...
#include<bits/stdc++.h> using namespace std; main() { int m, s, i, t; string x, y; cin>>m>>s; if(s==0) { cout<<(m==1 ? "0 0":"-1 -1"); return 0; } for(i=0; i<m; i++) { t = min(s, 9); y += t+'0'; s -= t; } if(s>0) { cout<<"-1 -1"...
#ifndef CREATECOMMITMENT_H #define CREATECOMMITMENT_H #include <Interval.h> #include <QCheckBox> #include <QDateEdit> #include <QIntValidator> #include <QLineEdit> #include <QWidget> #define WRITING_STRING "Writing" #define MUSIC_STRING "Compose Music" #define CUSTOM_STRING "Custom" namespace Ui { class CreateCommitm...
/* Erronious GPL licence text and copyright removed. * See lth's comment to https://cvs.intern.opera.no/viewcvs/viewcvs.cgi/Opera/lib/Mail/liboe.cpp?hideattic=0&r1=2.6&r2=2.7 * "Removed an incorrect copyright notice at the instruction of VPE." */ #include "core/pch.h" #ifdef M2_SUPPORT # if !defined(_UNIX_DESKTOP_...
#pragma once #include "Camera.h" #include <GLFW/glfw3.h> #include <iostream> #include <functional> #include "GUIWrapper.h" using namespace HW; using namespace std; class CameraSpeed { public: float speed_base = 0.0005; int level = 3; int MinLevel = 1; int MaxLevel = 10; float speed=1.0; CameraSpeed() { CalcSp...
#include <iostream> #include <cstring> #include <queue> #include <vector> #include <algorithm> #define MAX 5001 #define INF 1e12 typedef long long ll; int n, q; std::vector<std::pair<int, ll>> USADO[MAX]; int find(int idx, ll v) { std::queue<std::pair<int, ll>> q; bool visited[n + 1]; int ret = 0; s...
#include "LazyTermBuilders.h" #include <cassert> /** * LazyTermBuilder */ LazyTermBuilder *LazyTermBuilder::from(term_t term) { switch (PL_term_type(term)) { case PL_ATOM: return LazyAtomBuilder::from(term); case PL_STRING: return LazyStringBuilder::from(term); case PL_TERM: if (!PL_is_list(term...
 #include <iostream> #include <cmath> using namespace std; int main() { setlocale(LC_ALL, "Russian"); int* a; int n, i, c, w; cout << "Введите размерность массива "; cin >> n; a = new int[n]; for (i = 0; i < n; i++) a[i] = rand() % 20 - 10; cout << "---------- Исходный массив ------------" << endl; for (i ...
// // Created by 钟奇龙 on 2019-05-21. // #include <iostream> #include <string> #include <vector> using namespace std; string manacherString(string str){ int targetLength = 2 * str.size() + 1; string manacher = ""; for(int i=0; i<targetLength; ++i){ if(i % 2 == 0){ manacher.push_back('#');...
// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "GameFramework/GameModeBase.h" #include "Surviving_GroundsGameMode.generated.h" UCLASS(minimalapi) class ASurviving_GroundsGameMode : public AGameModeBase { GENERATED_BODY() public: ASurviving_GroundsGameMo...
#include<bits/stdc++.h> using namespace std; class node{ public: int data; node* left; node* right; node(int d){ this->data = d; this->left = NULL; this->right = NULL; } }; node* buildTree(node* root){ int data; cin>>data; if(data == -1) return ...
// // Player.h // // Created by Yajun Shi // // The user-controlled actor, has abilities of moving and shooting. // #include "stdafx.h" #ifndef __ClientGame__Player__ #define __ClientGame__Player__ class Player : public PhysicsActor { public: Player(); virtual void Update(float dt); virtual ...
#ifndef MATH_RANDOM_HEX_HPP #define MATH_RANDOM_HEX_HPP #include <string> #include <sstream> #include <random> namespace Math { static std::string randomHexColor() { static const std::string chArr = "1234567890abcdef"; std::random_device rd; std::mt19937 gen(rd()); std::unifor...
#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 <stdio.h> #include <stdlib.h> #include <iostream> #include <sstream> #include <fstream> #include <string.h> #include <algorithm> #include <math.h> #include <map> #include <vector> #include "ResultsReader.h" using namespace std; int main(int argc,char** argv){ if(argc != 9){ cout<<"\nUsage: ./generat...
#pragma once #include <LogListenerInterface.h> #include <StringHelper.h> #include <list> #include <memory> namespace breakout { class LogManager { public: static LogManager& Get(); void Init(); void AddListener(std::shared_ptr<ILogListener> listener); void Log(const ILogMessage& message...
#pragma once class CMyClass { public: CMyClass(void); ~CMyClass(void); // speak int Say(void); // eat void eat(void); };
/* Author: Visar Shehu Email: v.shehu@seeu.edu.mk File created: 19.10.2016 Last revision: 19.10.2016 */ #include <iostream> #include <string> using namespace std; struct ADRESA { int housenumber; string streetname; string zipcode; }; int main() { ADRESA a1, a2, a3; ADRESA a[3]; for (int i = 0; i < 3; i++) { ...
// -*- coding:utf8 -*- // -*- кодировка:utf8 -*- #include <iostream> #include <libledmatrix/ledmatrix.h> #include <yqnet/yqlib.h> #include <unistd.h> #include "config.h" #include <string> const char * IP = "192.168.0.199"; const uint16_t PORT = 80; const char * LOGIN = "guest"; void test1() { struct LED...
/** *** Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by *** The Board of Trustees of the University of Illinois. *** All rights reserved. **/ #include <stdlib.h> #include <math.h> #include "PmeKSpace.h" static void dftmod(double *bsp_mod, double *bsp_arr, int nfft) { int j, k; double twopi, arg, sum1, sum2...