text
stringlengths
8
6.88M
#include <bits/stdc++.h> using namespace std; using ll = long long; //constant initialization const ll MOD=998244353; const ll maxn=1e6+10; const ll INF=1e18; //variables used for the current problem int n,k,cnt[maxn]; vector<vector<int>> a; ll ans; ll fastpow(ll x, ll y){ ll res = 1; while (y>0){ if (y&1) ...
// // Created by wqy on 20-1-9. // #include "ProverifConst.h"
#include <libbig/big.hpp> #include "util.hpp" #include <iostream> #include <algorithm> #include "buffer.hpp" using namespace libbig; bool Big::Load(const std::string& name) { if(m_stream.is_open()) m_stream.close(); m_stream.open(name,std::ios::in| std::ios::binary); //check if archive exists if...
#include <iostream> int main(){ int n; std::cout << "Enter number of elements: "; std::cin >> n; int a[n]; std::cout << "Start entering numbers" << '\n'; for (int i=0;i<n;i++){ std::cin >> a[i]; } std::cout <<'\n'; int temp; for (int i = 0; i < n-1; i++) { for (int j = i+1; j < n; j++) { if (a[...
//************************************************************************** //** //** See jlquake.txt for copyright info. //** //** 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 ...
/* * Spi.h * * Created: 17.06.2015 16:09:04 * Author: User */ #include <avr/io.h> #include "Gpio.h" #ifndef __SPI_H__ #define __SPI_H__ class Spi { //variables public: enum div {div4 , div16 , div64 , div128}; enum role {Slave , Master}; enum SpiPin {CS = 2 , MOSI,MISO,SCK}; protected: private: Gpio pin; ...
/* * Person.h * * Created on: Aug 25, 2016 * Author: Istvan */ #ifndef PERSON_H_ #define PERSON_H_ #include <iostream> #include <string> using namespace std; struct Person{ string firstName; string lastName; Person(); Person(string firstName, string lastName); Person(string fullName); void print()...
#include "../../include/offline/configuration.h" namespace keyword_suggestion { Configuration::Configuration(const std::string &config) { FILE *path; char prefix[kPathSize] = {0}, index[1024] = {0}, content[1024] = {0}; std::string config_path; getcwd(prefix, kPathSize); for (int i = strlen(prefix) - 1; pr...
#pragma once #include "MyMatrixTypes.h" #include "Circuit.h" #include <math.h> #include <vector> #include <ctime> class Simulation : public Circuit { public: //Default Constructor //Simulation(); //Constructor with samplerate and vcc as arguement Simulation(double _sampleRate, double _vcc); //Default Destructo...
#ifndef APPEARANCE_H #define APPEARANCE_H #include <string> #include <iostream> #include <CGFappearance.h> #include "Texture.h" using namespace std; class Appearance: public CGFappearance { protected: string appearance_id; string textureref; bool hasText; public: Appearance(string appearance_id, float shinine...
#include<stdio.h> #include<malloc.h> struct node{ int data; struct node *next; }; int push(struct node **,int); int main(){ struct node *Head; push(&Head,23); push(&Head,12); push(&Head,44); push(&Head,32); push(&Head,91); printf("-------------------------------"); print...
#ifndef BINARYHEAP_H #define BINARYHEAP_H #include <cstddef> #include <vector> #include "Node.h" class BinaryHeap { public: BinaryHeap(); BinaryHeap(const BinaryHeap& h); ~BinaryHeap(); static BinaryHeap setUnion(BinaryHeap h1, BinaryHeap h2); static BinaryHeap setIntersection(BinaryHeap h1, BinaryHeap h2); ...
#ifndef GAMEDATA_H #define GAMEDATA_H #include <fstream> #include <string> class gamedata { private: std::string m_sPlayerName; private: int m_nDollarsCarried; public: std::string sPlayerName ( ) const; public: int nDollarsCarried ( ) const; public: gamedata ( const std::string&, const int& );...
#include "Event.hpp" namespace rpg2kLib { namespace structure { Instruction::Instruction() : code_(-1) { } Instruction::Instruction(StreamReader& s) { code_ = s.getBER(); nest_ = s.getBER(); Binary b; s.get(b); stringArgument_ = static_cast< RPG2kString >(b); int argNum = s.getBER();...
#include "CTaskManager.h" #include <stdio.h> using namespace Util; CTaskManager::CTaskManager() { } bool CTaskManager::start(ITask* pTask) { pthread_t tid = 0; pTask->onStart(); pthread_create(&tid, NULL, (TaskFunction)handleTask, (void*)pTask); } void CTaskManager::stop(ITask* pTask) { pTask->...
// // CombineSelector.hpp // DDCSSParser // // Created by 1m0nster on 2018/8/7. // Copyright © 2018 1m0nster. All rights reserved. // #ifndef CombineSelector_hpp #define CombineSelector_hpp #include <stdio.h> #include <iostream> #include <list> #include "Selector.hpp" namespace future { class CombineSelector...
/* ID: khurana2 PROG: milk2 LANG: C++ */ #include <algorithm> #include <fstream> #include <iostream> #include <utility> #include <vector> using namespace std; typedef pair<unsigned long, unsigned long>Interval; bool mycomp(const Interval &a, const Interval &b) { return (a.first <= b.first); } int main() { u...
#include <iostream> #include <vector> #include <GL/glew.h> #include <GL/freeglut.h> #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/matrix_inverse.hpp> #include "GLSLProgram.h" #include "GLTools.h" // Standard window width const int WINDOW_WIDTH = 640; // Standard window height con...
#include "if_else_detector.h" using namespace std; vector<int> detect_if_else(ParseTreeNode *program_node) { // sanity checks assert(program_node); assert(program_node->type == PROGRAM_NODE); vector<int> nested_levels; // stores the nesting level of the rudimentary if-else block vector<P...
// // Created by Twometer on 20/12/2019. // #ifndef GAMEOFLIFE_OPENGL_POSTPROC_H #define GAMEOFLIFE_OPENGL_POSTPROC_H #include "../gl/Fbo.h" class Postproc { private: static GLuint vao; public: static void initialize(); static void start(); static void stop(); static void copy(Fbo *src, Fbo ...
#ifndef __CALCULATOR__ #define __CALCULATOR__ #include <fstream> #include <string> #include "cell.h" class calculator { public: int num_core; int npool; int ndiag; int calculator_type; // 1: qe, 2: vasp std::string exe; std::string mpi_launcher; void read_from_in(std::ifstream& in); void write_input(std::ifs...
// // Created by 梁栋 on 2019-01-07. // #include <iostream> #include <sstream> using namespace std; class Solution { public: int reverse(int x){ int res = 0; while(x != 0){ if(res * 10 / 10 != res){ return 0; } res = res * 10 + x % 10; x ...
#pragma once #include "../JuceLibraryCode/JuceHeader.h" class FaustStrings_AP { public: FaustStrings_AP() { }; ~FaustStrings_AP() {}; String baseName = "/SliderSoniFinal/"; String tradSoniToggle = baseName + "Traditional"; String tradSoniChoice = baseName + "Mapping_Tabs/Sonification_Ty...
/** * Copyright (c) William Niemiec. * * 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 <iostream> namespace wniemiec { namespace io { namespace cpp { /** * Responsible for console input. */ class InputCon...
// // Created by Lars on 31/03/2018. // #ifndef SIDESCROLLER_MAP_H #define SIDESCROLLER_MAP_H #include "Game.h" #include "TextureManager.h" class Map { public: Map(); ~Map(); void LoadMap(int arr[20][25]); void DrawMap(); private: int tex_size = 32; int tex_scalar = 2; SDL_Rect src, des...
#ifndef __itkTPGACLevelSetImageFilter_h #define __itkTPGACLevelSetImageFilter_h #include "itkGeodesicActiveContourLevelSetImageFilter.h" namespace itk { template <class TInputImage, class TFeatureImage, class TOutputPixelType = float > class ITK_EXPORT TPGACLevelSetImageFilter : public GeodesicActiveContourLevelSetI...
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include "headers.h" #include "treapNode.h" QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } QT_END_NAMESPACE class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(QWidget *parent = nullptr); ~MainWindow();...
#ifndef PERSONALINFOSTRUCT_H #define PERSONALINFOSTRUCT_H #include <QString> #include <QDate> #include <QByteArray> #include <QPixmap> class PersonalInfoStruct { public: PersonalInfoStruct(); PersonalInfoStruct( int id, QString name, QString mark, QString sex, QDate birthday, QString mail, QStr...
/* * scout_interface.hpp * * Created on: Jul 08, 2021 12:02 * Description: Scout-specific interface * * Copyright (c) 2021 Weston Robot Pte. Ltd. */ #ifndef SCOUT_INTERFACE_HPP #define SCOUT_INTERFACE_HPP #include <string> #include "ugv_sdk/details/interface/agilex_message.h" #include "ugv_sdk/details/interfa...
#include <iostream> #include "QueueClass.h" int main() { int testNum = 1; QueueNode<int> testNode = QueueNode<int>(&testNum); std::cout << testNode.value << std::endl; QueueNode<int>* testNodePtr = &testNode; std::cout << testNodePtr->value << std::endl; Queue<int> myQueue; std::cout...
#include<iostream> using namespace std; int number[100]; int a, b, c; int count_jump; void check_position(); int jump_where(); int main() { count_jump = 0; cin >> a >> b >> c; while (1) { int jump_position = jump_where(); if (jump_position == 0) break; else if (jump_position == 1) c = a + 1; else i...
/* * Copyright (C) 2007-2015 Frank Mertens. * * Use of this source is governed by a BSD-style license that can be * found in the LICENSE file. * */ #include <flux/Dir> #include <flux/File> #include <flux/DirWalker> namespace flux { Ref<DirWalker> DirWalker::open(String path) { return new DirWalker(path); }...
#pragma once #include <string> #include "pybind11/pybind11.h" #include "drake/bindings/pydrake/documentation_pybind.h" #include "drake/bindings/pydrake/pydrake_pybind.h" #include "drake/common/type_safe_index.h" namespace drake { namespace pydrake { /// Binds a TypeSafeIndex instantiation. template <typename Type>...
#ifndef IMAGE_H_INCLUDE #define IMAGE_H_INCLUDE /* *read a pgm file and parse the pgm format and return the min, avg, max pixel value * */ #include <iostream> #include <fstream> #include <vector> #include <sstream> #include <vector> #include <stdio.h> #include <cctype> #include <string> #include <math.h> using name...
class Solution { public: ListNode *removeNthFromEnd(ListNode *head, int n) { ListNode **d = &head, *p = head; while (n--) p = p->next; while (p != NULL) { p = p->next; d = &((*d)->next); } p = (*d)->next; delete *d; *d = ...
#include <Arduino.h> #include <vector> #include <WiFi.h> #include <Wire.h> #include "SPI.h" #include "Adafruit_GFX.h" //for matrix led #include "Adafruit_LEDBackpack.h" #include "KB_initBoard.h" #include "KB_music.h" #include "KB_LDR.h" #include "KB_LM73.h" #include "KB_ht16k33.h" #include "MCP7941x.h" #include "Kalm...
/** @purpose This is a simplified vi editor. @file main.cpp @input A text file and keywords file. @output a display of the text file that was input*/ #include<iostream> #include"Editor.h" using namespace std; int main(int argc, const char* argv[]) { int numberOfCmdLineArgs = 0; // argv[] reads in from the comman...
vector<pair<int,int>> v; for(int i=0;i<n;i++) { v.push_back({arr[i],-1}); v.push_back({dep[i],1}); } sort(v.begin(),v.end()); int count=0; int c1=0;int c2=0; for(int i=0;i<2*n;i++) { if(v[i].second==-1)c1++; else c2++; count=max(count,...
/* * SkyBox.h * * Created on: 10 сент. 2017 г. * Author: Соня */ #ifndef SKYBOX_H_ #define SKYBOX_H_ #include "Common.h" class SkyBox { public: SkyBox(String frontImage, String backImage, String leftImage, String rightImage, String topImage, String bottomImage); virtual ~SkyBox(); }; ...
#include "..\config.h" #include "..\inc\decode.h" DecodeStatus decode(uint32_t code, RV32I &instr, RV32_reg &rd, RV32_reg &rs1, RV32_reg &rs2, uint32_t &imm) { OpcodeMap opcode = (OpcodeMap)slice(code, 0, 6); switch (opcode) { case OpcodeMap::LOAD: { uint8_t funct3 = slice(code, 12, 14); rd = slice(code, 7, 1...
#ifndef WORKER_H #define WORKER_H #include "employee.h" #include <qfile.h> #include <qtextstream.h> #include <qlist.h> class Worker : public Employee { public: Worker(QString fio, size_t uniqueNumber, QString login, QString password, QString department); ~Worker(); QString getTaskName(); ...
#ifndef DATASTRUCTURE_TESTLINEARLIST_H #define DATASTRUCTURE_TESTLINEARLIST_H #include "linearList.h" #include "status.h" #define LEN 100 void testLinearList() { int temp = 0; long op = 1; int cur = 0, next = 0, pre = 0, elem = 0; int list_index = 0; int temp_index = 0; int index; Linear...
#include <iostream> #include<Windows.h> using namespace std; //Prototipos void cambioresiduos(int a[], int izq,int der,int b); unsigned bits (int a, int k, int j); void llenarArray(int a[], int n); void mostrarArray(int a[],int n); double PCFreq = 0.0; __int64 CounterStart = 0; void StartCounter() { LARGE_INTEGE...
// OnHScrollPageRight.h #ifndef _ONHSCROLLPAGERIGHT_H #define _ONHSCROLLPAGERIGHT_H #include "HorizontalScroll.h" #include "ScrollAction.h" class OnHScrollPageRight : public ScrollAction { public: OnHScrollPageRight(HorizontalScroll *horizontalScroll); OnHScrollPageRight(const OnHScrollPageRight& source); virtua...
#include <bits/stdc++.h> using namespace std; int getPairsCount(int arr[],int n, int sum){ unordered_map<int , int> m; for(int i=0; i<n; i++) m[arr[i]]++; int twice_count=0; for(int j=0 ; j<n; j++){ twice_count += m[sum-arr[j]]; if(sum-arr[j] == arr[j]) twice_count--; } return twice_c...
class ConferenceReference: public Reference{ public: ConferenceReference(string _lastName, string _firstName,string _title, string _edPlace, string _editor,int _year): Reference(_lastName,_firstName,_title, _edPlace,_editor,_year){ } void print(){ Reference:...
int sum(const int size, const int iarr[]) { int sum; for (int i = 0; i < size; ++i) { sum += iarr[i]; } return sum; }
#ifndef MAZE_GENERATOR_H #define MAZE_GENERATOR_H #include "Room.h" #include "Door.h" #include "Wall.h" #include "Maze.h" class MazeGenerator { public: Maze* CreateMazeStupidly(); }; #endif
#include <iostream> #include <vector> #include <opencv2/opencv.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> using namespace std; using namespace cv; // 利用感兴趣区域ROI实现图像叠加 bool LinearBlending() { // [0]定义一些局部变量 double alphaValue = 0.5; double betaValue; Mat src...
#pragma once #include "opencv2/opencv.hpp" #include "opencv2/highgui.hpp" #include <Windows.h> #include <string.h> #include <iostream> using namespace cv; using namespace std; class ex11 { public: // 테스트 코드 static void Run(); // 파일을 읽는 다이얼로그 호출 static string OpenFileDialog(); // 영상을 읽는 다이얼로그 호출 static Mat OpenI...
#include "Meteor.h" const ofVec2f & Meteor::GetPosition() const { return m_position; } const bool &Meteor::Collided() const { return m_collided; } Meteor::Meteor() { m_position = ofVec2f((rand() % 2) * ofGetWidth(), rand() % ofGetHeight()); float tmp = (1000 + rand() % 5000) / 100.0f; m_radius = 5 + rand() % 20; ...
#include "GraphNode.h" GraphNode::GraphNode() { costToGetHere = 0 ; } GraphNode::~GraphNode() { // !! DO NOT DELETE THE EDGES. // They are simply mirrored copies // of the edges in the global list. // the main game object will take care // of the global list. } // priority. bool GraphNod...
#include <iostream> #include <cstring> using namespace std; int main() { char a[100],b[100]; cout << "输入两个字符串:" << endl; cin >> a >> b; auto result=strcmp(a,b); switch(result){ case 1: cout << "a>b"; break; case 0: cout << "a=b"; ...
#ifndef EX3_2_PSET_H #define EX3_2_PSET_H #include <fstream> #include <iostream> #include <string> #include <set> #include "persistence_traits.h" using namespace std; template<typename T, typename P=persistence_traits<T>> class pset : public set<T> { string f; void read() { ifstream ifs(f); ...
#include<iostream> using namespace std; int main() { int a=2; int b=2; b=a+b/a+ b*a; cout<<b<<endl; }
// Copyright (c) 2012 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 "media/filters/pipeline_integration_test_base.h" #include "base/bind.h" #include "media/base/decoder_buffer.h" #include "media/base/decrypto...
#include <omp.h> #include <stdio.h> #include <time.h> #include <math.h> #include <stdlib.h> #include <Windows.h> #include <cstdint> #include "immintrin.h" #include "assert.h" #define SIZE 1024 int main() { int THR = 4; int i, j, k; uint64_t start, end; double time_s, time_f; omp_set_dynamic(0); omp_set_num_...
#include <bits/stdc++.h> using namespace std; int main() { string s[3]; int a, b; cin >> s[0]; cin >> s[1]; cin >> s[2]; for(int i=0; i<3; i++) { for(int j=0; j<10; j++) { if(s[i][j] == '=') { a = i; b = j; i = j = 10; } } } b++; for(int i=b; i<10; i++) {...
// Source file for the Task class #include "stdafx.h" #include "Task.h" #include <iostream> #include <string> using namespace std; Task::Task(string str, tm myTime, bool complete) : t(str), time(myTime), isComp(complete) { }; // Displays the name of the task, followed by a properly formed date and time (assembled be...
#pragma once #pragma once #ifndef STRING #include <string> #endif #ifndef IOSTREAM #include <iostream> #endif using namespace std; bool isAnagram(const string str1, const string str2); namespace Anagram { void run(); }
#include "cargador_recursos.h"
/*********************************************************************** created: Tue Feb 17 2009 author: Paul D Turner *************************************************************************/ /*************************************************************************** * Copyright (C) 2004 - 2011 Pa...
#include "Animation.h" #include"Effects.h" Animation::Animation(int x, int y, int width, int height, int count, const Surface & s,float ht, Color chroma) : sprite(s), holdTime(ht), chroma(chroma) { for (int i = 0; i < count; i++) { frames.emplace_back(RectI(x + width*i, y, width, height)); } } void Animation...
/*========================================================================= Program: Visualization Toolkit Module: vtkExtractExodusGlobalTemporalVariables.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details...
// Copyright (c) 2015 University of Szeged. // Copyright (c) 2015 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 "content/public/app/content_main.h" #include "sprocket/app/main_delegate.h" int main(int argc...
#ifndef GYROSCOPE_H_ #define GYROSCOPE_H_ extern "C" { #include <stdint.h> } #include "RegisterDevice.h" #include "I2CController.h" #define GYRO_ADDR_BASE 0b1101000 #define GYRO_REG_WHO_AM_I 0x0F #define GYRO_REG_CTRL_REG1 0x20 #define GYRO_REG_CTRL_REG2 0x21 #define GYRO_REG_CTRL_REG3 0x22 #define ...
#pragma once #include "value.h" class cBaseShader; class cGeomNode { public: LPDIRECT3DVERTEXBUFFER9 m_pVB; int m_nNumTri; bool m_IsRender; ST_MTL_TEX* m_pTexMtl; std::vector<cGeomNode*> m_vecChildren; std::vector<ST_POS_TRACK> m_vecPosTrack; std::vector<ST_ROT_TRACK> m_vecRotTrack; D3DXMA...
#pragma once #include "Lexer.h" namespace filtering { class syntaxer { public: private: // E // E ::= T T2 // T2::= +T | -T | . // T ::= F F2 // F2 ::= *F | /F | . // F ::= ( E ) | s | n // a+b+c // E => TX => FYX => aYX => aX => a+TX => // => a+bX void R(); /** R := W \n W */ void ...
#ifdef TIME_H_ #define TIME_H_ #include <iostream> #include "support.h" using namespace std; class Time{ protected: int arrivalTime; int serviceTime; }; #endif /*TIME_H_*/
#include "Continent.h" Continent::Continent(void) { } Continent::Continent(string name,int unit) { this->name = name; this->unit = unit; } Continent::~Continent(void) { } string Continent::getName(){ return this->name; } void Continent::setName(string name){ this->name=name; } int Continent::getUnit(){ retu...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.Networking.ServiceDiscovery.Dnssd.1.h" #include "Windows.Foundation.1.h" WINRT_EXPORT namespace winrt { namespace ABI::Windows::Foundation::Collections { #ifndef WINRT_GENE...
#include <map> #ifndef MYPROJECT_DAO_STU_H #define MYPROJECT_DAO_STU_H using namespace std; int insertStu(char* content); int removeStu(int line); int changeStu(int line,char* content); int findStuLines(int col, const char *keys, map<int, int> &lines); string findStu(int line); #endif
// // Vector3.H // // #ifndef Vector3_h #define Vector3_h class Vector3{ public: float x,y,z; Vector3(){} Vector3(const Vector3 &vector) { x = vector.x; y = vector.y; z = vector.z; } Vector3(float nx, float ny, float nz) { x = nx; y = ny; z = nz; } Vector3 &operator =(const Vector3 &ve...
#include <iostream> using namespace std; int NWD(int a, int b) { while(a!=b) if(a>b) a-=b; //lub a = a - b; else b-=a; //lub b = b-a return a; // lub b - obie zmienne przechowują wynik NWD(a,b) } int NWD(int a, int b, int c, int d) { int temp = NWD(NWD(a,b), c); r...
// // Copyright Jason Rice 2016 // 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) // #ifndef NBDL_DETAIL_CONCEPT_PRED_HPP #define NBDL_DETAIL_CONCEPT_PRED_HPP #include <boost/hana/bool.hpp> namespace nbdl { names...
// -*- C++ -*- // // Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory, // Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC // // This file is part of FreePOOMA. // // FreePOOMA is free software; you can redistribute it and/or modify it // under the terms of the Expat license. // // This progr...
#pragma once /* Show Negative Stats * PATCHES: Pleione.dll */ #include "../Main.h" #include "../Singleton.h" #include "GenericPatcher.h" class CPatcher_ShowNegativeStats : public IGenericPatcher { public: CPatcher_ShowNegativeStats(); bool ReadINI(void); bool WriteINI(void); private: // Hook functions // Var...
#include "playerinfolabel.h" PlayerInfoLabel::PlayerInfoLabel(std::string nickname, size_t money) : TotalMoney(money), Bet(0) { mNickname = new QLabel; mTotalMoney = new QLabel; mStatus = new QLabel; QString name = QString::fromStdString(nickname); mNickname->setText(name); QString total = "Ba...
//QUEUE 사용 문제 //숨바꼭질 //BFS문제 /* X / | \ X-1 X+1 2X 이미 지나왔던 길은 제외하고 찾는다 */ #include <iostream> #include <queue> using namespace std; queue<int> q; int isvisit[100001] = { 0, }; int dist[100001] = { 0, }; int que_val; void isvalid(int i) { if (i <= 100000 && i >= 0) { //방문하지않았다면 if (isvisit[i] == 0) { ...
#include <iostream> using namespace std; struct Rectangle{ int length; int breadth; }; int main() { struct Rectangle *p ; p = new struct Rectangle; p->length =10; p->breadth = 6; cout<< p->length <<endl; cout<< p->breadth <<endl; return 0; }
// // Texture.cpp // cheetah // // Copyright (c) 2013 cafaxo. All rights reserved. // #include "RenderWindow.h" #include "BufferManager.h" #include "Texture.h" Texture::Texture(BufferManager &bufferManager, const std::string &fileName) : mCoordinates(bufferManager.create(16)) { glGenTextures(1, &mId); bind...
#ifndef __COMMAND_B_H__ #define __COMMAND_B_H__ #include "Command.h" #include "Receiver.h" #include <memory> class CommandB : public Command { public: CommandB(std::shared_ptr<Receiver> receiver); virtual void execute() override; virtual void undo() override; private: int m_status; std::share...
#include "DeployHook.h" DeployHook::DeployHook() { Requires(hook); // Use Requires() here to declare subsystem dependencies // eg. Requires(chassis); } // Called just before this Command runs the first time void DeployHook::Initialize() { hook->deploy(); } // Called repeatedly when this Command is scheduled to r...
#include "WindingOrder.h" namespace revel { namespace renderer { //Intentionally left blank } }
#ifndef _TEXTURE_H_ #define _TEXTURE_H_ #include "Base.h" //used to identify which texture to load enum TexID { WATER, ISLAND1, ISLAND2, CHEST, BOAT2, BOAT1, SPLASH, VICTORY, DEFEAT, CHECKPOINTON, CHECKPOINTOFF }; class Texture { GLuint m_id; public: Texture(){} ~Texture(){} inline GLuint id() const...
/******************************************************************************* * Cristian Alexandrescu * * 2163013577ba2bc237f22b3f4d006856 * * 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ...
/** * Date: 2019-11-09 22:19:58 * LastEditors: Aliver * LastEditTime: 2019-11-09 23:43:18 */ #include <iostream> #include "test7.h" int main() { int fd = open(filename, O_WRONLY | O_CREAT); if (fd == -1) exitWithError("open"); setNonBlock(fd); // writeLock(fd, true); // cout << "文件锁由...
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <cstring> #include <queue> #include <sstream> using namespace std; /* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) { } };*/ class Solution { public...
/*********************************************************************** created: Wed Aug 5 2009 author: Paul D Turner <paul@cegui.org.uk> *************************************************************************/ /*************************************************************************** * Copyright...
#ifndef KB_32FT_h #define KB_32FT_h #include <Arduino.h> #include <Wire.h> class KB_32FT { public: void begin(void); uint16_t readTempSTM1(); uint16_t readTempSTM2(); uint16_t readTempSTM3(); protected: private: uint16_t tempSTM; uint16_t tmp = 0; uint16_t tmp1 = 0; uint16_t tmp2 = 0...
/******************多重背包问题*********************/ #include <iostream> #include <vector> #include <math.h> #include<stdio.h> #define _CRT_SECURE_NO_WARNINGS using namespace std; #define EMPTY #define INF -65536 #define max(a,b) a<b?b:a int V ;//定义体积 int T ;//定义物品种类 int f[10000 + 1]; int c[200] ; int w[200] ; int n[200] ; ...
#include <iostream> #include <string> #include <cstddef> #include <cassert> #include "myclass.hpp" using namespace std::string_literals; int freePlainFunction(int a, int b) { return a + b; } int main() { MyClass myObject; cpp::reflection<MyClass>().field("field").get(myObject) = 12; assert(myObjec...
#include <bits/stdc++.h> #include <conio.h> using namespace std; int main() { freopen("in", "r", stdin); freopen("out", "w", stdout); int T; scanf("%d", &T); for(int tt=1; tt<=T; tt++) { printf("Case #%d: ", tt); int n, k; bool rWon = false, bWon = false, ansF = false; scanf("%d %d", &n, &k); char a[n...
// -*- C++ -*- // // Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory, // Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC // // This file is part of FreePOOMA. // // FreePOOMA is free software; you can redistribute it and/or modify it // under the terms of the Expat license. // // This progr...
/* ID: hjl11841 TASK: sprime LANG: C++ */ #include<bits/stdc++.h> using namespace std; int n; bool prime(int x) { if(x<2)return false; for(int i=2; i<=sqrt(x); i++) { if(x%i==0)return false; } return true; } void dfs(int dep,int last) { if(dep>n) { if(prime(last))cout<<last<<endl; return; } else { for(int...
SORTING In sorting, if order of duplicates remains same after soting, then stable,and if order of duplicates change after sorting,then unsorted. //comparision based sortings: bubble insertion selection quick merge ...
/* * Copyright (c) 2012, Jan-Philipp Litza <janphilipp@litza.de> * 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 * ...
#include <Servo.h> void invK(float tempX, float tempY); float x = 40; float y = 120; float l1 = 105; float l2 = 121; float e = 0; float s = 0; float ang = 0; int a = 40;//x start int b = 120;//x end int c = 120; int d = 180; Servo servo1; Servo servo2; void setup() { Serial.begin(9600); servo...
#include "inc/texture_manager.hpp" #include <sstream> #include <tinyxml2.h> #include <inc/utility.hpp> namespace astroblaster { bool TextureManager::add_texture(std::string filename, unsigned int mode) { if (!this->textures.count(filename)) { if (mode & static_cast<unsigned int>(TextureModes::Sheet)) { tinyx...
/* ID: hjl11841 TASK: ride LANG: C++ */ #include<bits/stdc++.h> using namespace std; string ufo; string group; int main(){ freopen("ride.in","r",stdin); freopen("ride.out","w",stdout); cin>>ufo; cin>>group; int a,b; a=b=1; for(int i=0;i<ufo.size();i++){ int tmp1; tmp1=ufo[i]-'A'+1; a*=tmp1; } for(int i...