text
stringlengths
8
6.88M
class ItemEtool : ItemCore { scope = 2; model = "\dayz_equip\models\etool.p3d"; picture = "\dayz_equip\textures\equip_etool_ca.paa"; displayName = $STR_EQUIP_NAME_1; descriptionShort = $STR_EQUIP_DESC_1; }; class ItemEtoolBroken : ItemCore { scope = 2; model = "\dayz_equip\models\etool.p3d"; picture = "\dayz_...
#include "shadermanager.hpp" ShaderManager::~ShaderManager() { if(!this->shaderModules.empty()) { std::cout << "Not all shader mouldes have been manually deleted. " "Automatically deleting:" << std::endl; for(const auto &[shaderName,shaderID] : this->shaderModules) { std::cout << '\t' << shaderName <<...
// #pragma once #ifndef MJASON_H #define MJSON_H #include <iostream> #include <vector> #include <string> #endif // !MJASON_H
// HKRuleSettingDlg.cpp : implementation file // #include "stdafx.h" #include "BHMonitor.h" #include "HKRuleSettingDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CHKR...
#include <iostream> #include <fstream> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <algorithm> #include <math.h> using namespace std; int n, s[111][111]; void input() { scanf("%d", &n); for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) scanf("%d", &s[i][j]);...
#include <stdio.h> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <vector> #include "discretize.h" #include "common.h" #include "decisiontree.h" void test1(){ std::vector<cv::Mat> images; std::vector<cv::Mat> patches; read_imgList("im...
#ifndef CCATEGORYFACTORY_H #define CCATEGORYFACTORY_H #include <QObject> #include "common.h" class CDriverCategory; class CERPCategory; class CWebCategory; #define DATA QMap<QString, QMap<QString, SoftData> > #define DATATTERATOR QMapIterator<QString, QMap<QString, SoftData> > #define DATASOFT QMap<QString, SoftDa...
#ifndef EDITWINDOW_H #define EDITWINDOW_H #include <QWidget> #include <QDebug> #include "library.h" #include "book.h" namespace Ui { class EditWindow; } class EditWindow : public QWidget { Q_OBJECT public: explicit EditWindow(QWidget *parent = nullptr); void setLibrary(Library *library, bool editMode=f...
#define GLUT_DISABLE_ATEXIT_HACK #include <windows.h> #include <math.h> #include "GL/glut.h" #include <iostream> #define KEY_ESC 27 using namespace std; void create_Square(double centerX, double centerY, double longitude) { glBegin(GL_LINE_LOOP); glColor3d(255, 0, 0); glVertex2f(centerX - (longitude / 2), centerY +...
#include "stdlib.h" #include "iostream" #include "stdio.h" #include "sstream" #include "serial_port.h" #include "ahrs_serial.h" #include "ros/ros.h" #include "sensor_msgs/Imu.h" #include "sensor_msgs/MagneticField.h" using namespace std; using namespace ros; /***********NOTE: set these define will cause topic freque...
#include<stdio.h> int orderSearch(int a[], int n, int key) { for (int i = 0; i < n; i ++) { if (a[i] == key) return i; } return -1; } int midSearch(int a[], int n, int key) { int low = 0, high = n - 1; while (low <= high) { int mid = (low + high) / 2; if (a[mid] == key) return mid; if (a[mid] >= key) ...
#include <cassert> #include "LongIdRecord.h" #include <fstream> #include "StreamUtilities.h" using namespace std; using namespace OpenFlight; //------------------------------------------------------------------------- LongIdRecord::LongIdRecord(PrimaryRecord* ipParent) : AncillaryRecord(ipParent) {} //--------------...
// Copyright (c) 2015 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 special ...
// Created on: 1995-06-13 // Created by: Jacques GOUSSARD // 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 terms of the G...
#include "Vector.h" Vector::Vector() { _x = 0; _y = 0; _z = 0; } Vector::Vector(float x, float y, float z) { _x = x; _y = y; _z = z; } float Vector::GetX() const { return _x; } void Vector::SetX(const float x) { _x = x; } float Vector::GetY() const { return _y; } void Vector::SetY(const float y) { _y...
// // Created by ischelle on 05/05/2021. // #include "Board.hpp" #include <fstream> #include <iostream> #include <istream> #include <sstream> #include <string> namespace pandemic { Board::Board() { //Populate color_map color_map.insert(std::make_pair("Yellow", Color::Yellow)); color_map.insert(std:...
/* BEGIN LICENSE */ /***************************************************************************** * SKCore : the SK core library * Copyright (C) 1995-2005 IDM <skcontact @at@ idm .dot. fr> * $Id: inifile.cpp,v 1.4.4.3 2005/02/17 15:29:21 krys Exp $ * * Authors: Mathieu Poumeyrol <poumeyrol @at@ idm .dot. fr> * ...
#pragma once #include "EnemyObject.h" class EnemyShobonTower : public EnemyObject { public: EnemyShobonTower(const long x, const long y, const long animeNo); virtual ~EnemyShobonTower(); void Init(); // 初期化 void Move(); // 移動 void Draw(); // 描画 private: float accelY; // 加速度Y float gravity; // 重量 };
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4; -*- * * Copyright (C) 2007-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 POSIX_OK_SIGNAL #include "platforms/posix/posix_signal_wa...
/* * Copyright (c) 2021 Morwenn * SPDX-License-Identifier: MIT */ #ifndef CPPSORT_DETAIL_MAKE_ARRAY_H_ #define CPPSORT_DETAIL_MAKE_ARRAY_H_ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include <array> #include <cstddef> #includ...
#include <iostream> #include <vector> #include <algorithm> #include <string> int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0); int a, b; std::cin >> a >> b; auto func = [](int n) { int r{}; while (n) { r = r * 10 + n % 1...
#include <iostream> double add(double n, double m) { return n + m; } double subtract(double n, double m) { return n - m; } double multiply(double n, double m) { return n * m; } double divide(double n, double m) { return n / m; } using namespace std; int main() { double n, m; char op; ...
#ifndef SYNC_H #define SYNC_H #include <QJsonArray> #include <QJsonDocument> #include <QJsonObject> #include <QObject> #include <QNetworkAccessManager> #include <QNetworkReply> #include <QNetworkRequest> #include <QTimer> #include "Database.h" namespace Qai { class Sync : public QObject { Q_OBJECT public: exp...
#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...
#include "routed.hpp" #include "client.hpp" #include "log.hpp" #include "utils/time_utils.hpp" #include "utils/client_process_mgr.hpp" #include "proto/ss_route.pb.h" namespace nora { namespace route { using client_mgr = client_process_mgr<client>; routed::routed(const shared_p...
/* BEGIN LICENSE */ /***************************************************************************** * SKFind : the SK search engine * Copyright (C) 1995-2005 IDM <skcontact @at@ idm .dot. fr> * $Id: fs.h,v 1.30.2.3 2005/02/21 14:22:45 krys Exp $ * * Authors: Mathieu Poumeyrol <poumeyrol @at@ idm .dot. fr> * ...
#include <reactor/base/Timestamp.h> #include <reactor/base/SimpleLogger.h> #include <reactor/net/EventLoop.h> #include <reactor/net/TimerId.h> #include <reactor/net/TimerQueue.h> using namespace reactor; using namespace reactor::base; using namespace reactor::net; EventLoop loop; TimerQueue queue(&loop); TimerId id1...
#ifndef CNASCOM_H #define CNASCOM_H #include <CZ80.h> #include <CImagePtr.h> #include <CRGBA.h> class CNascomPortData; class CNascomRenderer { public: CNascomRenderer() { } virtual ~CNascomRenderer() { } virtual void clear(const CRGBA &bg) = 0; virtual void drawImage(int x, int y, CImagePtr image) = 0; }...
#include "recupPageHTML.hpp" #include <QtCore/QUrl> #include <QtCore/QEventLoop> #include <QtNetwork/QNetworkRequest> #include <QtNetwork/QNetworkReply> void RecupPageHTML::recuperationAsynchrone( const std::string & inUrl ) { connect( &nam_, SIGNAL( finished( QNetworkReply * ) ), this, SLOT( telec...
#include "Animaux.h" //Le constructeur de Animal qui prend un cri, un age et un age Max en paramètres Animal::Animal(string cri,int age,int ageMax) { //on met à jour les variables de la classes grace aux paramètres : this->cri=cri; this->age=age; this->ageMaximum=ageMax; } //le destructeur de Animal : ...
// Copyright (C) 2014, 2015, 2016 Alexander Golant // // This file is part of csys project. This project 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 3 of the License, or // (at your...
// 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; int main(){ int n; cin >> n; vector<int> v(n+1); int ans = 0; for(int i=0; i<n; i++){ int a; cin >> a; if(a > n) ans++; else v[a]++; } for(int i=1; i<=n; i++){ if(v[i] >= i) ans += v[i] - i;...
#include "Q45.h" BiTree* createBTree(){ /** A * / \ * B C * / \ / \ * D E F G */ vector<char> names = {'A', 'B', 'C', 'D', 'E', 'F', 'G'}; vector<int> data = {1, 2, 3, 4, 5, 6, 7}; BiTree* tree = new BiTree(names...
#pragma once #include "FileManager.h" #include "ICleanUp.h" #include "IUpdate.h" #include <vector> class RenderableObject; class NonRenderableObject; class Renderer:public ICleanUp { private: glm::vec3 cameraPos; static Renderer* instance; std::vector< RenderableObject*> renderObjList; std::vector< NonRendera...
#include "spell_code.h" #include "../use_code/use_code.h" #include "../define_host.h" #include "../function_host.h" #include "../function_both.h" /* First Circle */ U6O_SPELL_FUNCTION(create_food) { object * myobj2; int amount; if (stormcloakcheck2(x,y,myplr)) { return SPELL_INVALID; } if ((myobj2=OBJf...
#include "error.hh" using namespace ten; template <typename Result> msgpack::object return_thunk(const std::function<Result ()> &f, msgpack::object &o, msgpack::zone *z) { if (o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); } if (o.via.array.size != 0) throw errorx("wrong number of method par...
/* * 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/Portability.h> #include <quic/codec/PacketNumber.h> #include <quic/codec/QuicInteger.h> #include <q...
#ifndef _GUARD_PERM_GROUP_H #define _GUARD_PERM_GROUP_H #include <cassert> #include <iterator> #include <map> #include <tuple> #include <type_traits> #include <vector> #include "bsgs.h" #include "perm.h" #include "perm_set.h" /** * @file perm_group.h * @brief Defines `PermGroup`. * * @author Timo Nicolai */ na...
#include <iostream> #include <vector> #include <string> #include <algorithm> int main() { std::cin.sync_with_stdio(false); std::cin.tie(NULL); int n, m; std::cin >> n >> m; std::vector<int> ATK; std::vector<std::string> name; for(int i = 0; i < n; i++) { std::string n; ...
#ifndef HEADER_CURL_SSH_H #define HEADER_CURL_SSH_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_...
#include"cMission.h" #include <iostream> int main(int argc, char* argv[]) { /*if (argc==2) { cMission Mission(argv[1]); if (!Mission.getConfig()) return 0; else std::cout<<"CONFIG LOADED\n"; if (!Mission.getMap()) { std...
#include<bits/stdc++.h> using namespace std; const int c[]={2,3,5,7,11,13}; long long l,r; int ans=0; void readit(){ scanf("%d%d",&l,&r); } void writeit(){ printf("%d\n",ans); } long long power(long long a,long long b,long long p){ if (!b) return 1%p; long long t=power(a,b/2,p); t=t*t%p; if (b&1) t...
#ifndef RECOGNIZERLISTENER_HH_ #define RECOGNIZERLISTENER_HH_ #include <pthread.h> #include "RecognizerStatus.hh" #include "msg.hh" /** Class for reading in queue and handling the incoming messages. Operates * in an own thread. */ class RecognizerListener { public: /** Constructs a new in queue listener. * \...
// 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....
//=========================================================================== //! @file manager_base.h //! @brief マネージャーの基底クラス //=========================================================================== #pragma once //=========================================================================== //! @class ManagerBase ...
#include <iostream> #include <fstream> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <math.h> using namespace std; bool kiemTra(int a, int b, int c); float dienTich(int a, int b, int c); int main() { freopen("choinon7.inp","r",stdin); freopen("choinon7.out","w",stdout); int ...
#include <glad/glad.h> #include <GLFW/glfw3.h> #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> #include <iostream> #include <vector> #include "camera.h" #include "shader.h" #include "window.h" camera::camera(window* win, glm::vec3* target) { win_ptr = win; // pos + offs...
// // Created by pierreantoine on 08/01/2020. // #pragma once #include <string> class lexer_interface { public: virtual void lex() = 0; virtual void lineno() = 0; virtual void match(const std::string & a_string) =0; ~lexer_interface() = default; };
#pragma once #include "Drawable.h" class MultiDrawable : public Drawable { public: MultiDrawable(); void draw(sf::RenderWindow&); void setPosition(sf::Vector2f); sf::Vector2f getPosition(); void move(sf::Vector2f); void reverseMove(); protected: std::vector < std::shared_ptr < sf::RectangleShape >> shapes; sf...
class ItemStone: CA_Magazine { scope = 2; count = 1; type = 256; displayName = $STR_BLD_name_ItemStone;//"Rough Stone" picture = "\z\addons\dayz_buildings\equip\rocks.paa"; model = "z\addons\dayz_buildings\models\rocks.p3d"; descriptionShort = $STR_BLD_desc_ItemStone;//"Rough Stone" class ItemActions { cla...
#include <ionir/misc/inst_builder.h> #include <ionir/misc/bootstrap.h> #include "pch.h" using namespace ionir; TEST(InstBuilderTest, GetSection) { ionshared::Ptr<BasicBlock> section = Bootstrap::basicBlock(); ionshared::Ptr<InstBuilder> builder = section->createBuilder(); EXPECT_EQ(builder->getBasicBlock...
#include <iostream> #include <chrono> unsigned int ackermann(unsigned int m, unsigned int n) { if (m == 0) { return n + 1; } if (n == 0) { return ackermann(m - 1, 1); } return ackermann(m - 1, ackermann(m, n - 1)); } int main() { auto start = std::chrono::high_resolution_clock...
// Created on: 1995-03-14 // Created by: Jacques GOUSSARD // 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 terms of the G...
#include <bits/stdc++.h> using namespace std; int main() { int size; cout<<"Enter the size: "; cin>>size; int arr[size]; cout<<"Enter the elements: "; for(int i=0;i<size;i++) { cin>>arr[i]; } int sum = 0; for (int i = 0; i < size; i++) { for (int j = i; j < s...
#include <fstream> #include <iostream> #include <string> #include <vector> #include "../moves/movesGen.cpp" using namespace std; /* Input data consumer functions * * Includes functions for reading in and creating the * board object that we will be reading from. Crucial * that it does this in a way that is inline w...
#include<bits/stdc++.h> using namespace std; class PartitionSet { public: bool Partition(const vector<int> &no) { int sum = 0; for(int i = 0; i < no.size(); i++){ sum += no[i]; } if(sum % 2 != 0) { return false; } return this->PartitionRecursive(no, sum / 2, 0); } private: boo...
/* Given an array of integers, find the first repeating element in it. We need to find the element that occurs more than once and whose index of first occurrence is smallest. Examples: Input: arr[] = {10, 5, 3, 4, 3, 5, 6} Output: 5 [5 is the first element that repeats] 10 5 3 4 3 5 6 Input: arr[] = {6, 10, 5, ...
#include<iostream> #include<iomanip> using namespace std; int find(int a[], int n, int x) { int i = 0; for (; i < n; i++) { if (a[i] == x) return i; } cout << "Not Found"; return -1; } void PrintArr(int a[], int n) { if (n == 1) exit(0); else { int i = 0; for (; i < n - 1; i++) { cout << setw...
#include <mpi.h> #include <cstdlib> #include <iostream> int main(int argc, char* argv[]){ MPI_Init(&argc, &argv); float message; int n, i, rank; MPI_Status status; MPI_Comm_size(MPI_COMM_WORLD, &n); MPI_Comm_rank(MPI_COMM_WORLD, &rank); float rankf = rank; rankf += 0.001; if (rank =...
#include "gtest/gtest.h" #include "fixtures.hpp" using namespace wali::xfa; #define NUM_ELEMENTS(array) (sizeof(array)/sizeof((array)[0])) // WARNING: the order of the rows and columns in this table must be // consistent with the order of 'words' and 'nwas' below. static bool expected_answers[][13] = { ...
// // Created by 钟奇龙 on 2019-05-16. // #include <iostream> #include <vector> using namespace std; int maxSum(vector<int> arr){ if(arr.size() == 0) return 0; int curSum = 0; int maxSum = 0; for(int i=0; i<arr.size(); ++i){ curSum += arr[i]; maxSum = max(maxSum,curSum); if(curSum <...
#pragma once /** * @file * @copyright (C) 2020 Anton Frolov johnjocoo@gmail.com */ #include <stdint.h> #define _DURATION_BASE_T_MAX UINT32_MAX typedef uint32_t DurationBaseT; class Duration { public: // can not be used from ISR static Duration timeFromEpoch(); static Duration epoch(); static D...
/* This file is part of SMonitor. Copyright 2015~2016 by: rayx email rayx.cn@gmail.com SMonitor 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 3 of the License, or (at your option) any later ver...
#include <algorithm> #include <cassert> #include <deque> #include <iostream> #include <string> #include <vector> using ull = unsigned long long; class BigInterger { public: BigInterger(int n) { while (n) { num.push_front(n % 10); n /= 10; } } BigInterg...
#include "SearchView.hpp" SearchController * SearchView::makeController(Model *m) { return new SearchController(m, this); } SearchView::SearchView(QWidget *parent) : View(parent) { setAttribute(Qt::WA_DeleteOnClose); setFixedSize(310, 550); auto vl = new QVBoxLayout(this); checkA = new QGroupBox(QStringLi...
// # include <iostream> // using namespace std; // int main () { // string name, surname; // double hour, net_payment, gross_payment; // const double payment = 6.75; // const double tax = 0.1; // cout << "Hi, please enter your name: " << endl; // cin >> name; // cout << "Also, pleas...
#pragma once #include <iostream> #include <new> #include <array> #include <string> #include <random> #include <cassert> using namespace std; #define DEFAULT_SIZE 4 #define nBelow0 "n is below 0 in CircularDeque!" static void checkIndexOutOfBounds(int32_t r, int32_t size, string op, string type); static void checkIn...
// vnrsharedmemory.cc // 5/7/2014 jichi #include "vnrsharedmemory/vnrsharedmemory.h" #include <QtCore/QSharedMemory> /** Private class */ class VnrSharedMemoryPrivate { public: enum { LanguageCapacity = 4 }; struct Cell { qint8 status; qint64 hash; //qint32 signature; qint8 role; char languag...
#pragma once namespace aeEngineSDK { /*************************************************************************************************/ /* @struct LOGGER_DATA /* /* @brief This is an empty structure that it is defined in aeLogger.cpp /******************************************************************************...
#include <iostream> #include "pass.hpp" int main() { PassRegistry::get_pass_registry()->invoke("hello")(); return 0; }
#ifndef ALARMOO_H #define ALARMOO_H #include "synch.h" class Alarm { public: List *sleepQ; Alarm() { sleepQ = NULL; } ~Alarm() { delete sleepQ; } void GoForSleep(int howLong); void wakeUp(); }; #endif
#ifndef MYNETWORKACCESSMANAGER_H #define MYNETWORKACCESSMANAGER_H #include <QNetworkAccessManager> #include <QUrl> #include <qnetworkreply.h> #include <qauthenticator.h> #include <qnetworkreply.h> #include <qsslerror.h> class NetworkAccessViewer; struct OffileDataStruct { QUrl url; QMap<QByteArray,QByteArray> ...
/***************************************************************************************************************** * File Name : RootToLeafPathSum.h * File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\sites\geeksforgeeks\trees\page06\RootToLeafPathSum.h * Created on : Dec 23, 2013 :: 1:09:52 P...
// Sharna Hossain // CSC 111 // Lab 12 | multiplication_table.cpp #include <iostream> #include <iomanip> using namespace std; int main() { int rows, columns, digits = 1; cout << "Enter the number of rows: "; cin >> rows; cout << "Enter the number of columns: "; cin >> columns; ...
/* You are given N, and for a given N x N chessboard, find a way to place N queens such that no queen can attack any other queen on the chess board. A queen can be killed when it lies in the same row, or same column, or the same diagonal of any of the other queens. You have to print all such configurations. Note: Don'...
#include<iostream> using namespace std; class Node{ public: int data; Node* left = nullptr; Node* right = nullptr; Node(){ } Node(int data){ this->data = data; } }; Node* root = nullptr; class BST{ public: static void insert(Node* tree, Node* newNode); static void in...
// // Created by adam on 23.12.18. // #ifndef AAL_MSTGRAPH_H #define AAL_MSTGRAPH_H #include "../Algorithm/Implementation.h" class MSTgraph { std::vector<std::vector<edgeDef> > MSTonCC; std::vector<unsigned> isolatedVertices; std::vector<edgeDef> MSTonGraph; public: void addVectorToMSTonCC(std::v...
/* * @lc app=leetcode.cn id=986 lang=cpp * * [986] 区间列表的交集 */ // @lc code=start #include<iostream> #include<vector> #include<algorithm> using namespace std; class Solution { public: vector<vector<int>> intervalIntersection(vector<vector<int>>& A, vector<vector<int>>& B) { int a = 0, b = 0; ve...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int n, m; cin >> n >> m; vector<vector<int>> v; for(int bit=0; bit<(1 << n); bit++){ vector<int> t; for(int i=0; i<n; i++){ if(bit & (1<<i)) t.push_back(1); else t.pus...
#include "drawClockFrame.h" #include "cursorSet.h" #include <stdio.h> #include <ctime> #include <conio.h> #include <windows.h> #include "time.h" #include <string> #include "webClock.h" #include <iomanip> #include <iostream> #include "clockMenus.h" void drawClockFrame::drawNewClockFrame(int startRow, int startCol, cur...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2008-2011 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** @author Haavard Molland <haavardm@opera.com> ** @author Alex...
#include <iostream> int get_fuel1(int num) { if((num / 3) - 2 > 0) return (num/3)-2; return 0; } int get_fuel2(int num) { int sum = 0; if((num/3) - 2 <= 0) return 0; return sum += (num/3) - 2 + get_fuel2((num/3) - 2); } int main() { int num, sum1 = 0, sum2 = 0; while(std::cin >> num) { sum1 += get_fuel1(...
#include "UnitsTest.h" // RsaToolbox #include "Definitions.h" #include "General.h" using namespace RsaToolbox; // Qt #include <QString> UnitsTest::UnitsTest(QObject *parent) : TestClass(parent) { } void UnitsTest::units_data() { QTest::addColumn<Units>("units"); QTest::addColumn<QString>("string"); ...
#include "Synergist.h" #include <iostream> size_t SynergistHealth[] = { 0, 25, 25, 31, 34, 38, 38, 41, 47, 52, 59, 66, 71, 75, 81, 85, 90, 95, 103, 110, 125 }; size_t SynergistAttack[] = { 0, 13, 15, 15, 17, 19, 19, 21, 23, 25, 30, 33, 37, 43, 48, 50, 54, 55, 60, 63, 65 }; size_t ExperienceSNeed[] = { 0, 0, 10, 30, 55...
/** * @file CommandBase.cxx * @author Krzysztof Ciba (Krzysztof.Ciba@NOSPAMagh.edu.pl) * @date 23/11/2006 * @brief Definition of CommandBase class. */ #include "CommandBase.h" void CLUE::CommandBase::parse_recipe() { std::stringstream inout(m_recipe); std::vector<std::string> sentence; std::string word; w...
#include <string.h> #include "ConvexMesh.h" //ある軸に投影(軸に投影して、どこかの軸で重なっていなければ衝突していない) //p147あたり参照 void GetProjection(float &pmin, float &pmax,const ConvexMesh *convexMesh,const Vector3 &axis){ assert(convexMesh); float t_pmin = FLT_MAX; float t_pmax = -FLT_MAX; for (unsigned int i = 0; i < convexMesh->m_numVertice...
////////////////////////////////////////////////////////////////////////// // Bwindows.h 包含了编写 Windows 程序所必须的头文件, // 一些常用自定义函数的声明、类型、常数、类的定义 // 类包括: // CBApp 类: 管理应用程序全局信息 // CBHashLK:长整数型 key 的哈希表类 // CBHashStrK:字符串型 key 的哈希表类 // CBRecycledArr:带回收站的数组类 // CBRecycledArrInt:整型版带回收站的数组类 // CHe...
#include "../Display.hpp" using namespace Drivers; uint8_t Display::buffor[Display::Width*Display::Hight/8] = { 0 }; void Display::sendByte(uint8_t type, uint8_t data) { Port::setFalse( bitValue(PinCE) ); if(type == SendType::Data) Port::setTrue( bitValue(PinDC) ); if(type == SendType::Command) ...
#ifndef _LASER_BEAM_H #define _LASER_BEAM_H #include "WeaponInfo.h" class LaserBeam : public CWeaponInfo { public: LaserBeam(GenericEntity::OBJECT_TYPE _bulletType); virtual ~LaserBeam(); // Initialise this instance to default values void Init(void); //render weapon void Render(); // Discharge this weapon v...
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <screen.h> #include <QPixmap> #include <QScreen> #include <QFileDialog> #include <QMessageBox> #include <QString> namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit M...
// // Token.cpp // Tarea4Ejercicio3 // // Created by Daniel on 16/10/14. // Copyright (c) 2014 Gotomo. All rights reserved. // #include "Token.h" Token::Token(){ remitente = 0; destino = 0; mnsj = nullptr; } int Token::verificar(int i){ if(i == remitente){ if(mnsj == nullptr){ ...
/* Serial Event example When new serial data arrives, this sketch adds it to a String. When a newline is received, the loop prints the string and clears it. A good test for this is to try it with a GPS receiver that sends out NMEA 0183 sentences. NOTE: The serialEvent() feature is not available on the Le...
#ifndef CSTATUSWIDGET_H #define CSTATUSWIDGET_H #include <QWidget> #include "ui_CStatusWidget.h" class CStatusWidget : public QWidget, public Ui::CStatusWidget { Q_OBJECT public: CStatusWidget(QWidget *parent = 0); ~CStatusWidget(); private Q_SLOTS: void changePasswd(); void checkLength(); void distributeMess...
#include <stdio.h> #include <math.h> #include <glut.h> #include "Controller.h" #define PI 3.14159265358979323846 Controller::Controller(void) { for (int i = 0; i < 256; i++) _key[i] = false; _shiftDown = false; _fpsMode = false; _viewportWidth= 0; _viewportHeight = 0; _mouseLeftDown = false; _mouseRightDown...
#include<WinSock2.h> #include<stdio.h> // #pragma comment(lib,"ws2_32.lib") // #define Ser_PORT 5050 // #define DATA_BUFFER 1024 void main(){ WSADATA wsaData; SOCKET sClient; // int iLen; // int iSend; int iRecv; // printf("请输入你想发送给服务器的一串小写英文字符(不要超过1024个字符): "); char send_buf[DATA_BUFFER]; scanf("%s",send_...
// Linked List Implementation C++ // Node Class represents a node in a Linked List #include <iostream> using namespace std; class Node { public: int value; Node* next; }; class LinkedList { private: Node* root; // Root Node i.e beginning of Linked List public: LinkedList() { root = NULL; }...
/* Include the controller definition */ #include <argos3/core/utility/math/rng.h> #include <services/debug_log.h> #include "lootbot_closest_light.h" CLootBotClosest::CLootBotClosest() : steeringActuator(nullptr), charging(false), startedCharging(false), dead(false), pcRNG(nullpt...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> using namespace std; long long a[100100]; bool fig(long long t,int n,long long k) { long long ans =...
/** Copyright (c) 2015 Eric Bruneton All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the follo...