text stringlengths 8 6.88M |
|---|
#include <iostream>
#include <stdio.h>
#include <cstdlib>
using namespace std;
int main(){
int opc, cont;
do{
cout<< "\t\tMenu Programas Estructuras de decision"<<endl;
cout<< "\t1-Sueldo de un Trabajador"<<endl;
cout<< "\t2-Tienda"<<endl;
cout<< "\t3-Diagnostico Anemia"<<endl;
... |
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <vector>
#include <math.h>
#define pb push_back
using namespace std;
int n;
int r1, r2;
struct emp {
int val, idx;
};
emp e[111];
vector <int> bonus;
void input(){
scanf("%d %d %... |
#pragma once
#include "C:\Users\Andrey\Desktop\Linearization\Linerization\Working Test\version 1.1\include\signal.h"
class Rectangle :
public Signal
{
public:
Rectangle();
~Rectangle(void);
void setVal(float); // инициализирует массив значений сигнала меандр
};
|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 2011-12 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"
#if defined(X11API) && defined(NS4P_COMPONE... |
#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <set>
#include <stack>
#include <cstdio>
#include <cstring>
#include <climits>
#include <cstdlib>
... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: JobFactory.cpp
* Author: ssridhar
*
* Created on October 11, 2017, 1:06 PM
*/
#include "JobFactory.h"
#... |
/**
* Lista
* Implementacion de Lista Doblemente Enlazada con Templates
**/
#ifndef __LISTA_DOBLEMENTE_ENLAZADA_H__
#define __LISTA_DOBLEMENTE_ENLAZADA_H__
#include "Nodo.h"
#include "IteradorLista.h"
#include "Comparador.h"
/**
* Una Lista es una colección de elementos ordenados secuencialmente.
* Los elemento... |
#ifndef _FA_MONITOR_COMM_COM
#define _FA_MONITOR_COMM_COM
#include "Comm.h"
#include "fmt.h"
class SerialCom : public Comm {
public:
SerialCom() : Comm(0) {}
SerialCom(char* port,
DWORD baudRate,
BYTE byteSize,
BYTE parity,
BYTE stopBits)
: Comm(0),
... |
#pragma once
#include <set>
#include <iostream>
using namespace std;
class BaseGameEntity;
#define Dispatch MessageDispatcher::Instance()
enum message_type
{
Msg_Bathroom,
Msg_WantTissue
};
struct Telegram
{
int Sender;
int Receiver;
int Msg;
Telegram() :
Sender(-1),
Receiver(-1),
Msg(-1)
{}
Telegram(
... |
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without f... |
#include<bits/stdc++.h>
using namespace std;
void findCommon(int arr1[],int arr2[],int m,int n)
{
int i=0,j=0;
while(i<m && j<n)
{
if(arr1[i]<arr2[j])
i++;
else if(arr2[j]<arr1[i])
j++;
else
{
cout<<arr1[i]<<" ";
i+... |
// Created on: 1999-11-18
// Created by: Andrey BETENEV
// Copyright (c) 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 GNU Less... |
/*
题目:503. 下一个更大元素 II
链接:https://leetcode-cn.com/problems/next-greater-element-ii/
知识点:单调栈+循环数组
*/
class Solution {
public:
vector<int> nextGreaterElements(vector<int>& nums) {
int n = nums.size();
vector<int> ans(n, -1);
stack<int> s; // 单调栈,栈中下标对应的元素是单调递增的
// 取下标的时候,用 %... |
#ifndef VnaMarker_H
#define VnaMarker_H
// RsaToolbox
#include "Definitions.h"
// Qt
#include <QObject>
#include <QScopedPointer>
namespace RsaToolbox {
class Vna;
class VnaTrace;
class VnaMarker : public QObject
{
Q_OBJECT
public:
explicit VnaMarker(QObject *parent = 0);
VnaMarker(const VnaMarker &... |
#include <systemc.h>
#include <fstream>
#include "tester.h"
#include "adder4u.h"
using namespace std;
int sc_main(int argc, char *argv[]) {
sc_signal <sc_uint<4> > mod_in1, mod_in2, mod_out;
sc_signal <bool> mod_cin, mod_cout;
sc_clock clk("clock", 10, SC_NS);
Adder4 module_adder("adder");
module_... |
#include "helper.h"
#include "byteswap.h"
std::ostream *PgSAHelpers::logout = &std::cout;
int PgSAHelpers::numberOfThreads = 8;
NullBuffer null_buffer;
std::ostream null_stream(&null_buffer);
// TIME
clock_t checkpoint;
clock_t PgSAHelpers::clock_checkpoint() {
checkpoint = clock();
return checkpoint;
//... |
#include "chemcontroller.h"
#include <QtMath>
// ДОБАВИТЬ ИСКЛЮЧЕНИЯ
ChemController::ChemController(QObject *parent) : QObject(parent)
{
/*
Name : CRC-16
Poly : 0x8005 x^16 + x^15 + x^2 + 1
Init : 0xFFFF
Revert: true
XorOut: 0x0000
Check : 0x4B37 ("123456789")
... |
#include "GnMeshPCH.h"
#include "GnInterfacePCH.h"
#include "GnInterface.h"
GnImplementRootRTTI(GnInterface);
GnInterface::GnInterface() : mPushCount( 0 ), mTegID( -1 )
{
SetIsHover( false );
SetIsCantPush( true );
SetIsDisable( false );
SetIsEnablePushMove( false );
mParentUseNode.retain();
}
G... |
#include <iostream>
using namespace std;
int main() {
int a, b, ostatok;
cout << "Vvedite znachenie A B\n";
cin >> a >> b;
ostatok = a % b;
cout << ostatok;
} |
/*
Name:
Copyright:
Author: Xiaodong Xiao
Date: 2019/9/13 20:16:30
Description:
*/
#include <bits/stdc++.h>
#include <time.h>
using namespace std;
class Solution {
public:
/*下面居然能AC */
// vector<int> searchRange(vector<int>& nums, int target) {
// if (nums.size() == 0) return {-1, -1};
//
// ... |
//realwindow.hpp
//ABC that handles real windows - creation, etc.
//Created by Lewis Hosie
//14-11-11
#include "varlist.hpp"
#include "inputpasser.hpp"
#ifndef e_realwindow
#define e_realwindow
class realwindow{ //It's like a realdoll, but sexier
public:
varholder thevars;
virtual void takeevents(inputpasser& t... |
// Ed Callaghan
// Plotting script - for use with output of singleChannelFilling.cxx
// April 2016
void drawAll()
{
TFile *fin = new TFile("singlePlots.root") ;
int nch = 8 ;
TCanvas *cAll = new TCanvas() ;
cAll->Divide(3,3) ;
TGaxis *aCa = new TGaxis(0.95, 0.1, 0.95, 0.9, 31.5, 34.5, 510, "+L") ;
aCa->SetLine... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
main()
{
ll k, l;
while(cin>>k>>l)
{
ll i, ans=0;
for(i=l; i>1; )
{
if(i%k==0)
{
i=i/k;
ans++;
}
else
{
cout<<"NO"<<endl... |
// Simple C++ program to display "Hello World"
// Header file for input output functions
#include <stdio.h>
#include<iostream>
using namespace std;
//main function -
// where the execution of program begins
int main()
{
//prints hello world
//long version-- std::cout << "Hello World" << std::endl;
cout<<"Hello Wo... |
#include <iostream>
using std::cout;
using std::endl;
using std::cin;
#include <stdlib.h>
#include <time.h>
#include <vector>
#include <cstring>
const static int adjacentRooms[20][3] = {
{1, 4, 7}, {0, 2, 9}, {1, 3, 11}, {2, 4, 13}, {0, 3, 5},
{4, 6, 14}, {5, 7, 16}, {0, 6, 8}, {7, 9, 17},... |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#ifdef MVFST_USE_LIBEV
#include <quic/common/QuicAsyncUDPSocketImpl.h>
#include <cstring>
#include <sstream>
#include <stdexcep... |
/*********************************************************\
* 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 <sstream>
#include <fstream>
#include <vector>
#include <string>
inline std::vector<std::string> read_lines(const char* path)
{
std::vector<std::string> out;
std::ifstream input(path);
std::string line;
while(std::getline(input, line))
{
out.push_back(line);
}
return out;
}
inline std::string read_f... |
#pragma once
#include "ZeroIScene.h"
#include "PlayerCharacter.h"
#include "ZeroSoundManager.h"
class Enemy :
public ZeroIScene
{
public:
Enemy();
~Enemy();
private:
int followDistanceX;
int followDistanceY;
protected:
void FollowPlayer();
enum CONDITION {
MOVE,
ATTACK,
IDLE
};
public:
enum Enemy... |
#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;
const int maxn = 20... |
// This file was generated based on /usr/local/share/uno/Packages/Fuse.Drawing/1.3.1/Colors.uno.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Uno.h>
namespace g{namespace Fuse{namespace Drawing{struct Colors;}}}
namespace g{namespace Uno{struct Float4;}}
namespace g{
namesp... |
#include "LinearLayout.h"
void Gui::LinearLayout::Resize(const BaseElement *parent) {
BaseElement::Resize(parent);
Vec2f _start = { -1, -1 };
Vec2f _size = { 2, 2 };
float spacing;
float filled_space = 0.0f;
float l;
if (vertical_) {
spacing = 8.0f / parent->size_px()[... |
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
class MedianFinder {
public:
// MedianFinder(){}
void addNum(int num);
double findMedian();
private:
vector<int> v;
};
void MedianFinder::addNum(int num){
// if(v.empty()){
// v.push_back(num);
// ... |
//Fuel Economy Tracker
//Christopher Rennie
#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup") //prevent console from opening
#include<cstdlib>
#include<iostream>
#include<list>
#include<fstream>
#include<string>
#include<Windows.h>
#include<FL/Fl.H>
#include<FL/Fl_Window.H>
#include<FL/Fl_Box.H>
#in... |
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmServer.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <iostream>
#include <mutex>
#include <utility>
#include <cm/memory>
#include <cm... |
#pragma once
class TestBase;
// Holds the data for one error encountered during a test
// The tests are run in parallel, so the error messages cannot be written to the output
// while the tests are running because the text from different tests would be intermingled.
// This small class captures the information for... |
/* ****************************************
Created by Hong Zhou based on an example from
"Java for Engineers ans Scientist" by Gary J. Bronson
**************************************** */
/**************************************
This piece software can be used to calculate
the average of numbers.
***... |
#pragma once
#include <iostream>
using namespace std;
#include "aqua.h"
class Caracatita:public aqua{
private:
int idAnimal=9;
static queue<animal*> ListaCusti[10];
static int numar_animale;
public:
virtual void TreceInCusca();
int getIDAnimal();
std::string facCaAnimalu();
Cara... |
/*
* EmplaceInsertion.cpp
*
* Created on: May 30, 2016
* Author: bakhvalo
*/
#include "gtest/gtest.h"
#include <type_traits>
#include <vector>
#include <string>
#include <set>
#include <list>
#include <memory>
#include <regex>
// General idea for using emplacement methods is to avoid excessive temporaries.... |
/*
* 题目:26. 删除有序数组中的重复项
* 链接:https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/
*/
class Solution {
public:
int removeDuplicates(vector<int>& nums) {
int n = nums.size();
if (n == 0) {
return 0;
}
int cnt = 1;
for (int i = 1; i < n; i++) {
... |
#include "EventFSM.h"
#include "Execute.h"
#include "Player.h"
#include "Actions.h"
EventFsm::~EventFsm()
{
NotificationCenter::getInstance()->removeAllObservers(this);
}
EventFsm* EventFsm::createEventFsm(Player* m_player)
{
EventFsm* fsm = new EventFsm();
if (fsm && fsm->init(m_player))
{
fsm... |
#include "ofDisplay.h"
//--------------------------------------------------------------
void ofDisplay::setup(){
// displayOneServer.setName("display " + ofToString(display));
// mClient.setup();
// mClient.set("", "Simple Server");
}
//--------------------------------------------------------------
voi... |
/*
Name: ���Ƽ��ת��
Copyright:
Author: Hill bamboo
Date: 2019/8/15 17:17:37
Description: ��
*/
#include <bits/stdc++.h>
using namespace std;
void num2k(long long num, int k) {
if (num == 0) {
printf("0\n");
return;
}
stack<int> stk;
while (num) {
stk.push(num % k);
num /= k;
}
while (!stk.empty()... |
#include "usart2.h"
#include <unistd.h>
#include <stdio.h>
#include <string.h>
USART2* USART2::s_pInstance = NULL;
QThread* USART2::thread = NULL;
USART2::USART2()
{
}
USART2::~USART2()
{
initFD();
memset(txBuf, 0, 1024);
memset(rxBuf, 0, 1024);
}
void USART2::initSerialPort(int dataBits, int parity, ... |
//
// GameUI.cpp
// GetFish
//
// Created by zhusu on 15/1/27.
//
//
#include "GameUI.h"
#include "Common.h"
#include "Tools.h"
#include "Data.h"
#include "GameScene.h"
GameUI::GameUI():_dir(DIR_NONE)
{
}
GameUI::~GameUI()
{
}
bool GameUI::init()
{
if(CCLayer::init()) {
_screenSize = CCDirector:... |
#include <stdio.h>
#include <stdlib.h>
struct node
{
int item;
struct node *next;
};
typedef struct node nd;
nd *p1,*p2;
main()
{
p1=(nd*)malloc(sizeof(nd));
p2=(nd*)malloc(sizeof(nd));
p1->item=12;
p2->item=34;
p1=p2;
p2->next=p1;
printf("%d %d\n",p1->item,p1->next->item);
pri... |
#include <iostream>
#include <boost/program_options.hpp>
#include "sodium.h"
#include "cryptobox/core/HSM.hpp"
namespace po = boost::program_options;
namespace crb = cryptobox;
void printHelp(std::ostream& out, po::options_description const& desc) {
out << "--- Simple Cryptobox ---\n";
out << desc << "\n";... |
// wrong answer
#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <cstdio>
#define INT_MIN (1<<31)
#define INT_MAX (~INT_MIN)
#define UNREACHABLE (INT_MAX>>2)
#define INF (1e300)
#define eps (1e-9)
... |
#ifndef BULLETS_T
#define BULLETS_T
#include <QGraphicsPixmapItem>
#include <QObject>
#include <QMediaPlayer>
class Bullets : public QObject, public QGraphicsPixmapItem
{
Q_OBJECT
public:
Bullets(QGraphicsItem * parent = 0);
~Bullets();
public slots:
void move();
private:
QMediaPlayer * bulletSound;
};
#endif ... |
$NetBSD$
Missing include on NetBSD.
--- src/libexpr/primops/fetchGit.cc~ 2019-11-01 16:57:52.564146995 +0000
+++ src/libexpr/primops/fetchGit.cc 2019-11-01 16:59:08.187456642 +0000
@@ -6,6 +6,8 @@
#include "hash.hh"
#include <sys/time.h>
+#include <sys/wait.h>
+
#include <regex>
|
#pragma once
#include "Task.h"
#include "R2D2.h"
#include "Robot.h"
#include "Xwing.h"
namespace T3D {
class AnimationMove :
public Task
{
public:
float variance = 0.2f;
float elapsedTime = 0;
float time;
bool rotate = false;
bool displace = false;
Vector3 startPos;
Vector3 endPos;
Quaternion st... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2008 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#ifndef MDE_OPFONTMANAGER_H
#define MDE_OPFONTMANAGER_H
#include... |
// Copyright (c) 2017-2018 John Biddiscombe
//
// SPDX-License-Identifier: BSL-1.0
// 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)
//
// For compliance with the NVIDIA EULA:
// "This software contains source cod... |
#pragma once
#include "texture.h"
#include "sprite.h"
#include "singleton.h"
#include "named_vector.h"
#include <nlohmann/json.hpp>
struct SpriteInfo : public Sprite {
std::string Name;
uint32_t TextureId{ 0 };
};
void from_json(const nlohmann::json& j, SpriteInfo& info);
void to_json(nlohmann::json& j, const Spr... |
#pragma once
#include <pthread.h>
namespace pthreadhelp {
class LockGuard {
public:
LockGuard() = delete ;
LockGuard(pthread_mutex_t& mutex) : mutex(mutex) {
pthread_mutex_lock(&mutex);
}
~LockGuard() {
pthread_mutex_unlock(&mutex);
}
privat... |
#include "Characters.h"
#include "Map.h"
#include "MySFML.h"
#include <iostream>
//---------------------------------------------------------------------------------------
Character::Character()
{
hp = 100;
state = State::Idle;
}
//-------------------------------------------------------------------------------------... |
#include <string>
#include <vector>
using namespace std;
class Solution {
public:
string longestPalindrome(string s) {
// DP:
/**
* Fib: fib(n) = fib(n-1) + fib(n-2)
* e.g.:
* fib(5)
* / \
* fib(4) [fib(3)]
* / \ / \
* ... |
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
int main() {
ll A, B;
cin >> A >> B;
ll S = A + B;
ll K;
for (K = 1e6; K * (K + 1) / 2 > S; --K) {};
// 1+2+...+K <= A+B
vector<int> a, b;
for (int i = K; i > 0; --i) {
if (A >= i) {
... |
/* -*- coding: utf-8 -*-
!@time: 2020/3/2 21:42
!@author: superMC @email: 18758266469@163.com
!@fileName: 0039_balanced_binary_tree.cpp
*/
#include <environment.h>
#include <selfFun.h>
using self_envs::TreeNode;
class Solution {
public:
bool IsBalanced_Solution(TreeNode *pRoot) {
if (pRoot == nullp... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; 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.
**
*/
#ifndef CRYPTO_UTILITY_H_
#define CRYPTO_UTILITY_H_
class Crypto... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2010 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Yngve Pettersen
**
*/
#ifndef __SSLBASE_H
#define __SSLBASE... |
#include "settings.h"
const QString Settings::GlassHeight = "glass/height";
const QString Settings::GlassWidth = "glass/width";
Settings::Settings() : QSettings("tetris.ini", QSettings::IniFormat) {
}
|
#pragma once
template <class Key, class T>
class QMap;
template <class T1, class T2>
class QPair;
class QString;
class Configurator {
public:
static void readConfigurations();
static QString getHostName();
static int getPort();
private:
static QPair<QString, QString> handleLine(QString line);
sta... |
#include<iostream>
#include<cstring>
#include<climits>
using namespace std;
int n,dp[1000][1000];
int f(int i,int j,int arr[])
{
if(i>j)
return 0;
int q1=arr[i]+min(f(i+1,j-1,arr),f(i+2,j,arr));
int q2=arr[j]+min(f(i,j-2,arr),f(i+1,j-1,arr));
return max(q1,q2);
}
int dpsol(int arr[])
{
for(int i=0;i<=n;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.
*
* @file
* @author Owner: shuais
*
*/
#ifndef _... |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
string s; cin >> s;
int len = s.length();
if (s[0] == 'A') {
}
} |
#include "Pick.h"
void iberbar::PickRayFromClient(
D3DXVECTOR3* pOutRayPosition, D3DXVECTOR3* pOutRayDirection,
const D3DXMATRIX* pMatProj,
const CSize* pViewport,
const CPoint* pClientPoint )
{
assert( pOutRayPosition );
assert( pOutRayDirection );
assert( pMatProj );
assert( pViewport );
assert( pClien... |
// Created on: 1998-01-22
// Created by: Sergey ZARITCHNY
// Copyright (c) 1998-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;
void heapify(vector<int>& v,int i){
//int temp = v[i-1];
while(i<=v.size()){
int childa = 2*i;
int childb = 2*i+1;
if(childa<=v.size()&&v[i-1]<v[childa-1]){
swap(v[i-1],v[childa-1]);
heapify(v,childa);
... |
/**
******************************************************************************
* File Name : main.c
* Description : Main program body
******************************************************************************
*
* COPYRIGHT(c) 2016 STMicroelectronics
*
* Redistribution and use in ... |
#pragma once
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include "glm/glm.hpp"
#include "glm/gtc/matrix_transform.hpp"
#include "glm/gtc/type_ptr.hpp"
#include <shaders.h>
#include <vector>
#include <map>
enum DRAW_MODE { DM_NORMAL, DM_NO_LINES, DM_ONLY_LINES };
class Object {
private:
std::vector<float> vertices... |
#pragma once
class BhvAIAttack : public Hourglass::IAction
{
public:
void LoadFromXML(tinyxml2::XMLElement* data);
bool IsRunningChild() const { return false; }
void Init(Hourglass::Entity* entity);
IBehavior::Result Update(Hourglass::Entity* entity);
IBehavior* MakeCopy() const;
private:
StrID m_TargetTa... |
#include <iostream>
#include <fstream>
#include <map>
#include <string>
using namespace std;
int main(int argc, char** args)
{
if(argc < 2)
{
cout << "Usage: rdbr <ROM database file>" << endl;
return 1;
}
ifstream romdb_file;
romdb_file.open(args[1]);
if(!romdb_file.is_open())
{
cout << "Could not ope... |
#ifndef OPENCV_CUDA_SAMPLE_PERFORMANCE_H_
#define OPENCV_CUDA_SAMPLE_PERFORMANCE_H_
#include <iostream>
#include <cstdio>
#include <vector>
#include <numeric>
#include <string>
#include <opencv2/core/utility.hpp>
#define TAB " "
class Runnable
{
public:
explicit Runnable(const std::string& nameStr): name_(nam... |
//
// nextNum
// J. A. Pearson, jon@jpoffline.com
// Feb 2017
//
#pragma once
#include <vector>
#include <iostream>
#include <string>
#include "tools.h"
#include "solution.h"
#include "tests.h"
#include "exception.h"
#include "utils.h"
//----------------- Declarations -----------------//
namespace JP{
// Run the ... |
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> v;
int cnt = 0;
for (int i = 0; i < 3; i++) {
int x; cin >> x;
v.push_back(x);
}
sort(v.begin(), v.end());
// sortして、それぞれの数の差が奇数か偶数で場合分け
// cout << "even, even" << endl;
if ((v[1]... |
#include <bits/stdc++.h>
using namespace std;
int n, k;
int m[5][5];
bool dfs(int q, int v){
if(q == n){
return (v == 0);
}
for(int i=0; i<k; i++){
if(dfs(q+1, m[q][i] ^ v)) return true;
}
return false;
}
int main(){
cin >> n >> k;
for(int i=0; i<... |
#ifndef SHIP_H
#define SHIP_H
#include "Location.h"
class Ship
{
public:
Ship();
virtual ~Ship();
bool isBurnt();
void setShip(Location deck[3]);
Location _deck[3];
protected:
private:
};
#endif // SHIP_H
|
#pragma once
#include "Block.h"
#include <vector>
#include "rectangularvectors.h"
namespace WinTetris
{
class Polygon : public Block
{
public:
Polygon();
void Rotate() override;
};
}
|
#ifndef BALLLOCALIZER_H
#define BALLLOCALIZER_H
#include "Ball.h"
#include "Maths.h"
class BallLocalizer {
public:
BallLocalizer();
~BallLocalizer();
void update(Math::Position robotPosition, const BallList& visibleBalls, const Math::Polygon& cameraFOV, double dt);
Ball* getBallAr... |
/*************************************************************************************************
** Author: Chris Matian
** Date: 08/08/2017
** Description: This is the header class specification file for initializing the Tic Tac Toe board.
***************************************************************************... |
#pragma once
#include "stdafx.h"
#include "DataTypes\define.h"
#include "skeleton.h"
enum orient
{
R_Z_90 = 0x001,
R_Y_90 = 0x010,
R_X_90 = 0x100
};
#define VOLUME_REC(a) (a[0]*a[1]*a[2])
class boneAbstract
{
public:
boneAbstract(bone* boneO, float voxelSize);
boneAbstract(void);
~boneAbstract(void);
Vec3... |
class Category_562 {
duplicate = 569;
};
|
#include "Central.hpp"
#include "TitleScene.hpp"
#include "BattleScene.hpp"
#include "Key.hpp"
#include "UseDxLib.hpp"
#include <memory>
namespace game {
void TitleScene::Update()
{
//タイトル文字描画
DxLib::DrawString(50, 50,"文字シューティング", DxLib::GetColor(255, 255, 255));
if (Key::GetInstance().GetKey(KEY_INPUT_RETURN... |
// 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.
#include <_root.app18_accessor_app18_Button_Value.h>
#include <app18.Button.h>
#include <Uno.Bool.h>
#include <Uno.Object.h>
#include <Uno.String.h>
#include ... |
#include <iostream>
#include <cmath>
#include <map>
using namespace std;
using ll = long long;
using ld = long double;
const ll MOD = 998244353;
template <typename T>
T gcd(T a, T b) {
if (a < b) return gcd(b, a);
return b == 0 ? a : gcd(b, a % b);
}
template <typename T, typename U>
T mypow(T b, U n) {
... |
#define RIGHT_BACKWARD 13
#define RIGHT_FORWARD 12
#define LEFT_BACKWARD 10
#define LEFT_FORWARD 9
#define STEER 14
int duty = 1150;
int CYCLE = 4;
int low = 200;
int run = 165;
int fast = 50;
char command;
void Forward();
void FastForward();
void TurnLeft();
void TurnRight();
void LeftForward();
void RightForward();
v... |
/*
* Twosum.h
*
* Created on: 2021. 9. 7.
* Author: dhjeong
*/
#ifndef TWOSUM_TWOSUM_H_
#define TWOSUM_TWOSUM_H_
#include <vector>
class Twosum {
public:
Twosum();
virtual ~Twosum();
void run();
private:
void doTest(std::vector<int>& inputList, int target);
};
#endif /* TWOSUM_TWOSUM_H_ */
|
#include <vector>
using namespace std;
class counterinfo{
public:
int counternumber;
int customerno;
float depttimeallcurrcustomer;
counterinfo(int counternumber,int customerno,float depttimeallcurrcustomer){
this->counternumber=counternumber;
this->customerno=customerno;
this->depttimeallcurrcustomer=deptti... |
#include "PacketAccumulator.h"
#include "RoomManager.h"
PacketAccumulator::PacketAccumulator(RoomManager &roomManager)
: m_roomManager(roomManager) {
}
bool PacketAccumulator::hasRoom(std::array<char, HASH_LENGTH> room) {
const std::lock_guard<std::mutex> packetLock(m_packetMutex);
return contains(... |
#include "sensor.h"
Sensor::Sensor(std::string username, double latitude, double longitude, std::string ipAddress, size_t port) {
this->username = username;
this->latitude = latitude;
this->longitude = longitude;
this->port = port;
this->ipAddress = ipAddress;
}
Measurement::Measurement(std::strin... |
#include<stdio.h>
#include<string.h>
#include<memory.h>
int main(){
int i,j,T,n;
int count[10];
scanf("%d",&T);
while(T--){
scanf("%d",&n);
memset(count,0,10*sizeof(int));
for(i=1;i<=n;i++){
int num=i;
while(num>0){
count[num%10]++;
num/=10;
}
}
for(i=0;i<9;i++)
... |
//顺序队列
#include <iostream>
using namespace std;
template<class ElemType>
class SqQueue {
private:
const static int MaxSize = 5;
ElemType data[MaxSize]; //存放队列元素
int front, rear; //队头指针和队尾指针
public:
SqQueue(); //初始化队列对象
bool IsEmpty(); //判断... |
//javier Alvarez Reyes
#include <cstdlib>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include<string>
#include <sstream>
using std::string;
#include "vigenere3(E).h"
using std::string;
using namespace std;
int main()
{
int x=1;
int aea;
string n;
string m;
string sifrado;
cout << "coloque su... |
#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#include<cmath>
#define ll long long
using namespace std;
vector<int> vec;
int main()
{
long n;
cin>>n;
while(n)
{
long r=n%8;
vec.push_back(r);
n=n/8;
}
for(int i=vec.size()-1;i>=0;i--)
cout<<vec[i];
return 0;
} |
/*
* main.cpp
*
* Created on: 2017年6月4日
* Author: lcy
*/
#include "BiTree.cpp"
int main()
{
BiTNode<char>* p;
CreateBiTree(p);
PreOrderTraverse(p);
std::cout << std::endl;
InOrderTraverse(p);
std::cout << std::endl;
PostOrderTraverse(p);
}
|
//
// Created on 20/01/19.
//
//
// Code for ROSL taken directly from implementation: https://github.com/tjof2/robustpca
//
#include <iostream>
#include <iomanip>
#include "ROSL.h"
#include "../Algebra/Auxiliary.h"
namespace Algorithms
{
void ROSL::ROSL_Recovery(arma::mat &input, uint64_t rank, double reg)
{
u... |
#include "display.h"
#include <LedControl.h>
LedControl lc = LedControl(10, 12, 11, N_DISPLAYS);
uint8_t displayLines[N_DISPLAYS * 8];
uint8_t updatedLines[N_DISPLAYS];
void initDisplay() {
for (uint8_t i = 0; i < N_DISPLAYS; i++) {
// put your setup code here, to run once:
lc.shutdown(i,false);// turn off ... |
#include "Deck54.hpp"
Deck54::Deck54() :Deck52(){
//{ As 14 3 4 5 6 7 8 9 10 Valet Dame Roi JokerNoir JokerRouge } * { Coeur Carreaux Trèfle Pique }
const Card JokerNoir = Card ();
const Card JokerRouge = Card ();
(*this)+=JokerNoir+JokerRouge;
}
|
#include <iberbar/RHI/OpenGL/ShaderProgram.h>
#include <iberbar/Utility/String.h>
#include <iberbar/Utility/FileHelper.h>
iberbar::CResult iberbar::RHI::OpenGL::LoadShaderFromSource( GLenum shaderType, const char* pSource, GLuint* pShader )
{
assert( pSource );
assert( pShader );
GLuint shader = glCreateShader... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.