text
stringlengths
8
6.88M
// Created by: Eugeny MALTCHIKOV // Created on: 2019-04-17 // 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 ...
// Subtracter.cpp : Implementation of CSubtracter #include "stdafx.h" #include "Math.h" #include "Subtracter.h" #include <iostream> #include <string> #include <algorithm> #include <sstream> #include "regexpr2.h" using namespace std; using namespace regex; // CSubtracter //*************************...
#pragma once struct Category; class Station; class CategoryMgr { public: CategoryMgr(); virtual ~CategoryMgr(); void DetermineStationCategories(vector<Station*>& stations, bool useCategoryAbbrevs, bool assignCategoryToStation, bool matchFirstCategory); // Get a copy of the list of categories void Ge...
#include "Main.hpp" #include "Class.hpp" sf::RenderWindow window(sf::VideoMode(640, 360), "Gua calculator"); int main() { std::cout << "===Gua Calculator===" << std::endl; // DECLARATION sf::Event event; sf::Texture backgroundTexture; sf::Texture buttonTexture; sf::Texture button...
/** Kabuki SDK @file /.../Source/Kabuki_SDK-Impl/_Id/EntityGroup.h @author Cale McCollough <http://calemccollough.github.io> <http://calemccollough.github.io> @copyright Copyright © 2016 Cale McCollough @license http://www.apache.org/licenses/LICENSE-2.0 @brief This file contains ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** 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. */ #ifndef ISO_2022_JP_DECODER_H #define ISO_2022_JP_DECODER_H #if...
// // File.h // // // Created by Daniel on 14/08/14. // // #ifndef ____File__ #define ____File__ #include <iostream> enum Valores {cero, uno, dos, tres}; //hasta el 255 class Entero{ private: enum Valores valor; public: Entero suma(Entero e) = 0; Entero resta(Entero e) = 0; }; class Binario :E...
#include "stdafx.h" #include "QsoTests.h" #include "Qso.h" #include "Station.h" #include "QsoTokenType.h" #include "FreqToken.h" #include "Freq.h" #include "ModeToken.h" #include "Mode.h" #include "DateToken.h" #include "Date.h" #include "TimeToken.h" #include "QsoTime.h" #include "CallsignToken.h" #include "RstTo...
#ifndef DATA_H #define DATA_H #include <iostream> //refazer o main using namespace std; using std::cout; using std::cin; class Data { public: bool operator!=(const Data &) const; Data(int = 15, int = 10, int= 1415); void imprimirData() const; ~Data(); private: int dia; // 1-31 dependendo do mês...
#include "HTTPComm.h" #include <AFXINET.H> #include "CHTTPDownloader.h" #include <QFileInfo> #include <QDir> CHTTPBase::CHTTPBase(QObject *parent) : QObject(parent) { m_dwHttpID = 0; Init(); } CHTTPBase::~CHTTPBase() { CloseConnection(true); } //初始化参数 void CHTTPBase::Init() { m_pHttpSession = NULL; m_pHttpCon =...
#include "stdio.h" #include "conio.h" void main(){ clrscr(); int count=-1; char ch='a'; printf("Enter any charater: "); while((ch!='\r')){ ch=getche(); count++; } printf("\n\nchar count is %d",count); getch(); }
#ifndef VULKANLAB_NODE_H #define VULKANLAB_NODE_H #include <vector> #include "../Maths/Transform.h" #include "../Geometry/Mesh.h" struct Node { Node() : name(nullptr), parent(nullptr), meshes({}), children({}), transform(new Transform()) { } ~Node() { d...
#include<iostream> #include<Eigen/Dense> using Eigen::MatrixXd; int main(){ MatrixXd m(2,2); m( 0, 0 ) = 3; m( 1, 0 ) = 2.5; m( 0, 1 ) = -1; m( 1, 1 ) = m( 1, 0 ) + m( 0, 1 ); std::cout << m << std::endl; return 0; }
#include <chuffed/mip/mip.h> #include <chuffed/mip/simplex.h> #define MIP_DEBUG 0 #define RC_BOUNDS 1 #define DEFAULT_ROUNDS 0 #define RESTORE_ROOT 0 #define RAND_RC 1 #define ULEVEL_LIMIT 3 #define LLEVEL_LIMIT 3 MIP* mip; //----- // Main propagator methods MIP::MIP() : level_lb(-1), level_ub(-1), status(0), simpl...
#include<bits/stdc++.h> using namespace std; main() { int n, as[100000]; while(cin>>n) { int i, p=1; if(n==4) { printf("4\n3 1 4 2\n"); return 0; } for(i=1; i<=n; i++) if(i%2==1)as[p++]=i; for(i=1; i<=n; i++) i...
#include "CLineSegment.h" using namespace std; CLineSegment::CLineSegment(CPoint start, CPoint end) :m_startPoint(start) , m_endPoint(end) { } CLineSegment::CLineSegment(CPoint start, CPoint end, uint32_t color) : m_startPoint(start) , m_endPoint(end) , m_outlineColor(color) { } double CLineSegment::GetArea() ...
#ifndef myCmd_h__ #define myCmd_h__ /* @!CLIENT ECHO 返回客户端发送的内容 @!CLIENT LIST 连接客户端列表 @!CLIENT KICK 强制断开客户端 @!CLIENT NAME 给连接客户端命名 设置为账号名称 @!CLIENT LOGIN 客户端登录 用户名+密码 @!CLIENT LOGIN_EX 用户名+会话号 @!CLIENT SU 权限提升 @!CLIENT PROXY 客户端换新的目标 如果后面没有参数 当前如果有连接目标将关闭 */ #include "myClient.h" #include <string>...
#include "fb_client.h" #include <iostream> #include <QString> #include <QJsonObject> #include <QJsonArray> #include <QJsonValue> #include <QJsonDocument> using namespace std; FbClient::FbClient(QObject* parent) : Console(parent), qfb(&this->dummyStorage) { this->title = "QFb Messenger Client"; connect(&qfb, SIG...
#include "histo.hpp" // template<uchar> std::array<int, 256> histogram( cv::Mat& img ) { CV_Assert( img.depth() == CV_8U ); CV_Assert( img.channels() == 1 ); std::array<int, 256> hist; uchar* p; int nRows = img.rows; int nCols = img.cols; if ( img.isContinuous() ) { nCols *= ...
/* This program was written by Shunman Tse on January 3, 2015 using Leadwerks */ #pragma once #include "Leadwerks.h" using namespace Leadwerks; /* A header file is where we declare all the variables and functions that we will be using */ class App { public: Leadwerks::Window* window; Context* context; World* worl...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2007 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" #include "adjunct/quick/controller/AddActi...
// // Created by JACK on 11/6/2015. // #include "Truck.h" Truck::Truck():power(0),weight(0) { } Truck::Truck(int power, int weight):power(power),weight(weight) { } Truck::Truck(const Truck& obj):power(obj.power),weight(obj.weight) { } Truck& Truck::operator=(const Truck& obj) { if (this == &obj) { return *this;...
/************************************************************************/ /* * 把数组排成最小的数(数组、算法)。 题目:输入一个正整数数组,将它们连接起来排成一个数,输出能排出的所有数字中最小的一个。 例如输入数组{32, 321},则输出这两个能排成的最小数字 32132。 请给出解决问题的算法,并证明该算法。 */ /***********************************************************************...
#include<bits/stdc++.h> using namespace std; int maxIndexDiff(int arr[], int n) { int maxDiff; int i, j; int *LMin = new int[n]; int *RMax = new int[n]; /* Construct LMin[] such that LMin[i] stores the minimum value from (arr[0], arr[1], ... arr[i]) */ LMin[0] = arr[0]; for (i = 1;...
#include <Ogre.h> #include <OIS/OIS.h> #include "MenuState.h" #include "PlayState.h" #include "TitleState.h" using namespace Ogre; MenuState MenuState::mMenuState; void MenuState::enter(void) { mInput = false; mMenuSelection = START_GAME; mContinue = true; mMenuOverlay1 = OverlayManager::getSingleton().getByNam...
/** * Copyright (c) 2023, Timothy Stack * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of condi...
#include <QApplication> #include <iostream> #include <vector> #include <string> #include <stdlib.h> #include <time.h> #include <MineSweeper.h> #include <gamechooser.h> //This program plays minesweeper in the terminal using namespace std; void game() { } int main(int argc, char **argv) { QApplication app(argc, ...
#include <bits/stdc++.h> #define int long long using namespace std; const int N = 1e5; int readInt() { bool minus = false; int result = 0; char ch; ch = getchar(); while (true) { if (ch == '-') break; if (ch >= '0' && ch <= '9') break; ch = getchar(...
#include "stdafx.h" #include "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\include\nvblas.h" GENIXAPI(void, cuda_matrix_mm)( int m, int k, int n, const float* a, int offa, BOOL transa, const float* b, int offb, BOOL transb, float* c, int offc, BOOL clearc) { const int lda = transa ? k : m; const int...
#include "platforms/mac/QuickOperaApp/QuickWidgetUnicodeUtils.h" int UniStrLen(const UniChar * str) { int i; for (i = 0; ; i++) if (!str[i]) return i; }
#include <iberbar/LuaCppApis/Game.h> #include <iberbar/LuaCppApis/Game_Names.h> #include <iberbar/GameEngine/Application.h> //#include <iberbar/GameEngine/Paper2dLoader.h> #include <iberbar/GameEngine/BaseResourceManager.h> #include <iberbar/GameEngine/TextureManager.h> #include <iberbar/GameEngine/FontManager.h> #inc...
class Solution { public: int countPrimes(int n) { int i, j, cnt; bool * isPrime; isPrime = new bool[n]; memset(isPrime, true, n*sizeof(bool)); for (i = 2; i < n; i++) if (isPrime[i]) for (j = i+i; j < n; j += i) isPrime[j] = ...
#pragma once #include <include/cef_app.h> #include <wx/_wrapper.hh> namespace kg { class MainWindow; class App : wxApp { public: App(); virtual ~App(); virtual bool OnInit() override; virtual int OnExit() override; wxDECLARE_EVENT_TABLE(); private: C...
#pragma once #include "Product.hpp" class SeatUpholstery : public Product { public: enum colors { black, red_and_black, blue_and_black }; SeatUpholstery(); SeatUpholstery(const std::string& mark, const double& price, const unsigned int& count, const colors& color); void set_color(const colors&); colors ...
#include<iostream> #define MAX(a,b) ((a)>(b)?(a):(b)) #define H(p) ((p==NULL)?-1:((nn)(p))->h) using namespace std; typedef int elementtype; typedef struct node *nn; int flag=0; struct node { int h; elementtype e; nn l,r; }; //travel void preorder(nn p) { if (!p) return; cout<<p->e<<' '; preorde...
//------------------------------------------------------------------------------------ // File : s3d_texture.cpp // Desc : Texture Modle. // Copyright(c) Project Asura. All right reserved. //------------------------------------------------------------------------------------- //---------------------------------...
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QTimer> #include <QDebug> #include <QKeyEvent> #define BLOCK1_X_POS 300 #define BLOCK1_Y_POS 40 #define BLOCK2_X_POS 2300 #define BLOCK2_Y_POS 110 #define BLOCK3_X_POS 900 #define BLOCK3_Y_POS 190 #define BLOCK4_X_POS 2800 #define BLOCK4_Y_POS 260 #define BLO...
#ifndef OGREWINDOW_H #define OGREWINDOW_H #include <gtkmm.h> #include <gtkmm/button.h> #include <gtkmm/window.h> #include "ogrewidget.h" class OgreWindow : public Gtk::Window { public: OgreWindow(); virtual ~OgreWindow(); virtual bool on_delete_event(GdkEventAny* event); bool hasExited() { return mExited; } ...
#include "RenderTarget.h" #include "RenderSystem.h" #include "Camera.h" #include "EngineUtil.h" #include "TextureManager.h" using namespace rapidjson; namespace HW { RenderTarget::RenderTarget(const string &_name):RenderTarget() { this->name = _name; } RenderTarget::RenderTarget() { m_valid = false; auto sy...
/* * @lc app=leetcode.cn id=67 lang=cpp * * [67] 二进制求和 */ // @lc code=start #include<iostream> #include<string> #include<map> using namespace std; class Solution { public: // string addBinary(string a, string b) { // int x = a; // } void revert_string(string &s){ string tmp; for...
#include<bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for(int i = 0; i < (n); i++) int n,m,q; vector<int> a,b,c,d; int ans; void dfs(vector<int>A){ //終了ステップは、配列Aの長さがn+1になったとき。(配列が完成) if((int)A.size() == n+1){ // calc score int now = 0; rep(i,q){ //クエリ分処理 ...
int rid[100000]; string mana(const char *s) { string t, res; int L = strlen(s); // init t += '?'; for(int i = 0; i < L; i++) t += '#', t += s[i]; t += "#*"; // getrid for(int i=1,j=0,k,End=(int)t.size();i<End;){ while( t[i-j-1]==t[i+j+1] ) j++; rid[i] = j; for...
/**************************************************************** File Name: box_fractal.C Author: Tian Zhang, CS Dept., Univ. of Wisconsin-Madison, 1995 Copyright(c) 1995 by Tian Zhang All Rights Reserved Permission to use, copy and modify this software must be granted by the auth...
#include <iostream> #include <vector> using namespace std; // pick m out of n number void printPicked (vector<int>& picked) { for(auto it=picked.begin(); it!=picked.end(); it++) { cout<<*it<<" "; } cout<<endl; }; void pick(int n, vector<int>& picked, int toPick){ if ( toPick == 0 ) { ...
#include<vector> #include<iostream> #include<string> #include<string.h> #include<algorithm> #include<stdlib.h> #include<stdio.h> #include<stack> #include<unistd.h> #include<unordered_map> #define INT_MAX 2147483647 #define INT_MIN -2147483648 using namespace std; struct ListNode{ int val; ListNode *next; L...
//$$---- Form HDR ---- //--------------------------------------------------------------------------- #ifndef MinorChannelH #define MinorChannelH //--------------------------------------------------------------------------- #include <Classes.hpp> #include <Controls.hpp> #include <StdCtrls.hpp> #include <Forms....
//////////////////////////////////////////////////////////////////////////////// // // (C) Andy Thomason 2012-2014 // // Modular Framework for OpenGLES2 rendering on multiple platforms. // namespace octet { /// example of using spring meshes arranged as tetrahedra. /// Note that we are not using a very sophisticate...
// Scintilla source code edit control /** @file LexInno.cxx ** Lexer for Inno Setup scripts. **/ // Written by Friedrich Vedder <fvedd@t-online.de>, using code from LexOthers.cxx. // The License.txt file describes the conditions under which this software may be distributed. #include <string.h> #include <asse...
#ifndef CAFFE_MPI_GATHER_LAYER_HPP_ #define CAFFE_MPI_GATHER_LAYER_HPP_ #include <vector> #include "caffe/blob.hpp" #include "caffe/layer.hpp" #include "caffe/proto/caffe.pb.h" #include "caffe/layers/mpi_base_layer.hpp" namespace caffe{ template <typename Dtype> class MPIGatherLayer : public MPIBaseLayer<Dtype> ...
#include<iostream> #include<vector> #include<algorithm> #include <unistd.h> #include<stdio.h> #include<climits> using namespace std; struct process { int pid, at, bt, wt, tt, c; }; bool compare(process p1, process p2) { return p1.at < p2.at; } void arrangeArrival(int num, vector<process> &arr) { sort(arr.begi...
#include "f3lib/types/Matrix.h" using namespace f3::types; const Matrix Matrix::Identity = Matrix(); Matrix Matrix::operator*(const Matrix& rhs) const { float a = m11 * rhs.m11 + m12 * rhs.m21 + m13 * rhs.m31 + m14 * rhs.m41; float b = m11 * rhs.m12 + m12 * rhs.m22 + m13 * rhs.m32 + m14 * rhs.m42; ...
#include<bits/stdc++.h> using namespace std; int lcs (char *s1, char *s2, int m, int n){ int dp[m+1][n+1]; for(int i = 0; i<=m; ++i){ for(int j = 0; j<=n; ++j){ if(i==0||j==0) dp[i][j]=0; else if(s1[i-1]==s2[j-1]){ dp[i][j]=1+dp[i-1][j-1]; ...
#include <iostream> #include "include/transaction.h" #include "include/abort_exception.h" #include "include/invalid_state_exception.h" Transaction::Transaction(uint64_t transaction_id, TransactionManager *transaction_manager, bool use_lazy_versioning) : transaction_id_(transaction_id),...
// kumaran_14 // #include <boost/multiprecision/cpp_int.hpp> // using boost::multiprecision::cpp_int; #include <bits/stdc++.h> using namespace std; // ¯\_(ツ)_/¯ #define f first #define s second #define p push #define mp make_pair #define pb push_back #define eb emplace_back #define rep(i, begin, end) for (__typeof(end...
#include "gtest/gtest.h" #include <string> #include <vector> #include "BuiltinFunctionType.h" #include "LexicalParser.h" #include "Token.h" namespace ArithmeticalParserTests { TEST(LexicalParserTests, EmptyInput) { auto tokens = arithmetic_parser::GetTokens(""); ASSERT_EQ(tokens.size(), 0); } TEST(LexicalP...
#pragma once #include "mumble_messages.h" class DummyMsgProvider : public MumbleMessageProvider { public: MumbleMessageMem message; MessageType type; void send(){ update(type, &message); } void send(MessageType t, const MumbleMessageMem * m){ update(t, m); } void send(const MumbleProto_UserState ...
//Pistol Ammo class Category_19 { class 7Rnd_9x17_PPK {type = "trade_items";buy[] = {2,"ItemSilverBar"};sell[] = {1,"ItemSilverBar"};}; class 8Rnd_9x18_Makarov {type = "trade_items";buy[] = {2,"ItemSilverBar"};sell[] = {1,"ItemSilverBar"};}; class 8Rnd_9x18_MakarovSD {type = "trade_items";buy[] = {2,"ItemSilverBar1...
#pragma once #include <texture.h> #include <string> class Player { private: int id; double x; double y; int width; int height; double velocity; Texture* texture; public: Player(int id, double x, double y); Player(int id, double x, double ...
#include <iostream> #include <Windows.h> using namespace std; int main(){ printf("\a"); Sleep(5*1000); printf("\a"); return 0; }
#include "systemc.h" #include "tester.h" #include <iostream> #include <fstream> void tester::tester_func(){ bool t_reset; unsigned int t_data,t_we; while(1){ if (infile >> t_data >> t_we >> t_reset) { in.write(t_data); we.write(t_we); reset.write(t_reset); wait(); ...
#ifndef CONTACT_H #define CONTACT_H #include <QDialog> namespace Ui { class contact; } class contact : public QDialog { Q_OBJECT public: explicit contact(QWidget *parent = nullptr); ~contact(); private: Ui::contact *ui; }; #endif // CONTACT_H
#include "GnMainPCH.h" #include "GnTexture.h" #include "GnFactoryManager.h" gchar GnTexture::msTextureWorkPath[GN_MAX_PATH] = {0,}; GnImplementRTTI(GnTexture, GnObject); GnTexture::GnTexture() : mFileName(NULL) { } GnTexture::~GnTexture() { if( mpTextureMap ) GnDelete mpTextureMap; } gchar* GnTexture::GetTextu...
#include <Unixfunc.h> #include <iostream> using namespace std; #define IP "172.21.0.7" #define PORT 2000 #define FILENAME "file" struct Packet { int dataLen; // 包头,用来记录存数据的大小 char buf[1000]; // 包数据,用来存放数据 }; int tranFile(int client_fd) { int ret; Packet packet; int file_fd = open(FILENAME, O_R...
#include<bits/stdc++.h> #include<unistd.h> #include<cmath> using namespace std; int main() { cout<<"\nWelcome to FIFO Page replacement algorithm\n"; cout<<"\nMax size of memory is 5\n"; cout<<"\nEnter any positive number for referencing page number and -1 to exit\n"; vector<int> mem(5, -1); queue<int> q; int ...
#include <iostream> using namespace std; // Function to check sum // of digit using tail recursion int sum_of_digit(int n, int val) { if (n < 10) { val = val + n; return val; } return sum_of_digit(n / 10, (n % 10) + val); } // Driver code int main() { int num = 919; int resul...
#include "Population.h" Population::Population(){ profile = NULL; pool = NULL; } Population::Population(unsigned int _n_inds, Profile *_profile, Pool *_pool, mt19937 &generator){ assert(_profile != NULL); assert(_pool != NULL); // cout << "Population - Start\n"; profile = _profile; // pool = new Pool(profil...
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- // // Copyright (C) 1995-2009 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" #include "modu...
#pragma once class Card { };
#ifndef PERMUTATION_TEST_HPP #define PERMUTATION_TEST_HPP #include <gtest/gtest.h> #include <permutations.h> namespace { /** * @class PermuterTest * @brief sets-up and tears down a permuter object. Also copies the elements * passed in so that they can be mutated in writable memory * @tparam T the type ...
#pragma once namespace BroodWar { namespace Api { namespace Enum { public enum class UnitCommandType { AttackMove, AttackUnit, Build, BuildAddon, Train, Morph, Research, Upgrade, SetRallyPosition, SetRallyUnit, Move, Patrol, HoldPosition, Stop, F...
#include<bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); string s; cin>>s; long long n=0; int l=s.size(); long long p=1; for(int i=l-1;i>=0;i--){ if(s[i]>='A'&&s[i]<='F'){ int x=s[i]-'A'+10; n+=x*p; ...
/**************************************************************************** ** Copyright (c) 2006 - 2011, the LibQxt project. ** See the Qxt AUTHORS file for a list of authors and copyright holders. ** All rights reserved. ** ** Redistribution and use in source and binary forms, with or without ** modificatio...
#ifndef TOP_DOWN_CLASSIFIER_H_ #define TOP_DOWN_CLASSIFIER_H_ #include "volume.h" #include "common.h" #include "features.h" #include <opencv2/opencv.hpp> /// Forward declarations class CvBoost; /// A trained top-down classifier. Loads training weights from a .yaml file. /// For training a classifier, see train_nod...
/* The MIT License (MIT) Copyright (c) 2017 Paul Marc Liu 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, modify, merge,...
//===- OR1KInstrInfo.h - OR1K Instruction Information ---------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===---------------------------------------------------------...
//////////////////////////////////////////////////////////////////////////////// #include "vertex_degree.h" #include <igl/edges.h> #include <Eigen/Dense> #include <iostream> //////////////////////////////////////////////////////////////////////////////// namespace cellogram { // --------------------------------------...
/****************************************************************************** * $Id: lasvariablerecord.hpp 889 2008-09-28 04:17:22Z hobu $ * * Project: libLAS - http://liblas.org - A BSD library for LAS format data. * Purpose: LAS record header class * Author: Phil Vachon, philippe@cowpig.ca * ***********...
// Created on: 1992-10-08 // Created by: Isabelle GRIGNON // Copyright (c) 1992-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; main() { long long int n; while(cin>>n) { int total=0; while(n!=0) { if(n%2==1)total++; n/=2; } cout<<total<<endl; } return 0; }
#include <winsock2.h> #include <windows.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "windivert.h" int main(int argc, char *argv[]) { HANDLE handle; char packet[65535]; WINDIVERT_ADDRESS addr; UINT packet_len; int i, port; PWINDIVERT_IPHDR ip_header; WINDIVERT_UDPHDR * udp_header; UI...
# include<iostream> # include<algorithm> using namespace std; int unique(int sorted[],int sSize) { int duplicates = 0, buf = 0; int buffer[100] = { 0 }; for(int i = 0; i < sSize; i++) { buffer[buf] = sorted[i]; if(buf >= 1 && buffer[buf-1] == buffer[buf]) { duplicates++; } else { buf++; } } for(int...
#include "EventList.h" EventList::EventList(){ id = 0; // gen_start = 0; // gen_finish = 0; cur_pos = 0; } EventList::EventList(const EventList &original){ id = original.getId(); // gen_start = original.start(); // gen_finish = original.finish(); cur_pos = 0; } EventList& EventList::operator=(const EventList& or...
#include "UtilitiesLabel.h" #include <qlayout.h> #include <QLabel> #include <QPushButton> #include <QComboBox> UtilitiesLabel::UtilitiesLabel() { QVBoxLayout* vlayout = new QVBoxLayout(); vlayout->setAlignment(Qt::AlignTop); vlayout->setSpacing(40); QLabel* setRoomType = new QLabel(); QFont font = setRoomType->...
#include <iostream> int main() { char* p="tes?t2test?yes"; while (*p) { if (*p == '?') std::cout << "find question" << '\n'; *p++; } std::cout <<"the end!"; std::cin.get(); return 0; }
#include "StdAfx.h" #include "FixedMemoryPool.h"
// // Created by Yujing Shen on 05/06/2017. // #include "../../include/nodes/ConcatNode.h" namespace sjtu{ ConcatNode::ConcatNode(Session *sess, const Shape &shape): SessionNode(sess, shape) { } ConcatNode::~ConcatNode() { } Node ConcatNode::forward() { auto Y = ...
#include "x_pch.h" #include "x/x_string.h" #include <string.h> #include <stdlib.h> namespace x { x_String::x_String() { m_pWchar = nullptr; m_length = 0; } x_String::~x_String() { if (m_pWchar) delete m_pWchar; m_length = 0; } x_String::x_String(const char c) { x_PSint8 pSint8 = new x_Sint8[2]; ...
#ifndef _JOGO_H_ #define _JOGO_H_ #include "Mapa1.h" class Jogo { private: BITMAP* buffer; Menu* M; // Bitmap de buffer para desenhar todas as imagens nele // e logo em seguida jogá-lo inteiro na tela, isso evita // que a tela ou as imagens fiquem piscando. ...
#include <iostream> #include <queue> using namespace std; int m,n; int error; deque<int> q; void init() { ios::sync_with_stdio(0); cin >> m; } void process() { q.clear(); cin >> n; error = 0; string oper; int num; while(n--) { cin >> oper; if(oper == "push") ...
= イベントのプラクティス この章では、イベントを実施するうえで私たちが得たプラクティスを紹介していきます。皆さんがオンラインイベントをする際に役立つものがきっとあるはずです。 == イベント運営に関わるコアプラクティス === 楽しい駆動 一番大切なプラクティスが、この「楽しい駆動」です。 社内社外に関わらず、イベント運営で起こりがちな問題が、「イベントを立ち上げたはいいものの、運営するのがつらい」「運営に集中してしまって、自分が楽しめない」というものです。 このイベントでは、最低条件として、「パーソナリティの2人が楽しめる」ということを土台にしています。 === Small Start & Baby Step 少し...
#include "my_signal.h" void register_signal(int sig, my_sig_handler handler) { signal(sig, handler); }
#ifndef ETW_CONFIG_PLATFORM_VALIDATOR_INTERFACE_H_ #define ETW_CONFIG_PLATFORM_VALIDATOR_INTERFACE_H_ #include <string> namespace etw { class OptionInterface; class PlatformValidatorInterface { public: virtual int validateOption(std::string platform, OptionInterface *op) = 0; }; } #endif
// // Created by OLD MAN on 2019/9/1. // //蒜头君今年毕业并找到了一份工作。他赚很多钱,但似乎总是不够。蒜头君认为他需要控制他的投资以解决自己的财务问题。蒜头君拿到了自己的银行账户详单,想看看自己有多少钱。 // //请帮助蒜头君写一个程序,通过过去 12 个月中每月的月末结余,计算平均结余。 // //输入格式 // 输入包含 12 行,每行包含一个浮点数,为某个月的结余。 // //每个数都是不大于 1,000,000 的正数,保留两位小数。 // //输出格式 // 输出一个数,为这 12 个月的平均月末结余,保留到小数点后第二位,并在最前面加一个'$'符。...
// ------------------------------------------------------------------ // Xuanyi . Refer to Dong Jian // 2016/03/30 // ------------------------------------------------------------------ #ifndef CAFFE_FRCNN_ANCHOR_TARGET_LAYER_HPP_ #define CAFFE_FRCNN_ANCHOR_TARGET_LAYER_HPP_ #include <vector> #include "caffe/blob.hpp"...
/* * Author: Zachary Eisenhauer * Date: 12/2/2016 * Assignment: Program 3 * * In Main.cpp * Functions to read in graph.txt, commands.txt and print a created graph of them in list form and matrix form * * In Main.h * The function prototypes in this file, the class definition for a node, and the libaries used */ #inc...
#ifndef _SPATIAL_MATH_COSINE_SMOOTH_H_ #define _SPATIAL_MATH_COSINE_SMOOTH_H_ #include "SM_Vector.h" #include <vector> namespace sm { void cosine_smooth(const std::vector<vec2>& src, float sampling_width, std::vector<vec2>& dst); } #endif // _SPATIAL_MATH_COSINE_SMOOTH_H_
#ifndef LABPROG_GAME_H #define LABPROG_GAME_H #include "States/MainMenuState.h" class Game { public: Game(); virtual ~Game(); void updateDt(); void updateEvents(); void update(); void render(); void run(); private: sf::RenderWindow *window; sf::Event sfEvent; sf...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2007 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * @file * @author Owner: Karianne Ekern (karie) * @author Co...
#include <iostream> #include <student.h> #include <studentenverwaltung.h> using namespace std; int main() { cout << "Hello World!" << endl; Student s1 = Student(1234, "ronaldos", "kristian"); Student s2 = Student(2345, "kahn", "olifair"); Student s3 = Student(3456, "nur klopp", "imko pp"); cout ...
#include <bits/stdc++.h> using namespace std; long long a,i,m,arr[2000005],j,temp; int main() { // ma=2000005; while(scanf("%lld",&a)!=EOF){ if(a==0) break; for(i=0;i<a;i++){ scanf("%d",&arr[i]); } sort(arr,arr+a); for(j=0;j<a-1;j++){ printf(...