text
stringlengths
8
6.88M
#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...
// (C) 1992-2016 Intel Corporation. // Intel, the Intel logo, Intel, MegaCore, NIOS II, Quartus and TalkBack words // and logos are trademarks of Intel Corporation or its subsidiaries in the U.S. // and/or other countries. Other marks and brands may be claimed as the property // ...
#include<iostream> #include<algorithm> #include<vector> #include<map> using namespace std; class MinStack { public: //基本思想:辅助栈 MinStack() { minElem.push_back(INT_MAX); } void push(int x) { st.push_back(x); minElem.push_back(min(minElem[minElem.size() - 1], x)); } void pop() { st.pop_back(); minElem.pop_...
#include <ionir/passes/pass.h> namespace ionir { StringLiteral::StringLiteral(std::string value) : Value(ValueKind::String, TypeFactory::typeString()), value(std::move(value)) { // } void StringLiteral::accept(Pass &visitor) { visitor.visitStringLiteral(this->dynamicCast<St...
/** * Uses the "character cast" to retreive * the sprites name */ #pragma once #include "ref_count.h" #include <string> #include <vector> class CartFile; class SpriteProperty; class StockSprite { public: bool Load(CartFile& cart); typedef struct { WORD palette_id; WORD animation...
#include <iostream> #include <vector> #include <map> using namespace std; class Perception{ bool location; bool isDirty; public: Perception(bool _location = true, bool _isDirty = true){ this->location = _location; this->isDirty = _isDirty; } bool getLocation(){ return loc...
#pragma once #include "proto/data_base.pb.h" #include "proto/data_rank.pb.h" #include "proto/data_battle.pb.h" #include "proto/data_tower.pb.h" #include "proto/data_mansion.pb.h" #include "proto/data_child.pb.h" #include "proto/data_league.pb.h" #include "proto/data_activity.pb.h" #include "proto/data_route.pb.h" #inc...
//https://www.reddit.com/r/dailyprogrammer/comments/4so25w/20160713_challenge_275_intermediate_splurthian/ #include <iostream> // std::cout #include <string> // std::string #include <vector> #include <iterator> #include <algorithm> #include <fstream> void isValidName(std::string ele, std::string sym) {...
#pragma once namespace Game { struct ShaderData { ShaderData() { } GLuint programId; GLuint matrixId; GLuint modelSpaceId; GLuint vertexUVID; GLuint viewMatrixID; GLuint modelMatrixID; GLuint normalModelSpaceId; }; }
class Solution { public: int compareVersion(string version1, string version2) { int a, b, i, j; i = j = 0; while (i<version1.length() || j<version2.length()) { a = b = 0; while(i<version1.length() && version1[i] != '.') a = 10*a + version1[i++...
// 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.UX.PropertyAccessor.h> namespace g{namespace Uno{namespace UX{struct PropertyObject;}}} namespace g{namespace Uno{namespace UX{stru...
#include <iostream> #include <opencv2/core/mat.hpp> #include <opencv/cxmisc.h> cv::Mat calcIntegralImage_naive(cv::Mat &image){ cv::Mat IntegralImage = cv::Mat::zeros(image.rows, image.cols, CV_64FC1); for(int h = 0; h < image.rows; h++){ for(int w = 0; w < image.cols; w++){ for (int j = 0...
#include "Mesh.h" Mesh::Mesh() { } Mesh::~Mesh() { } void Mesh::initaliseQuad() { //assert(VAO == 0); //checks that the mesh is not initalized already //generate buffers glGenBuffers(1, &VBO); glGenBuffers(1, &IBO); glGenVertexArrays(1, &VAO); //shoudlnt this go befor the vbo since the vao contains it //bind v...
/**************************************************************************** * * * Author : lukasz.iwaszkiewicz@tiliae.eu * * ~~~~~~~~ * * Lice...
/*-------------------------------------------------------------------- Name: Michael Martin and Jeremiah Cantu Date: 12/6/2020 Course: CSCE 236 Embedded Systems (Spring 2020) File: lab2_button_count.ino HW/Lab: Lab 2, Button Count Code Purp: Testing timers and counters Doc: Jeremiah Cantu was my lab partner A...
// Copyright 2012 Yandex #ifndef LTR_LEARNERS_DECISION_TREE_DECISION_TREE_LEARNER_H_ #define LTR_LEARNERS_DECISION_TREE_DECISION_TREE_LEARNER_H_ #include <vector> #include <string> #include <functional> #include "logog/logog.h" #include "ltr/learners/learner.h" #include "ltr/learners/decision_tree/utility/utility....
#include <algorithm> #include <fstream> #include <iostream> #include <regex> #include <sstream> #include <stdexcept> #include <vector> #include "hash.h" using namespace std; typedef pair<string, uchar_vector> t_handlehashpair; // These values are just an example. Do not get too excited if you "win" using these valu...
/* Copyright (c) 2015, M. Kerber, D. Morozov, A. Nigmetov 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 conditio...
/* * Copyright (c) 2020 Morwenn * SPDX-License-Identifier: MIT */ #ifndef CPPSORT_TESTSUITE_WRAPPER_H_ #define CPPSORT_TESTSUITE_WRAPPER_H_ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include <utility> ///////////////////////...
#ifndef ABOUTBOOKCRICKET_H #define ABOUTBOOKCRICKET_H #include <QDialog> namespace Ui { class aboutbookcricket; } class aboutbookcricket : public QDialog { Q_OBJECT public: explicit aboutbookcricket(QWidget *parent = 0); ~aboutbookcricket(); private slots: void on_pushButton_clicked(); private: ...
#include <iostream> #include "ListaST.h" #include "stdlib.h" using namespace std; int main() { ListaST<int> A; A.inserta(5); A.inserta(1); A.inserta(2); A.inserta(4); A.inserta(3); A.inserta(-2); system("cls"); cout << "Lista:" << endl; A.muestraTusDatos(); cout << endl ...
#include <iostream> #include <algorithm> #include <cstdio> #include <cstdlib> #include <ctime> #include <memory.h> #include <cmath> #include <string> #include <cstring> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include <functional> #include <numeric> #include <ss...
#include "stdafx.h" #include "DelegateWinThreadPool.h" DelegateWinThreadPool::DelegateWinThreadPool(const tstring &csThreadName, int iNumOfThreads) : m_csThreadName(csThreadName) , m_iNumOfThreads(iNumOfThreads) , m_Event(true, false) { } DelegateWinThreadPool::~DelegateWinThreadPool() { } void Del...
#include"conio.h" #include"stdio.h" void main(void) { clrscr(); int radius; float area; printf("Enter Radius of cicle = "); scanf("%d",&radius); area=3.14*radius*radius; printf("\n\nArea of a Cirle is %.2f",area); getch(); }
// // AcidAudioBuffer.hpp // SRXvert // // Created by Dennis Lapchenko on 04/05/2016. // // #ifndef ACIDAUDIOBUFFER_H_ #define ACIDAUDIOBUFFER_H_ #include "../JuceLibraryCode/JuceHeader.h" namespace AcidR { class AcidAudioBuffer : public AudioSampleBuffer { public: AcidAudioBuffer(); ...
// Created on : Sat May 02 12:41:15 2020 // Created by: Irina KRYLOVA // Generator: Express (EXPRESS -> CASCADE/XSTEP Translator) V3.0 // Copyright (c) Open CASCADE 2020 // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it un...
#include <stdio.h> #include <math.h> #include <PortAudio/portaudio.h> #include <sndfile.hh> #ifdef WIN32 #include <windows.h> #if PA_USE_ASIO #include <PortAudio/pa_asio.h> #endif #endif #define NUM_SECONDS (180) #define SAMPLE_RATE (44100) //Hz #define FRAMES_PER_BUFFER (64) #ifndef M_PI #define M_PI 4*atan(1...
/* ID: washirv1 PROG: ariprog LANG: C++ */ #include <fstream> using namespace std; #define INFILE "ariprog.in" #define OUTFILE "ariprog.out" int square(int i) { return i * i; } int main() { int N, M; ifstream fin(INFILE); fin >> N >> M; fin.close(); const int NUM = square(M) * 2 + 1; // Generate bisquares b...
#include "../include/Command.h" using namespace std; Command::Command():title("") {} const string& Command::operator[](const string& key) const { for(int i(0); i!=keys.size(); i++) { if(keys[i] == key) { return value[i]; } } } string& Command::operator[](const string& key) { for(int i(0); i!=keys.size(...
#include "CSoftwareListWidget.h" #include "CTableWidget.h" #include <QTabWidget> #include <QHBoxLayout> CSoftwareListWidget::CSoftwareListWidget(QWidget *parent) : QWidget(parent) { m_pTabWidget = new QTabWidget(this); QHBoxLayout* hboxLayout = new QHBoxLayout(this); hboxLayout->addWidget(m_pTabWidget); connect(...
#ifndef _NEGATIVE_EXPRESSION_HPP_ #define _NEGATIVE_EXPRESSION_HPP_ #include "Expression.hpp" // Di bawah ini, kelas NegativeExpression menginherit Expression // Namun, sekarang Expression merupakan interface, bukan kelas. class NegativeExpression : public Expression { protected: // Di Java, tidak ada konsep pointe...
// // debug.cpp // utilities // // Created by Six on 2/23/2018. // Copyright 2/23/2018 Six. All rights reserved. // #include <stdarg.h> #include <stdio.h> #include <stdint.h> #include <string.h> #include <memory> #include <string> #include <time.h> #include <ctype.h> #include <libgen.h> #include "string_utils.hpp"...
/* -*- 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. */ #ifndef DESKTOP_EXTENSIONS_MANAGER_H #define DESKTOP_EXTENSIONS_M...
#ifndef CPUCORE_H #define CPUCORE_H #include <QObject> #include "processslot.h" #include <QGraphicsRectItem> #include <QGraphicsTextItem> #include <QTimer> #include <QFont> class CpuCore: public QObject, public QGraphicsRectItem { Q_OBJECT public: CpuCore(QObject* parent=0, int playerNumber=0); ...
#include <iostream> #include <sstream> #include <fstream> #include <map> #include <bitset> #include <string> #include <algorithm> #include <cmath> using namespace std; string decimal_to_binary(int num); // Convert decimal value to binary value int main (int argc, char* argv[]){ // store the encoded list to a map ...
// // Copyright (c) 2013 Mikko Mononen memon@inside.org // Port of _gl3.c to _DE.cpp by dtcxzyw // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // Permission is granted to anyone t...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** Copyright (C) 1995-2004 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef WINDOWSOPFOLDERLISTER_H #de...
// ========================================================================== // $Id: TriangleMesh.h 3765 2013-03-15 19:25:00Z jlang $ // Wrapper code to interface TriangleMesh // TriangleMesh implementation must support VRML reading, normal // generation, setting of normals, vertex (node) access. // ==================...
// // mainclass.h // GreedyTung // // Created by Helen on 10/13/14. // Copyright (c) 2014 ___IWINLAB___. All rights reserved. // // git test #ifndef GreedyTung_mainclass_h #define GreedyTung_mainclass_h #include <iostream> #include <vector> #include <string> //#include "MapManager.hpp" using namespace std; class...
#include "Light.h" Light::Light() { direction = Vector3(0.0f, 0.0f, 0.0f); color = Vector3(1.0f, 1.0f, 1.0f); intensity = 1.0f; } void Light::SetDirection(float x, float y, float z) { direction = Vector3(x, y, z); } void Light::SetColor(float r, float g, float b) { if (r > 1.0f) { r = 1.0f; } else if (r <...
#ifndef AVL_HPP #define AVL_HPP 1 #include "BSTree.hpp" namespace cs202 { template<class Key, class Value> class AVLNode : public BinaryNode<Key, Value> { public: int height; AVLNode() { height = 1; } AVLNode(Key in_key, Value in_value, BinaryNode<Key, Value>* r, ...
#define BUILDING_NODE_EXTENSION #include <node.h> #include <v8.h> #include <Znode.h> using namespace v8; using namespace node; void InitAll(Handle<Object> target) { HandleScope scope; Znode::Init(target); } NODE_MODULE(znode,InitAll)
// // Created by Deepak Ramalingam on 12/6/20. // #include <SDL.h> #include <SDL_image.h> #include "../headers/graphics.h" #include "../headers/globals.h" /* * Graphics class * Holds all information dealing with graphics */ Graphics::Graphics() { SDL_CreateWindowAndRenderer(globals::SCREEN_WIDTH, globals::SC...
#include <iostream> #include <algorithm> using namespace std; #define MOD 1000000007 // 10^9 + 7 typedef long long ll; // 階乗を計算 (MODなし) ll factorial(ll n) { if (n == 1) return 1; return n * factorial(n-1); } // 階乗を計算 (MODあり) ※問題のMODと合致しているかチェック! ll factorial_mod(ll n) { ll ans = 1; for (ll i = n; i > 0; --i)...
#include <iostream> #include <string> #include "smart_bag.h" using namespace std; int main(){ SmartBag<string> b1; b1.add("Hello"); b1.add("World1"); cout << b1 << endl; return 0; }
#include <conio.h> #include <stdlib.h> #include <stdio.h> #include <time.h> #include <string.h> #include <math.h> #include <locale.h> #include <ctype.h> float valor1,valor2; int main() { ret1: printf("\nInsira um valor\n"); scanf("%f",&valor1); printf("\nInsira mais um valor\n"); ret: sca...
#pragma once #include "..//ACTEffect.h" #include "IAct.h" class CAct_Dist : public IAct { public : void Fire( Monster* me, Monster* target, const wchar_t* beamEffectPath, const wchar_t* soundPath, float range, float baseDamage, CVector3 effectScale = { 3.5,3.5,3.5 } ); //ダメージを与え終わったらtrueを返します bool D...
#pragma once #include "Tool.h" #include "AnimationAsset.h" #include "AppColors.h" namespace CAE { class SelectionTool : public Tool { private: // sf::FloatRect selectionRect; sf::FloatRect second_draw; sf::RectangleShape shape; bool ButtonPressed; bool once; ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright 2002-2006 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Peter Karlsson */ #ifndef OPPREFSLISTENER_H #define OPPREFSLISTEN...
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #include <cstdlib> #include <cmath> using namespace std; typedef long long ll; #define INF 10e10 #define REP(i,n) for(int i=0; i<n; i++) #define R...
#pragma once #include "object\GameObject.h" #include "Bomb.h" class Player : public GameObject { Bomb bomb; Vector2 lastPos; int lifeNum; int bombNum; int power; int point; int graze; bool isSlowMode; bool lockSlowMode; int shotCount; int muki; public: Player(); Player(Vector2 position); ~Player() = def...
/* * * Copyright 2015-2016, Google Inc. * 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...
#ifndef RENDERER_H #define RENDERER_H #include <vector> #include <GL/gl.h> #include <GL/glext.h> class App; extern App* a; class Model; class Entity; class Renderer { public: Renderer(); void registerEntity(Entity* e); void render(GLuint); ~Renderer(); protected: privat...
#ifndef __HELLOWORLD_SCENE_H__ #define __HELLOWORLD_SCENE_H__ #include "cocos2d.h" #include "CCWebView.h" USING_NS_CC; USING_NS_CC_WEBVIEW; class HelloWorld : public cocos2d::CCLayer, public cocos2d::webview_plugin::CCWebViewDelegate { public: // Method 'init' in cocos2d-x returns bool, instead of 'id' in cocos...
// // Copyright (C) BlockWorks Consulting Ltd - All Rights Reserved. // Unauthorized copying of this file, via any medium is strictly prohibited. // Proprietary and confidential. // Written by Steve Tickle <Steve@BlockWorks.co>, September 2014. // #include <stdio.h> #include <stdint.h> #include <stdbool.h> #include...
#ifndef CHECKER_H #define CHECKER_H #include <string> #include <vector> #include <map> using namespace std; class Checker{ protected: map<string, int> Dictionary; vector<string> Matches; string wordWithHigestOcurrence; public: Checker(); Checker(map<string, int> Dic); void setDictionary(map<string, i...
# include<iostream> # include<cmath> using namespace std; int main(void) { int grid[10][55]; int sol[10][55]; int rows = 0; cin >> rows; for(int i = 0; i < rows; i++) { for(int j = 0; j <= i; j++) { cin >> grid[i][j]; sol[i][j] = grid[i][j]; } } for(int i = rows-1; i >= 1; i--) { for(int j = 0; ...
#ifndef __OPERATION_H__ #define __OPERATION_H__ #include <iostream> #include "component.h" class Operation : public Base { protected: Base* value1; Base* value2; public: virtual double evaluate() = 0; Operation(); }; #endif
#ifndef SUPPORT_VECTOR_MACHINE_H #define SUPPORT_VECTOR_MACHINE_H #include "Common.h" #include "Feature.h" #include "PascalImageDatabase.h" //! Support Vector Machine Class /*! This class is a wrapper for LIBSVM that allows the SVM training from the image database. It creates a primal form of the weights so i...
#ifndef CONNECTIONCOMMANDS_HH #define CONNECTIONCOMMANDS_HH #include "nanodbc/nanodbc.h" #include <sql.h> #include <sqlext.h> #include "errors.hh" #include "fetch.hh" #include "UVMonitor.hh" #include "odbcutil.hh" #include "arguments.hh" namespace NC { enum struct ConnectionCommands { dbms_name, is_connect...
#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...
#include <iostream> #include <vector> using namespace std; int main () { vector<int>::size_type sz; vector<int> foo; sz = foo.capacity(); cout << "making foo grow:\n"; for (int i=0; i<100; ++i) { foo.push_back(i); if (sz!=foo.capacity()) { sz = foo.capacity(); cout << "capacity changed: " << sz << '\n'...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 2010 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. * * Morten Rolland, mortenro@opera.com */ #include "core/pch.h" #if d...
#include <iostream> #include <sstream> #include <fstream> #include <iomanip> // std::setprecision #include "../include/command_interface.h" #include "../include/constants.h" #include "../lib/rapidxml/rapidxml.hpp" #include "../lib/rapidxml/rapidxml_print.hpp" using namespace rapidxml; using namespace std; string...
#include<ctime> #include<iostream> #include<conio.h> #include<stdio.h> using namespace std; void takeInput(int a[],int n) { for(int i = 0; i < n; i++) { cin>>a[i]; } } int linearSearch(int a[], int num, int size) { for(int i = 0; i < size; i++) { if(a[i] == num) { return i; } } re...
#include <iostream> #include <cmath> #include <iomanip> using namespace std; long double fun(long double x){ long double a = sin(10*x-20)/exp(pow(x-2,2)/5)+0.25-x; return a; } int main() { double x,y; x = 0; y = 0; while (y>=0){ y = fun(x); x += 0.00000001; } while ...
#include<bits/stdc++.h> using namespace std; int timu[1500]; bool vis[1500]; int main(){ int T; cin>>T; while(T--){ for(int i=1000;i<=1015;i++){ timu[i]=0; vis[i]=0; } int cnt=0; int ans=0; int n,m; cin>>n>>m; ...
#include <iostream> using namespace std; int main(){ int t; string s; cin >> t; while(t--){ cin >> s; if(!s.compare("1") || !s.compare("4") || !s.compare("78")){ cout << "+" << endl; }else if(!s.substr(s.length() - 2, 2).compare("35")){ cout << "-" <<...
//算法:模拟,归并排序 //先按照初始分数排一遍序 //之后开始模拟比赛. //将胜利的人加入win数组,将输的人加入los数组 //根据题意,可以得知: //由于原序列中的人是按照 先分数降序 再编号升序 的顺序排列的 //由于只有胜者才加分 //所以在win数组与los数组中,也保证了 先分数降序 再编号升序 的有序性质 //根据归并排序,是将两个有序序列合并的原理 //则可以用O(n)的复杂度完成每次排序 //根据此性质模拟即可 #include<cstdio> #include<algorithm> using namespace std; struct person { ...
#include <iostream> using namespace std; int Sum_Of_Maximum_SubArray(int arr[], int size_of_arr,int neg_max) { if (neg_max > 0) { int max_sum = 0; for (int x = 0; x < size_of_arr; x++) { int sum = 0; for (int y = x; y < size_of_arr; y++) { ...
/* * File: main.cpp * Author: Daniel Canales * * Created on June 24, 2014, 9:34 PM */ #include <cstdlib> #include <iostream> using namespace std; /* * */ int main(int argc, char** argv) { int payamt = 1700; int payper = 26; int annual = payamt*payper; cout << "Employee's Annual Pay i...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2010 Opera Software ASA. 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 WIDGET_RUNTIME_SUPPORT #include "...
#include "CEmployee.h" int main() { char choice = '0'; CEmployee* cemployee = nullptr; CWageEmployee wemp; while (choice != '8') { cout << "\t\t***** Menu *****" << endl; cout << "1) Set Employee Data" << endl; cout << "2) Display Employee Data" << endl; cout << "3) Update Employee Basic Salary" << endl; ...
#include <iostream> using namespace std; class punto{ public: int x; int y; punto(){ x=0; y=0; } punto(int w, int z){ x=w; y=z; } void print(){ cout<< x << " " << y << endl; } int getx(){ return x; } in...
/** * Copyright (c) 2013, 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...
#ifndef MATAUXILIAR_H #define MATAUXILIAR_H #include <iostream> #include <QString> #include <opencv2/opencv.hpp> /* Funciones para dibujar/escribir en matrices de opencv */ void writeText(cv::Mat img, std::string text, int x, int y, cv::Scalar color, double fontscale=0.4); void drawRec(cv::Mat &frame); void draw...
/* Copyright (c) 2012 <benemorius@gmail.com> 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 limitation the rights to use, copy, modi...
#include<iostream> using namespace std; int main() { int i,n,j,k,m; j=0; int index[100], nums[100], output[100]; cout<<"Enter length of array\n"; cin>>n; for(i=0;i<n;i++) { cout<<"Enter elements of nums array\n"; cin>>nums[i]; cout<<endl; output[i]=-1; } ...
#include "AllJoynBase.h" #include "alljoyn\AuthListener.h" //static volatile sig_atomic_t s_interrupt = false; // //static void CDECL_CALL SigIntHandler(int sig) //{ // QCC_UNUSED(sig); // s_interrupt = true; //} volatile sig_atomic_t AllJoynBase::mInterrupt = false; void CDECL_CALL AllJoynBase::SigIntHandler(int si...
#include <iostream> #include <cstdio> using namespace std; int main(){ int n; cin >> n; while(n--){ string str; cin >> str; for(int i = 0; i < str.length(); i++){ if(str[i]!= str[i+1]){ cout << str[i]; } } cout << "\n"; } return 0; }
#include "IProcess.h" #include "Configure.h" #include "BaseClientHandler.h" #include "HallManager.h" #include "Logger.h" #include "ErrorMsg.h" #include "AllocSvrConnect.h" #include "Room.h" #include "RedisLogic.h" #include "ProtocolClientId.h" #include "ProtocolServerId.h" #include "Util.h" #include "GameUtil.h" #inclu...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 2007 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. */ /** \file * * \brief Implement fundamental functions for the memory...
#ifndef _SORTING_BY_BUBBLE_H #define _SORTING_BY_BUBBLE_H #include "adt.h" namespace cs2420 { template<typename T> class SortByBubble : public SortBy<T> { public: SortByBubble(Bag<T>& bag) : SortBy<T>(bag) {} void sort(bool reversed = false){ for(int i = 0; i < this->elements.getSize() - 1; i++){ ...
#pragma once #include "bibliotecas.h" template <typename T> struct NoArvore{ T conteudo; NoArvore * esq; NoArvore * dir; NoArvore(){ this->conteudo=0; this->esq=0; this->dir=0; } NoArvore(T conteudo){ this->conteudo=conteudo; this->esq=0; this-...
#include <iostream> #include <cstdio> using namespace std; int main(){ int M,N; cin >> M >> N; cout << (M * N) / 2<<"\n"; return 0; }
/* ***** BEGIN LICENSE BLOCK ***** * FW4SPL - Copyright (C) IRCAD, 2012-2013. * Distributed under the terms of the GNU Lesser General Public License (LGPL) as * published by the Free Software Foundation. * ****** END LICENSE BLOCK ****** */ #ifndef IOGDCMQT_DICOMDIREDITOR_HPP #define IOGDCMQT_DICOMDIREDITOR_HPP #...
// 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 <ctime> #include <future> #include <fstream> #include <sstream> #include <string> #include <boost/filesyst...
#ifndef Ocean_H #define Ocean_H #include "Height.h" #include "WaveModel.h" #include "Dvector.h" class Ocean { private : double lx; double ly; int nx; int ny; int t; Height hr; WaveModel* model; Dvector vertices; public : Ocean(Height h, WaveModel* wM); Ocean(const Ocean ...
/* Copyright (c) 2014 Mircea Daniel Ispas This file is part of "Push Game Engine" released under zlib license For conditions of distribution and use, see copyright notice in Push.hpp */ #pragma once #include "Core/Hash.hpp" #include "Core/Path.hpp" #include "Core/TypeID.hpp" #include <memory> #include <cstdint> #inc...
#pragma once #include "DynamicObjectModel.h" #include "DynamicObjectView.h" #include "DynamicObjectLogicCalculator.h" class DynamicObjectController { public: DynamicObjectController(); virtual ~DynamicObjectController(); public: //the implementation of the update public and private methods is given and inherited v...
#pragma once #include <qobject.h> #include <qdebug.h> #include <qpointer.h> class test : public QObject { Q_OBJECT public: explicit test(QObject * parent = nullptr); QPointer<QObject> widget; void useWidget(); signals: public slots: };
#include "commons.h" #include "my_signal.h" #include <string.h> #include <cstdio> #include <stdlib.h> #include <unistd.h> #include <signal.h> #include <fcntl.h> #include <sys/types.h> #include <sys/mman.h> #include <sys/stat.h> #include <sys/wait.h> #include <sys/shm.h> #include <syslog.h> const char* const THE_FILE ...
// Copyright (c) 2019 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 ...
/*! \file */ //Copyright 2011-2016 Tyler Gilbert; All Rights Reserved #ifndef STFY_APP_ADC_HPP_ #define STFY_APP_ADC_HPP_ #include <iface/dev/adc.h> #include "Periph.hpp" namespace hal { /*! \brief ADC Peripheral Class * \details This class implements ADC device peripherals. * * \code * #include <stfy/hal.hpp>...
#include <stdio.h> #include <math.h> #include <windows.h> #include <vector> int main(){ }
#include "../src/BakeryLock.hpp" #include "../src/FixnumLockException.hpp" #include <thread> #include <iostream> #include <string> const int THREADS = 7; const size_t N = 6; int count = 0; lab::BakeryLock<N> bl; void change(const bool add) { try { for (int i = 0; i < 5; ++i) { bl.lock(); ...
#ifndef STATICGAMEOBJECT_H_ #define STATICGAMEOBJECT_H_ #include "GameObject.h" class StaticGameObject : public GameObject { protected: double worldX, worldY; double angle; public: StaticGameObject(SDL_Rect *r, SDL_Surface *s,double x, double y,double a); double getWorldX(); double getWorldY(); double ge...
#include "../include/histogram.h" #include "LightImage.h" namespace li { Histogram::Histogram() : channles(0), data(NULL) { } Histogram::Histogram(Image &_im) { channles = _im.channels; data = new int[channles * 256]; for (int j = 0; j < 256 * channles; ++j) { data[j...
#include <iostream> #include "LaminateOrthotropic.h" using namespace std; int main() { MaterialOrthotropic material; LaminateOrthotropic laminate; material.E11 = 27000000.; material.E22 = 1500000.; material.nu12 = 0.35; material.G12 = 1100000.; laminate.stackup.resize(4); laminate.s...
#include <iostream> using namespace std; template <typename T, typename U> class multi{ public: T x; U y; multi(T a , U b) :x(a),y(b){} ~multi(){} T multi_out(){ return(x*y); } }; int main(){ multi<double,double> obj(5.3,4.34); cout << "Multiplied values :" <<...