text
stringlengths
8
6.88M
#ifndef DECK56_HPP #define DECK56_HPP #include "Deck52.hpp" class Deck56: public Deck52{ public : Deck56(); }; #endif
#include <iostream> #include <cstdlib> #include <ctime> using namespace std; void sort(int*a, int b) { int j, c; int i_min; for (int i = 0; i<b-1;i++) // swap (a[i], a[i_min]) { i_min = i; for (j = i + 1; j < b; j++) if (...
/* Copyright (c) 2015, Vlad Mesco 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 conditions and the follo...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2005 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef CUSTOMIZE_HEADER_DIALOG_H #define CUSTOMIZE_HEADER_DIA...
#ifndef __FOOBAR_VOTING_MACHINE_H__ #define __FOOBAR_VOTING_MACHINE_H__ #include <string> #include <vector> #include <unordered_map> #include <utility> #include "types.h" namespace foobar { class voting_machine { public: void add_vote(const std::string &voter, const std::string &choice); void add_delegatio...
/* https://www.acmicpc.net/problem/5622 */ #include <iostream> #include <cstring> using namespace std; int main(void) { char str[16] = { 0, }; scanf("%s", str); int strLength = strlen(str); int total = 0; for (int i = 0; i < strLength; i++) { char ch = str[i]; switch (ch) { case 65: case 66: case 67: ...
#ifndef INCLUDE #define INCLUDE #include <iostream> #include <vector> #include <string> #include <fstream> #include <regex> #include <unordered_map> #include <cassert> #include <cstdarg> #include <cstring> using std::cout; using std::cin; using std::flush; using std::vector; using std::string; using std::istream; usi...
#include<bits/stdc++.h> using namespace std; main() { int n, as[100000]; while(cin>>n) { int i, chest=0, biceps=0, backs=0; for(i=1; i<=n; i++)cin>>as[i]; int c=1, bi=0, ba=0; i=1; while(i<=n) { if(c==1) { chest+=as[i]; ...
#include <iostream> using namespace std; /* Problema 4.1 Complejidad de tiempo: O(N) */ int main() { int capacitores; cin >> capacitores; float valorMaximo = 0; int indiceMaximo = 0; for (int i = 0; i < capacitores; i++) { int capacitancia, voltaje, corriente; cin >> capacitancia >> voltaje >> corriente; ...
#ifndef NET_INCLUDE_H #define NET_INCLUDE_H #include <string> #include <vector> using namespace std; typedef vector<string> VSTRING; typedef struct { int nRow; int nCol; bool bValid; }POS; class net { public: net(string s[], int n); ~net(); bool in_net(string ...
// BEGIN CUT HERE // PROBLEM STATEMENT // // You are writing a simple text editor that supports only // the following two commands: // // "type c" where c is a character: Append character c to the // end of the current text. // "undo t" where t is an integer: Undo all operations that // were performed in the prev...
#include <string> #include <iostream> #include <numeric> #include <vector> double Range(double start, int end, double interest); int main() { double amount = 0; std::cout << "How much to invest : "; std::cin >> amount; double interest = 0; std::cout << "Interest rate : "; std::cin >> interest...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2011 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" #if defined(_PLUGIN_SUPPORT_) && !defin...
#pragma once template <typename TCollection, typename TFilter> class query_where { public: template <typename TNestedIterator> class iterator { public: using iterator_category = std::forward_iterator_tag; using value_type = typename std::iterator_traits<TNestedIterator>::value_type; using difference_type = t...
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/app18.unoproj.g.uno. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Uno.Float4.h> #include <Uno.UX.Property-1.h> namespace g{namespace Fuse{namespace Controls{struct TextControl;}}} namespace g{namespace...
#include "LeaveProcess.h" #include "Logger.h" #include "HallManager.h" #include "Room.h" #include "ErrorMsg.h" #include "GameCmd.h" #include "ProcessManager.h" LeaveProcess::LeaveProcess() { this->name = "LeaveProcess"; } LeaveProcess::~LeaveProcess() { } int LeaveProcess::doRequest(CDLSocketHandler* clientHandler...
#ifndef SETTINGS_H_ #define SETTINGS_H_ constexpr int flag = 0; //if using ccs811/bme280 keep flag=0 //if using ms8607 keep flag=1 #endif // SETTINGS_H_
/* * reverse_adj_list.cpp * * Created on: 05-Nov-2017 * Author: divya */ #include <sstream> #include <fstream> #include <string> #include <iostream> #define debug 0 using namespace std; // n = num of vertices, m = num of edges //int main(int argc, char **argv) void reverse_adj_list(const char *filename,...
#include "TimeCode.h" #ifdef USING_QT #include <QRegExp> #include <QStringList> #else #include <regex> #endif #include <cmath> #include <cfenv> #include <sstream> #include <iostream> #include <iomanip> #include <cassert> template<typename T> std::vector<T> split(const T& str, const T& delimiters) { std::vector<T...
#define _CRT_SECURE_NO_WARNINGS #include "Table.h" #include "Tree.h" #include "Node.h" #include <stdlib.h> #include <stdio.h> #define SIZE 256 #define MSG 1000 int main() { Table *table = inizialise(); char file[] = "text.txt"; setTable(table, file); Table * tableCount = clearTable(table); int sizeTableCount = si...
#pragma once #include "cocos2d.h" #include "cocos-ext.h" #include "ui/CocosGUI.h" #include "SceneManager.h" USING_NS_CC; class ShopLayer : public Layer { public: ShopLayer(); ~ShopLayer(); CREATE_FUNC(ShopLayer); virtual bool init(); };
/**************************************************************************** * * * Author : lukasz.iwaszkiewicz@tiliae.eu * * ~~~~~~~~ * * Lice...
#include <iostream> #include <random> #include <iomanip> #include <unordered_map> using namespace std; #define ADDR_SLICE true int main() { random_device rd; mt19937 gen(rd()); unordered_map<uint32_t, uint32_t> mem; uniform_int_distribution<uint32_t> dist(0, 0xfffffffful); size_t count = 0; while(!cin....
#include <iostream> #include <ctime> #include "Maze.h" using namespace std; int main() { //Maze maze; //maze.GenerateRandomArray(); Maze* maze = new Maze(); maze->GenerateRandomArray(); cout <<endl<<"起始關卡 :"<< endl; maze->PrintMaze(); cout << endl; if (maze->visit(1,1)!= 2) {//這邊就會改變class內的路徑結果數據 cout ...
#include <stdio.h> #include<stdlib.h> #include<string.h> /*Programa que pide el nombre al usuario y devuelve la cantidad de vocales que contiene. Elaborado por:Viviana Rojas Ruiz*/ int main() { char vec[20]; char *nombre=vec; printf("Ingrese su Nombre: "); gets(nombre); int cont=0; for(int x=0;x<20;x...
#include <Windows.h> #include "Mutex.h" struct Mutex::MutexInternal { ::CRITICAL_SECTION mtx; }; Mutex::Mutex(void):m_pInternal(NULL) { m_pInternal = new MutexInternal; ::InitializeCriticalSection(&m_pInternal->mtx); } Mutex::~Mutex(void) { ::DeleteCriticalSection(&m_pInternal->mtx); } bool Mutex::enter() { ::...
// Created by: Peter KURNEV // 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 S...
#include "pch.h" CTestOneIocp* CTestOneIocp::_Instance = nullptr; DWORD WINAPI GameThreadCallback(LPVOID parameter) { CTestOneIocp* iocp = (CTestOneIocp*)parameter; while (TRUE) { iocp->GameThreadCallback(); Sleep(1); } } DWORD WINAPI KeepThreadCallback(LPVOID parameter) { CTestOneIocp *Owner = (CTestOneI...
#include<iostream> #include<cstdio> #include<cstring> using namespace std; bool r[30],c1[30],c2[30]; int ans[30]; int n,sum; void print() { for (int i = 1;i < n; i++) printf("%d ",ans[i]); printf("%d\n",ans[n]); sum++; } void dfs(int k) { //cout << k << " " << n << endl; if (k > n) {//cout <...
class Solution { public: int maxProfit(vector<int>& prices) { if(prices.size() < 2) return 0; vector<int> buy(prices.size(),0); vector<int> sell(prices.size(),0); buy[0] = -prices[0]; buy[1] = prices[1]>prices[0]?-prices[0]:-prices[1]; sell[0] = 0; sell[1] = p...
#include<bits/stdc++.h> using namespace std; int main(){ string str; cin>>str; int cnt=0; int p=0; for(int i=0;i<str.length();i++){ if(str[i]!='0'){ p=i; break; } } str.erase(0,p); p=-1; for(int i=str.length()-1;i>=0;i--){ ...
//66 class Solution { //quick but ugly public: vector<int> plusOne(vector<int>& digits) { int next = 1; for(int i=digits.size()-1;i>=0;--i){ if(next!=0){ if(digits[i]!=9){ ++digits[i]; next = 0; return digits; }else{ digits[i]=0; } }else{ return digits; } ...
#pragma once #include "../Toolbox/Toolbox.h" #include "../Idioms/NotCopiable/NotCopiable.h" #include "../Graphics/Color/Color.h" #include <string> namespace ae { class WindowSettings; class Renderer; /// <summary> /// Utility class that can be used to create application runned by the engine.<para/> /// It can ...
#include <cstdio> #include <iostream> #include <vector> #include <string> #include <stack> #include <unordered_map> #include <unordered_set> #include <queue> #include <algorithm> #define INT_MAX 0x7fffffff #define INT_MIN 0x80000000 using namespace std; vector<int> helper(vector<vector<int>> &matrix, int col, int ro...
../forwarding/forwarding.cpp
/*Complete the function below Which contains 2 arguments 1) root of the tree formed while encoding 2) Encoded String*/ string decode_file(struct MinHeapNode* root, string s) { //add code here. string ans =""; struct MinHeapNode*curr = root; for(int i = 0;i<s.size();i++){ if(s[i] == '0'){...
#include "compman.h" compman::compman(sf::Texture* texture, sf::Vector2u imageCount, float switchTime, float speed, float jumpHeight) :animation(texture, imageCount, switchTime), canJump(0) { this->speed = speed; this->jumpHeight = jumpHeight; row = 0; faceRight = true; body.setSize(sf::Vector2f(75.0f, 75.0f))...
#include <stdio.h> #include <string.h> #include <stdlib.h> #define STUDENTSMAX 3 #define SUBJECTSMAX 3 typedef struct { int roll; char *name; float subjects[SUBJECTSMAX]; float avg; } student; int getInt(const char *msg) { int x; printf("%s", msg); scanf("%d", &x); return x; } float getReal(const ch...
#include "gf2_polynomial_tests.h" #include "gf2_polynomial.h" #include "test_assert.h" #include <sstream> namespace { void test_construction() { std::vector<uint8_t> c = {{1,0,0,1,1,0}}; auto p = make_gf2_polynomial(c); TEST_EQ(p.coefficients.size(), 5); } void test_stream() { std::vector<uint8_t> c = {{1,0...
/***************************************************************************************************************** * File Name : arrayqueue.h * File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\tutorials\nptel\DSAndAlgo\lecture03\arrayqueue.h * Created on : Dec 29, 2013 :: 7:07:17 PM * Autho...
#include<iostream> #include<string> using namespace std; class Vehicle { protected: string vehicleName; string vehicleModel; string vehicleType; public: Vehicle() { } void setVehicleName(string vehicleName) { this->vehicleName = vehicleName; } void setVehicleModel(string vehicleModel)...
#ifndef MORPHOLOGY_H #define MORPHOLOGY_H #include <QImage> #include <QPoint> namespace Morphology { // Any colour that is not Qt::color1 is assumed to be Qt::color0. // Origin specifies the point on the kernel to use as the origin. // The passed images should be in ARGB32 format. void dilate(QImage& ...
template <class T> class Heap{ struct Item{ Item( T data ); ~Item(); Item* nxt; Item* lst; T dta; } Boolean bubble( Item* itm ); Item* root; public: Heap(); ~Heap(); void append(T data); T pop(); }
// // Transaction.hpp // EX05_05 // // Created by Eben Schumann on 11/1/16. // Copyright © 2016 Eben Schumann. All rights reserved. // #ifndef Transaction_hpp #define Transaction_hpp #include <iostream> #include <string> #include <vector> using namespace std; class Transaction { private: int Date; // This r...
#include "prims.hpp" #include "vm.hpp" #include "defs.hpp" #include "process.hpp" #include "utils.hpp" #include "mmobj.hpp" #include "mec_image.hpp" #include "net_prims.hpp" #include <string> #include <iostream> #include <fstream> #include <sstream> #include <boost/filesystem.hpp> #include <gc_cpp.h> #include "gc/gc_a...
/* 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 "Player.h" Player::Player() : m_isAI(false) { } Player::~Player() { } void Player::Drawn(LinkedList* pBag, int count) { for (int i = 0; i < count; i++) { Node* node = pBag->Pop(); hand.AddTail(node); } } void Player::ClearHand() { hand.Clear(); } bool Player::...
// // Created by Yujing Shen on 28/05/2017. // #ifndef TENSORGRAPH_SESSIONTENSOR_H #define TENSORGRAPH_SESSIONTENSOR_H #include "TensorGraph.h" namespace sjtu{ class SessionTensor { public: SessionTensor() = delete; SessionTensor(const SessionTensor &rhs); SessionTensor(const Sha...
#pragma once // Listing 3.4 An outline class definitoin for a thread-safe stack #include <exception> #include <memory> #include <mutex> #include <stack> struct empty_stack :public std::runtime_error { // ³ΆΚΤ // const char* what() const noexcept; explicit empty_stack(const char* s) :std::runtime_error(s) {} }; t...
/*********************************************************\ * Copyright (c) 2012-2018 The Unrimp Team * * 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 wit...
#include "NuiMatrix.h" namespace NuiMatrix { /// <summary> /// Set Identity in a Matrix4 /// </summary> /// <param name="mat">The matrix to set to identity</param> void SetIdentityMatrix(Matrix4 &mat) { mat.M11 = 1; mat.M12 = 0; mat.M13 = 0; mat.M14 = 0; mat.M21 = 0; mat.M22 = 1; mat.M23 = 0; mat.M24 = 0; ...
#include "cli.h" #include <cerrno> #include <cstring> #include <regex> #include <string> #include <thread> #include <utility> #include <vector> #include "replxx.hxx" using namespace replxx; int utf8str_codepoint_len(char const* s, int utf8len) { int codepointLen = 0; unsigned char m4 = 128 + 64 + 32 + 16; ...
#include "I2Y0A21.h" I2Y0A21 i(6,0.1); void setup() { Serial.begin(9800); } void loop() { Serial.println(i.measure()); delay(100); }
#ifndef _GBUFFEREDINPUT_H #define _GBUFFEREDINPUT_H #include "../G_Core/GBroadcasting.h" #include "../G_System/GKeyDefines.h" namespace GW { namespace CORE { #pragma pack(push, 1) //! G_INPUT_DATA will hold any information you may need about an Input Event. /*! */ struct G_INPUT_DATA { int _data; /...
#include <QtTest/QtTest> #include <QObject> #include "generator.h" #include "plugins.h" #include "menu.h" class TestGenerator : public QObject { Q_OBJECT private slots: void generateSite(); void translateContent_data(); void translateContent(); void nextTokens_data(); void nextTokens(); voi...
/* Name: 代价 Copyright: Author: Hill Bamboo Date: 2019/8/21 16:45:09 Description: 不知道pdd出这题有啥意义 扩展: 给定n 个任务, 每个任务的代价是 c_i, 做完第i个任务后可以用 |c_i - c_j| 的代价完成第 j 个任务 解法: 最大值减最小值 */ #include <bits/stdc++.h> using namespace std; // https://www.nowcoder.com/questionTerminal/b7985769dc434d85a16717908669bcab?f=discussion ...
#pragma once #ifndef IMAGIO_JOINT_TRACKER #define IMAGIO_JOINT_TRACKER #pragma once #define GLM_FORCE_RADIANS #pragma warning(push, 0) #include <glm/gtc/matrix_transform.hpp> #include <glm/mat4x4.hpp> #include <glm/gtc/type_ptr.hpp> #pragma warning(pop) #include <vector> #include <cmath> #include <tuple> #inc...
/* This file is part of FineFramework project */ #ifndef FFW_UTILS_MATH_TOKENIZER #define FFW_UTILS_MATH_TOKENIZER #include "config.h" #include <string> namespace ffw { /** * @ingroup utils */ template<class T, typename CharTrait = std::char_traits<T>, typename Allocator = std::allocator<T>> class...
/* Сортировка четных чисел из файла 1. Ввести имя файла с консоли. 2. Прочитать из него набор чисел. 3. Вывести на консоль только четные, отсортированные по возрастанию. Пример ввода: 5 8 11 3 2 10 Пример вывода: 2 8 10 */ import java.io.*; import java.util.ArrayList; import java.util.Arrays; import java.util.Scanne...
// // StateIndicatorLED.hpp // // // Created by Markus Buhl on 15.11.18. // #ifndef StateIndicatorLED_hpp #define StateIndicatorLED_hpp #include <stdio.h> #include "StateIndicatorLED.hpp" #include "Arduino.h" #include "FastLED.h" enum IndicatorLEDType { SOLID, BLINKING, BREATHING }; class StateIndic...
#include<iostream> #include<stdio.h> #include<string.h> #include<vector> int main() { int k,N,M,*x,*y,i,j=0; std::vector <std::string> output; do{ std::cin>>k; if(k==0) break; x=(int*)calloc(k,sizeof(int)); y=(int*)calloc(k,sizeof(int)); std::cin>>N>>M; for(i=0;i<k;i++) ...
// This program is free software: you can use, modify and/or redistribute it // under the terms of the simplified BSD License. You should have received a // copy of this license along this program. If not, see // <http://www.opensource.org/licenses/bsd-license.html>. // // Copyright (C) 2014, Roberto P.Palomares <r.per...
// // This file contains the C++ code from Program 7.21 of // "Data Structures and Algorithms // with Object-Oriented Design Patterns in C++" // by Bruno R. Preiss. // // Copyright (c) 1998 by Bruno R. Preiss, P.Eng. All rights reserved. // // http://www.pads.uwaterloo.ca/Bruno.Preiss/books/opus4/programs...
// Created on: 2001-07-25 // Created by: Julia DOROVSKIKH // Copyright (c) 2001-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...
// Created on: 1996-01-05 // Created by: Jean Yves LEBEY // Copyright (c) 1996-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GN...
int rob(vector<int>& nums) { if(nums.empty()) return 0; int k0 = 0; int k1 = nums[0]; int k = k1; for(int i=1; i<nums.size(); i++) { k = max(k0+nums[i], k1); k0 = k1; k1 = k; } return k; }
//check out my youtube channel :https://www.youtube.com/channel/UC92gG4BBWAYu4vw_OgsgSLA?view_as=subscriber #include<LiquidCrystal.h> #include<Servo.h> #define button1 22 #define button2 23 #define button3 24 #define button4 25 #define button5 26 #define button6 27 #define button7 28 Servo servo1; Servo servo2; Serv...
#include <iostream> #include <cmath> #include <algorithm> #include <vector> #include <random> #include <ctime> #include <numeric> using namespace std; using Point = pair<float, float>; using Paramater = Point; // (k, b) using Module = vector<Point>; double gaussrand() { static double V1, V2, S; static int...
#include "parser_main.h" #ifndef __PARSER_LINKS__ #define __PARSER_LINKS__ /** * A class of functions for manipulating links within * wikimarkup. Extends the base parser class. */ class link_parser : public parser{ private: /** * A string representing the identifying characters * for a wikimarkup...
#pragma once #include <iberbar/RHI/D3D11/Headers.h> #include <iberbar/RHI/D3D11/ShaderReflection.h> #include <iberbar/RHI/Shader.h> namespace iberbar { namespace RHI { namespace D3D11 { class CDevice; //class CConstantBuffer; class CUniformBuffer; class CShader abstract : public IShader { ...
/** * Unidad 5: MIDI * Notas MIDI: * http://www.midimountain.com/midi/midi_note_numbers.html */ #include <MIDI.h> MIDI_CREATE_DEFAULT_INSTANCE(); byte nota; void setup() { MIDI.begin(); // Podemos seleccionar el canal o usar 1 por defecto Serial.begin(115200); } void loop() { nota ...
// // Model.h // Odin.MacOSX // // Created by Daniel on 15/10/15. // Copyright (c) 2015 DG. All rights reserved. // #ifndef __Odin_MacOSX__Model__ #define __Odin_MacOSX__Model__ #include "Drawable.h" #include "Transform.h" #include <assimp/Importer.hpp> #include <assimp/scene.h> #include <assimp/postprocess.h> #i...
/* Name: 字符迷阵 Copyright: Author: Hill bamboo Date: 2019/8/17 9:41:48 Description: 网易 特例 aaaaa 查找 a 这算几个 ? 16个?还是5个? 按题意应该是16个,下面的代码也是输出16个的 总结: 扣完边界四十分钟写完,在考试中还是太慢了 */ #include <bits/stdc++.h> using namespace std; vector<string> maze; string str, t; int m, n; bool inside(int x, int y) { return 0 <= x && ...
#include "Q04.h" /* ----------------------- CNode ----------------------- */ CNode::CNode(){ setType(LEAF); setKeyNum(0); } CNode::~CNode(){ setKeyNum(0); } int CNode::getKeyIndex(KeyType key)const { int left = 0; int right = getKeyNum()-1; int current; while(left!=right) { current = (left+right)/2; Ke...
#include "Includes.h" #include <iostream> #include <cstdio> #include <vector> #include <algorithm> using namespace std; int solver(const vector<int> &v); void uva11264Main() { int ntc, n, x; vector<int> v; scanf("%d", &ntc); while(ntc-->0) { scanf("%d", &n); for(int i=0;...
#pragma once class IKComponent; class IKObject : public hg::IComponent { public: IKObject(); static hg::Entity* Create(XMVECTOR pos, XMVECTOR dir, float length, StrID ikInstanceName, IKObject* parent = nullptr, IKComponent* ikComponent = nullptr); static hg::Entity* Create( XMVECTOR pos, XMVECTOR dir, float length,...
// // Created by jglrxavpok on 04/09/2020. // #pragma once #include <curand_kernel.h> #include "Material.h" class Dielectric: public Material { private: double refractiveIndex; public: __device__ explicit Dielectric(double refractiveIndex); __device__ bool scatter(const Ray &ray, const HitResult &h...
#ifndef _UTIL_QP_H_ #define _UTIL_QP_H_ #include "adjunct/m2/src/include/defs.h" #include "modules/encodings/charconverter.h" #include "modules/util/opstring.h" #if !defined IN # define IN #endif #if !defined OUT # define OUT #endif #if !defined IO # define IO #endif class InputConverterManager; class OpQP { public...
#include <iostream> #include <utility> using std::cout; //------------------------------ template<typename T1, typename T2> struct pair{ typedef T1 first_type; // Sposob na przechowanie typow typedef T2 second_type; // wewnatrz struktury. pair() : first(T1()), second(T2()) {} pair(const T1 &a, const T2 &b)...
#ifndef BUTTON_H_ #define BUTTON_H_ #include "GameInterface.h" class Button : public GameInterface { public: Button(SDL_Rect *r, /*SDL_Texture *t*/SDL_Surface *s); bool isActive(Uint32 mouseState, SDL_Event event); }; #endif
#include <iberbar/Font/FreeType.h> #include <iberbar/Utility/Math.h> #include <iberbar/Utility/Buffer.h> #include <ft2build.h> #include FT_FREETYPE_H #include FT_GLYPH_H #include FT_STROKER_H #include <freetype/fterrors.h> namespace iberbar { class CBitsBuffer { public: CBitsBuffer( void ); ~CBitsBuffer();...
#include "PEImage.h" #include "exceptions.h" #include <Windows.h> #include "DumpPE.h" using namespace std; shared_ptr<std::string> PEImage::getImage() { return m_image; } DWORD PEImage::getImageSize() { return m_imageSize; } PEImage::PEImage() { // Intentionally left empty. } std::shared_ptr<PEImage> PEImage::f...
#include <iostream> using namespace std; /* Problema 1.2 Complejidad de tiempo: O(1) */ int main() { int puntos; cin >> puntos; //Solo los primeros tres puntos son relevantes int alturas[3]; for (int i = 0; i < 3; i++) { cin >> alturas[i]; } //Calcula la concavidad utilizando la pendiente de las pendientes...
// 在大多数的情况下,我们把数组名和指针等同起来,除了sizeof,以及通常而言指针能进行修改,而数组名是常量 // &array 与&array[0] 是不同的,尽管他们的值相等,但是在进行+2运算的时候,前者加的是2*(sizeof array),后者加的是2*int(假设array是int数组) #include <iostream> int main() { using namespace std; int * p = new int[10]; // psome指向10个int值内存块中的第一个元素 for (int i = 0; i < 10; i++) { p[i] = i; } for (int i...
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #define INF 1000000000 #define REP(i,n) for(int i=0; i<n; i++) #define REP_R(i,n,m) for(int i=m; i<n; i++) #define MAX 100 using namespace std; i...
#ifndef ATTACK_H #define ATTACK_H #include "../unit/Unit.h" class Unit; class Attack { protected: Unit* instance; public: Attack(Unit* instance); virtual ~Attack(); virtual void attack(Unit* enemy); virtual void counterAttack(Unit* enemy); }; #endif // ATTACK_H
// Created on: 1996-12-26 // Created by: Alexander BRIVIN and Dmitry TARASOV // Copyright (c) 1996-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under //...
// Created on: 2004-06-15 // Created by: Sergey ZARITCHNY <szy@opencascade.com> // 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 Publ...
// // NTPEventArgs.cpp // // $Id: //poco/1.4/Net/src/NTPEventArgs.cpp#1 $ // // Library: Net // Package: NTP // Module: NTPEventArgs // // Implementation of NTPEventArgs // // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // and Contributors. // // SPDX-License-Identifier: BSL-1.0 // #include "_...
#include "widget.h" #include "ui_widget.h" Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this); ui->pushButton->setText("speach"); } Widget::~Widget() { delete ui; } void Widget::on_pushButton_pressed() { ui->pushButton->setText("release"); m_audio =n...
// Copyright 2012 Yandex #ifndef LTR_LEARNERS_GP_LEARNER_GP_LEARNER_H_ #define LTR_LEARNERS_GP_LEARNER_GP_LEARNER_H_ #include <boost/lexical_cast.hpp> #include <string> #include <vector> #include <functional> #include "contrib/puppy/Puppy.hpp" #include "ltr/learners/learner.h" #include "ltr/learners/gp_learner/gp...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** Copyright (C) 1995-2012 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 MENUBAR_H #d...
#include <string> #include <iostream> #include <specex_message.h> #include <specex_pyprior.h> using namespace std; int specex::PyPrior::set_priors(specex::PyOptions opts){ map<string,Prior*> priors; { int np=int(opts.argurment_priors.size()); if( ! (np%3==0) ) { cerr << "error in parsing, priors mu...
/* -*- 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. */ /** @file stdlib_string_common.inl Common string declarations. ...
/* BEGIN LICENSE */ /***************************************************************************** * SKFind : the SK search engine * Copyright (C) 1995-2005 IDM <skcontact @at@ idm .dot. fr> * $Id: wordlist.cpp,v 1.55.2.4 2005/02/21 14:22:47 krys Exp $ * * Authors: Arnaud de Bossoreille de Ribou <debossoreille @at...
// ChatClient.cpp : 콘솔 응용 프로그램에 대한 진입점을 정의합니다. // #include "stdafx.h" // 클라이언트 통신을 담당할 CTestClientSession 개체 // CClientSession을 상속받아서 사용합니다. class CTestClientSession : public CClientSession { protected: // 클라이언트가 접속 성공되었을때 호출되는 가상함수 VOID OnIoConnected(VOID) { //std::cout << "IOConnected" << std::endl; } // 클...
#include <Shaders/Shader.h> CShader::CShader(GLenum type, const std::string &source) : _id(glCreateShader(type)) { compile(source); } CShader::~CShader() { glDeleteShader(_id); } void CShader::compile(const std::string &source) { utils::Log(L"Compiling shader...", utils::ELogLevel::Debug); utils:...
#include <iostream> #include "Fraction.h" using namespace std; // invariant: denominator is always positive. // fraction always in lowest terms (simplified). // Default constructor Fraction::Fraction(void) { numerator = 0; denominator = 1; } // Constructor Fraction::Fraction(int n, int d) { if (d == 0...
// // MapElement.h // GetFish // // Created by zhusu on 15/2/4. // // #ifndef __GetFish__MapElement__ #define __GetFish__MapElement__ #include "cocos2d.h" USING_NS_CC; class MapElement : public CCSprite { public: static MapElement* create(int star,int lev); virtual bool init(int star,int lev); ...
// You are given an infix expression S of length N. You need to convert the given expression S to its postfix equivalent using stack. // Input // The first line of the input contains a single integer T denoting the number of test cases. The description of T test cases follows. // The first line of each test case contai...