text stringlengths 8 6.88M |
|---|
#ifndef _LIBRARY_T_H
#define _LIBRARY_T_H
using namespace std;
class Library_t{
public:
Library_t(){};
virtual ~Library_t();
//virtual bool addBook(string name, string author
private:
};
|
/* File: BasicAccount.h
* Name: Paulo Lemus
* Date: 2/2/2017
*/
#ifndef BASICACCOUNT_H_
#define BASICACCOUNT_H_
class BasicAccount{
// Private variables
long int accountNum;
std::string name;
float balance;
public:
/* Constructors:
*
* default, pass individual, and copy
*/
... |
#include<bits/stdc++.h>
using namespace std;
void solve(int** arr,int n,int m)
{
int** dist = new int*[n];
bool** visited = new bool*[n];
for(int i=0;i<n;i++)
{
dist[i]=new int[m];
visited[i]=new bool[m];
for(int j=0;j<m;j++)
{
dist[i][j]=INT_MAX;
visited[i][j]=false;
}
}
queue<pair<int,int>> Q;... |
#include <iostream>
using namespace std;
#include"FindArray.h"
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
int init[][3]={{1,2,3},{4,6,7},{11,23,345}};
size_t count=sizeof(init)/sizeof(int);
vector<vector<int> > array(in... |
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
#include<cstdio>
#include<cstring>
#include<algorithm>
#define MAXN 10005
using namespace std;
struct person{
char name[10];
int h;
}p[MAXN];
bool cmp(person a, person b){
if(a.h != b.h) return a.h > b.h;
else return strcmp(a.name,b.name) < 0;
}
int ans[MAXN];
void print(int low,int m){
int cnt =... |
#include <stdafx.h>
#include "ExpMeshes.h"
#include "Properties.h"
#include "GeoXOutput.h"
IMPLEMENT_GEOX_CLASS(ExpMeshes, 0)
{
BEGIN_CLASS_INIT(ExpMeshes);
ADD_NOARGS_METHOD(ExpMeshes::buildMesh);
ADD_NOARGS_METHOD(ExpMeshes::addNoise);
ADD_NOARGS_METHOD(ExpMeshes::smoothMesh);
ADD_BOOLEAN_PROP(weightedAvera... |
/**
* @author Levi Armstrong
* @date January 1, 2016
*
* @copyright Copyright (c) 2016, Southwest Research Institute
*
* @license Software License Agreement (Apache License)\n
* \n
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Licens... |
#include<stdio.h>
int main()
{
int used[10];
long i,j,k,l,r;
for(i=0;i<=22;i++)
{
j=i*i*i;
k=i*i*i*i;
if(1000<=j && j<=9999)
{
if(100000<=k && k<=999999)
{
for(l=0;l<10;l++)used[l]=0;
r=j;
while(r>0)
{
used[r%10]=1;
r/=10;
}
r=k;
while(r>0)
{
used[r%10]=... |
#include "WeaponChangeEvent.hpp"
WeaponChangeEvent::WeaponChangeEvent(int i):GameEvent(){
EventName = "#WeaponChangeEvent";
WeaponNumber = i;
}
WeaponChangeEvent::WeaponChangeEvent(string s):GameEvent(){
EventName = s.substr(1,17);
string param = "";
for(int i = 19; i < s.size(); i++){
... |
#include <GalagoAPI.h>
#include <LPC13xx.h>
#include <stdint.h>
using namespace Galago;
enum
{
SEG_A = (1 << 0), // (1 << 7),
SEG_F = (1 << 1), // (1 << 6),
SEG_D = (1 << 2), // (1 << 5),
SEG_E = (1 << 3), // (1 << 4),
SEG_G = (1 << 4), // (1 << 3),
SEG_C = (1 << 5), // (1 << 2),
SEG_DOT = (1 << 6), // ... |
#include "PostProcessing.h"
void PostProcessing::removeAcuteAngleBetweenGridPinsAndPaths(const vector<GridPin> &gridPins, vector<GridPath> &gridPaths, const double gridWireWidth) {
std::cout << "==========Start of all gridPaths Segments==========" << std::endl;
for (const auto &gPath : gridPaths) {
gPa... |
#ifndef ENTITY_H
#define ENTITY_H
#include <pcx/non_copyable.h>
class FrameParams;
class Events;
class SceneParams;
namespace Gx
{
class PhysicsModel;
}
class Entity : public pcx::non_copyable
{
public:
virtual ~Entity();
virtual void update(const FrameParams ¶ms, Events &events, Gx::PhysicsModel &ph... |
#pragma once
#include<string>
#include<vector>
#include<map>
#include<memory>
#include<windows.h>
#include<list>
#include<iostream>
using std::string;
using std::vector;
using std::map;
using std::auto_ptr;
using std::list;
using std::cout;
using std::endl;
// 适配器模式(adapter model)
class productE... |
#ifndef _TNA_RESOURCES_H_
#define _TNA_RESOURCES_H_ value
#include "resource_registry.h"
#include "../rendering/mesh_data.h"
#include "../rendering/shader.h"
namespace tna
{
using mesh_registry_t = TnaResourceRegistry<mesh_data_t, mesh_data_create, mesh_data_destroy> ;
using shader_registry_t = TnaResourceRegistry... |
class MainForm
{
SplitterFacetory *factory; //工厂
public:
MainForm(SplitterFactory* factory)
{
this->factory = factory;
}
void Button_Click()
{
string filePath = txtFilePath->getText();
int number = atoi(txtFileNumer->getText().c_str());
ISplitter *splitter = ... |
/*
* SWM11_SQcomparator.h
*
* Created on: Feb 4, 2014
* Author: vbonnici
*/
#ifndef SWM11_SQCOMPARATOR_H_
#define SWM11_SQCOMPARATOR_H_
#include "SWM11_Point.h"
#include "SWM11_point_comparator.h"
using namespace dolierlib::SWM11;
namespace dolierlib{
namespace SWM11{
class SWM11_SQcomparator : publ... |
//********************************************************
//
// Michael J Phillips
// Copyright 2015
// All rights reserved.
//
//********************************************************
#include <cmath>
#include <stdlib.h>
#include "normalRandomGenerator.h"
double NormalRandomGenerator::generate() con... |
// Copyright (c) 2014, Baidu.com, Inc. All Rights Reserved
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Author: yanshiguang02@baidu.com
#include <assert.h>
#include <dlfcn.h>
#include "hdfs.h"
#include "include/hdfs.h"
#include "../utils/counter.h"
nam... |
#include <windows.h>
#include <gl/glut.h>
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
HINSTANCE g_hInst;
HWND hWndMain;
LPCTSTR lpszClass=TEXT("DisplayVersion");
int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance
,LPSTR lpszCmdParam,int nCmdShow)
{
HWND hWnd;
MSG Message;
WNDCLASS WndClass;... |
/************************************************
* Author: Zachary Reed
* Description: Project 0 source code
* Date: 4/6/2020
* References:
* 1.) Author: Mike Baily
* Title: Simple OpenMP Experiment main Program
* Description: Source code example for Project 0
* Date Accessed: 4/5/2020
***********... |
#include <IridiumSBD.h>
#include <SoftwareSerial.h>
SoftwareSerial nss(18, 19);
IridiumSBD isbd(nss, 10);
static const int ledPin = 13;
void setup()
{
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}
bool ltest()
{
return false;
}
void loop()
{
//digitalWrite(ledPin, LOW);
digitalWrite(ledPin, (mi... |
#pragma once
class Car
{
protected:
char* name;
char* body;
int engine;
int wheels;
char* transmission;
public:
void SetName(char* name)
{
this->name = name;
}
void SetBody(char* body)
{
this->body = body;
}
void SetEngine(int engine)
{
this->engine = engine;
}
void SetWheels(int wheels)
{
this... |
class Solution {
public:
int minSwaps(vector<int>& data) {
int n = data.size();
// step 1: Count how many 1 in the data and set this number as the size of sliding window.
int window = accumulate(data.begin(), data.end(), 0);
if (window == 0 || window == n) return 0;... |
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int singleNonDuplicate(vector<int> &nums)
{
map<int, int> m;
for (auto a : nums)
m[a]++;
int ans = 0;
for (auto itr = m.begin(); itr != m.end(); itr++)
if (itr->second == 1)
... |
#ifndef BACHERO_ENGINE_COMMON_DEBUG_MODE
#define BACHERO_ENGINE_COMMON_DEBUG_MODE
namespace Engine {
class DebugMode {
public:
static void enable() {
_enabled = true;
}
static void disable() {
_enabled = false;
}
static void toggle() {
... |
#include <bits/stdc++.h>
using namespace std;
struct ListNode
{
int val;
ListNode *next;
ListNode() : val(0), next(NULL) {}
ListNode(int x) : val(x), next(NULL) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
class Solution
{
public:
void reorderList(ListNode *head)
{
... |
class Solution {
public:
int findMaxForm(vector<string>& strs, int m, int n) { // 本题比较特殊,是二维的0-1背包问题
vector<vector<int>> dp(m + 1, vector<int>(n + 1, 0)); // 本行和下面一行等价
// int dp[101][101] = {0}; // 像这种数组直接 = {0}的,就是把所有初值全部赋为0
for (string str : strs) {
int oneNum = 0; // 统计0... |
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
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... |
#include <iostream>
#include <string>
using namespace std;
//hàm xóa khoảng trống đầu dòng
void xoa_daudong(string &s){
while (s[0] == ' '){
s.erase(s.begin() + 0); // xóa đi kí tự tại vị trí 0
}
}
// hàm xóa khoảng trống cuối dòng
void xoa_cuoidong(string &s){
while (s[s.length()... |
#include "Archer.h"
Archer::Archer() : Ranged::Ranged()
{
range = 120;
ammunition = 25;
missile_damage = 1;
recruitment_cost = 500;
upkeep_cost = 300;
}
Archer::~Archer()
{
}
char Archer::type_of_unit()
{
return 'a';
}
|
#include <bits/stdc++.h>
using namespace std;
struct elem
{
int x;
elem *next;
elem *prev;
};
class MyList
{
elem *head;
elem *tail;
public:
MyList()
{
head = nullptr;
tail = nullptr;
}
void pushb(int val)
{
elem *cur... |
#include <All-Tests.h>
#include <Test.h>
#include <Tree.h>
using namespace Test;
void tree_test(RutinaNode * r) {
Tree* t1 = new Tree;
r->finalizar();
}
|
#include "..\Render\context.h"
#include "..\WindowInput\window.h"
#include "..\GLRender\opengl.h"
#include "..\include\windows.h"
#include "..\include\cpputils.h"
#include "..\include\map.h"
RenderContext::~RenderContext()
{
}
extern PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB;
extern PFNWGLCHOOS... |
//
// Created by Kirill Smetankin on 01/12/2018.
//
#ifndef NEW_STRATEGY_1_UI_HPP
#define NEW_STRATEGY_1_UI_HPP
#include <iostream>
#include <SFML/Graphics.hpp>
#include "definitions.hpp"
#include "player.hpp"
#include <being.hpp>
const float LOG_BOX_WIDTH = 0.6; // проценты
const float LOG_BOX_HEIGHT = 50; // ре... |
#include "drama.h"
#include "rentalperiods.h"
Drama::Drama(int stock, const std::string& title, const std::string& director,
int releaseYear):DVD(DramaDVD, stock, title, director, releaseYear,
DVD_RENTAL_PERIOD)
{
/*
this->type = RentableType::DVD;
this->subtype = DramaDVD;
this->stock = stock;
this... |
#pragma once
#include <GL/glew.h>
#include <glm/detail/type_vec3.hpp>
#include <glm/mat4x4.hpp>
#include "Color.h"
class Triangle
{
public:
Triangle(GLfloat vertices[], Color& color = Color::black());
~Triangle();
void draw();
void setColor(Color& color);
Color& getColor();
glm::vec3 GetCenterOfMass() const;
g... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* NinjaTrap.cpp :+: :+: :+: ... |
// EnergyPlus, Copyright (c) 1996-2019, The Board of Trustees of the University of Illinois,
// The Regents of the University of California, through Lawrence Berkeley National Laboratory
// (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
// National Laboratory, managed by UT-Batt... |
/*
* Copyright (C) 2018 German Mendez Bravo (Kronuz)
*
* 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, modif... |
/*
Bullet Continuous Collision Detection and Physics Library Maya Plugin
Copyright (c) 2008 Walt Disney Studios
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... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "BoardVR.h"
#include "BoardVRGameMode.h"
|
# include <stdio.h>
int main() {
int workerNum, hours;
float amountPerHour;
scanf("%d", &workerNum);
scanf("%d", &hours);
scanf("%f", &amountPerHour);
printf("NUMBER = %d\n", workerNum);
printf("SALARY = U$ %.2f\n", amountPerHour * hours);
return 0;
}
|
#include "opencv.hpp"
using namespace cv;
using namespace std;
void showResult(char* name, cv::Mat image)
{ //window's name
cv::namedWindow(name);
//image
cv::imshow(name, image);
}
Mat addIcon(Mat backGround, Mat icon, int x, int y, int iconColsSize, int iconRowsSize)
{
cv::Rect rectDst(x, y, icon.cols, ico... |
#include "move.h"
Move::Move()
{
depth = dcol = drow = index = -1;
hVal = 0;
part = ERROR;
}
Move::Move(int ind, int de, Parts pt, int dc, int dr)
{
index = ind;
depth = de;
part = pt;
dcol = dc;
drow = dr;
}
void Move::setupWrigglers(vector<Wriggle>& wr)
{
wrigglers = wr;
return;
}
void Mo... |
#include "Stone.h"
Stone::Stone(sf::Vector2f location, sf::Vector2f size, sf::Vector2f scale, sf::Color color)
:StationaryItem(location, size, scale, color), m_rect(location, size, scale, color), m_sprite(m_res.getStoneTexture())
{
m_scale.x /= m_res.getSizeStone().x;
m_scale.y /= m_res.getSizeStone().y;
}
Stone::... |
//
// Created by zander on 2017/12/30.
//
#include "include/Errors.h"
void fatal_error(std::string err)
{
std::cout << err << std::endl; //std::cerr?
std::cout << "Enter any key to exit...";
int tmp;
std::cin >> tmp;
SDL_Quit(); //SDL funksie om al SDL systems te stop
exit(69);//Exit die program
}
|
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL... |
#include "Employee_Repository.h"
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
Employee_Repository::Employee_Repository(){
}
void Employee_Repository::read_employee_list() {
ifstream fin;
fin.open("employee_list.txt");
string str;
if(fin.is_open()) {
while(!fi... |
#ifndef SPAN_SRC_SPAN_IO_STREAMS_FILTER_HH_
#define SPAN_SRC_SPAN_IO_STREAMS_FILTER_HH_
#include <memory>
#if __has_include(<string_view>)
#include <string_view>
using std::string_view;
#else
#include <experimental/string_view>
using std::experimental::string_view;
#endif
#include "span/Common.hh"
#include "span/io/... |
#ifndef LOOP_COMMAND_H
#define LOOP_COMMAND_H
#include "Command.h"
class LoopCommand : public Command
{
public:
int execute();
};
#endif |
#include <bits/stdc++.h>
#define MOD 1000000007
#define llint long long int
#define max(a,b) (a>=b?a:b)
#define min(a,b) (a<=b?a:b)
using namespace std;
vector<int> graph[100001];
llint dp[100001][2][3],N,u,v,parent[100001];
bool visited[100001];
bool leaf(int node)
{
bool l=true;
for(int i=0;i<graph[node].... |
#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ll long long
#define pii pair<int,int>
#define all(x) begin(x), end(x)
#define loop(i,n) for(int i=0; i<n; i++)
#define rep(i,a,b,c) for(int i=a; i<b; i+=c)
#define brep(i,a,b,c) for(int... |
/*
* Copyright (C) 2007-2015 Frank Mertens.
*
* Use of this source is governed by a BSD-style license that can be
* found in the LICENSE file.
*
*/
#ifndef FLUXMAKE_COMPILELINKSTAGE_H
#define FLUXMAKE_COMPILELINKSTAGE_H
#include "BuildStage.h"
namespace fluxmake {
class CompileLinkStage: public BuildStage
{
p... |
#include "DynamicArray.h"
CDynamicArray::CDynamicArray( u16 uStartingAllocation )
: m_uAllocated( uStartingAllocation )
, m_uSize( 0 )
{
}
u16 CDynamicArray::GetSize() const
{
return m_uSize;
}
|
/* Copyright (C) 2015 Willi Menapace <willi.menapace@gmail.com>, Simone Lorengo - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited
* Proprietary and confidential
* Written by Willi Menapace <willi.menapace@gmail.com>
*/
#include "XBeeTransmitStatus.h"
#include... |
#include <bits/stdc++.h>
using namespace std;
int main()
{
freopen("in", "r", stdin);
freopen("out", "w", stdout);
int T;
scanf("%d", &T);
for(int tt=1; tt<=T; tt++)
{
int l, r;
scanf("%d %d", &l, &r);
char s[l+r];
if(l==0 || r==0)
{
printf("0\n");
continue;
}
else if(l==1 || r==1)
{
... |
#include<bits/stdc++.h>
using namespace std;
int visited[20010];
bool color[20010];
vector<int> adj[20010];
bool dfs(int cur, bool c){
if(visited[cur]) {
if(c == color[cur]) return 1;
return 0;
}
visited[cur] = 1;
color[cur] = c;
bool res = 1;
for(int next:adj[cur]){
res &= dfs(next, !c);
}
... |
#include<iostream>
using namespace std;
int main() {
int a;
char b;
cin >> a;
b = a + 65;
cout << a << "번쨰 영어 대문자는" << b << "번째 영어 대문자" << endl;
//cout할때 b+65이런 식으로 하면 숫자만 더해짐
}
|
#include "matchit/core.h"
#include "matchit/patterns.h"
#include "matchit/expression.h"
using namespace matchit;
bool isLarge(int32_t value)
{
return match(value)(
pattern(app([](int32_t x) { return x * x; }, _ > 1000)) = [] { return true; },
pattern(_) ... |
#include "StataHeader.h"
#include <bitset>
#include <iostream>
#include <string>
#include <cstdio>
template <typename T>
T GetLSF(char * ctxbuf, int size)
{
int i, j;
T currValue = 0;
for (i=0, j=0; i < size; i++, j += 8)
currValue |= ((ctxbuf[i] << j) & (0xFF << j));
return currVa... |
#ifndef GREG_AND_JULIAN_DATE_H_
#define GREG_AND_JULIAN_DATE_H_
#include "kattistime.h"
#include "date.h"
#include <string>
#include <iostream>
namespace lab2
{
class GregAndJulianDate : public Date {
public:
virtual ~GregAndJulianDate() { };
virtual int year() const = 0;
virtual int month()... |
//
// Created by hw730 on 2020/6/8.
//
#ifndef DEFENCE_GAME_TARGETBULLETFACTORY_H
#define DEFENCE_GAME_TARGETBULLETFACTORY_H
#include"BulletFactory.h"
#include"Position.h"
#include"TargetBullet.h"
class TargetBulletFactory : public BulletFactory{
public:
virtual TargetBullet getBullet(Position pos);
};
#endif /... |
#include<iostream>
#include<string>
using namespace std;
int main()
{
string input;
getline(cin,input);
int n;
n = input.length();
int flag =0;
//cout<<n<<'\n';
for(int i=0; i<n; i++)
{
if((flag==0 && input.at(i)=='h') ||(flag==1 && input.at(i)=='e') ||((flag==2 || flag==3) && input.at(i)=='... |
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
// compare函数在>时返回 1,<时返回 -1,==时返回 0。
// 比较区分大小写,比较时参考字典顺序,排越前面的越小。
// 大写的A比小写的a小。
// int compare(conststring & s) const; //与字符串s比较
// int compare(constchar * s) const; //与字符串s比较
return 0;
} |
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <string>
#include <algorithm> // for std::max
#include <cstdlib> // for rand()
#include <limits>
#include "pmvs_base/pmvs/patch.h"
#include "pmvs_base/numeric/vec4.h"
const int GRID_SIZE = 64;
const int SAMPLES = 50000;
... |
#include <iostream>
class MyClass
{
int a;
int b;
};
class SmartMyClass
{
public:
SmartMyClass(int a, int b);
operator int() const;
private:
int _a;
int _b;
};
SmartMyClass::SmartMyClass(int a, int b)
: _a(a), _b(b)
{
}
SmartMyClass::operator int() const
{
return _a | _b;
}
int main... |
/*=========================================================================
Program: Visualization Toolkit
Module: vtkLagrangeInterpolation.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This so... |
#include <process.h>
#include <ctime>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include "GdsServer.h"
#include "Socket.h"
GdsServer::request_func GdsServer::request_func_ = 0;
unsigned GdsServer::Request(void* ptr_s) {
Socket s = *(reinterpret_cast<Socket*>(ptr_s));
std::string li... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "PPState_ROLL.h"
#include "Globals/GlobalFunctions.h"
#include "Kismet/KismetMathLibrary.h"
#include "Kismet/KismetSystemLibrary.h"
void UPPState_ROLL::Init(UPlayerFSMComponent* InPlayerFSMComponent)
{
PlayerFSMComponent = InPla... |
//#include<bits/stdc++.h>
//using namespace std;
// int main(){
// int m,n,k;
// cin>>n;
// k=n*(n+1)/2+1;
// cout<<k<<endl;
// }
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,c;
cin>>n;
c=((n*(n+1))/2)+1;
cout<<c;
return 0;
}
|
#include<iostream>
#include<math.h>
typedef long long int ll;
ll gcd(ll,ll);
ll lcm(ll,ll);
ll factors(ll);
ll prime_divisors(ll);
ll fast_exp(ll,ll);
ll fibonnaci_Dp(ll);
ll fibonnaci_Matrixexponen(ll);
ll nCr(ll,ll);
ll nPr(ll,ll);
void multiply(ll F[2][2], ll M[2][2]);
void power(ll F[2][2], ll n);
using namespace s... |
/*
* Copyright (C) 2012-2016 Open Source Robotics Foundation
*
* 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 a... |
//
// Music.cpp
// Fighters
//
// Created by zhutun on 15/5/30.
// Copyright (c) 2015年 zhutun. All rights reserved.
//
#include "Music.h"
#include <SFML/Audio.hpp>
#include <ResourcePath.hpp>
#include <SFML/System.hpp>
#define BOOMVOLUM 30
#define FIREVOLUM 20
sf::Music Music::BGM;
sf::Music Music::BOOM;
sf::Mus... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
while(t--)
{
int n,a;
cin>>n;
int mx=INT_MIN,diff=0;
for(int i=0;i<n;i++)
{
cin>>a;
mx=max(a,mx);
... |
//
// CardTypeDefine.hpp
// demo_ddz
//
// Created by 谢小凡 on 2018/2/8.
//
#ifndef CardTypeDefine_hpp
#define CardTypeDefine_hpp
#include <unordered_map>
#include <vector>
#include <string>
#include <functional>
#include <algorithm>
// 牌型种类定义
enum class CTName
{
Undef = -1,
Single,
Pair,
Tri,
T... |
/**
* descentAlgorithm.hpp
* Describing our trees as collections of Node objects. There
* is no "tree" object. The algorithm will recognize each node
* as the root of its own tree.
*/
#ifndef DESCENTALGORITHM_HPP_INCLUDED
#define DESCENTALGORITHM_HPP_INCLUDED
#include <cstddef>
#include <list>
using namespace... |
#include <iostream>
#include <algorithm>
#include <string>
#include "olcConsoleGameEngine.h"
using namespace std;
class PathFinding : public olcConsoleGameEngine
{
public:
PathFinding()
{
m_sAppName = L"Path Finding";
}
private:
struct Node
{
bool isBlocked = false;
bool isVisited = fa... |
#pragma once
#include "InputModule.h"
#include "Rtypes.h"
#include <vector>
#include "TMath.h"
#define GTreeTagger_MAX 4096
namespace ant {
namespace analysis {
namespace input {
class TaggerInput: public BaseInputModule {
protected:
Int_t nTagged = 0;
Int_t taggedChannel[GTreeTagger_MAX... |
// Classes.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <iostream>
#include "Player.h"
#include "time.h"
#include <string>
std::string getResponse(std::string name)
{
std::string response1 = name + " just got recked soooooon!!!"+ "-20hp";
std::st... |
#include "ChangeDistance.h"
ChangeDistance::ChangeDistance(float delta):
SetDistance(CommandBase::drivetrain->GetHeading() + delta) { }
|
#pragma once
#include <string>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <limits>
using namespace Chemistry;
using namespace EngineLayer;
using namespace EngineLayer::ClassicSearch;
using namespace EngineLayer::Indexing;
using namespace EngineLayer::ModernSearch;
using nam... |
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
struct TREE;
struct Q;
int add_4(TREE *&tree, int top, int *lvl, string *arr_val, int &index);
int push_4(TREE *&tree, int top, int *lvl, string *arr_val, int &index);
int create_4(int &ind, int *&lvl, string *&arr_val, string forest);
void... |
/*
* interrupt_link.hpp
*
* Created on: Sep 15, 2018
* Author: willmitchell
*/
#ifndef INTERRUPT_LINK_HPP_
#define INTERRUPT_LINK_HPP_
#ifdef __cplusplus
extern "C" {
#endif
void * modulePointer;
void (*tscTimerCallback)(void*);
void (*uiTimerCallback)(void*);
void (*mainRisingEdgeCallback)(void*);
void ... |
#include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
for(int indice=0;indice<=10;indice++)
{
cout<<"Valor de la variable indice: "<<indice<<endl;
}
return 0;
}
|
/*
ID: zrh331
PROG: last
LANG: C++
*/
#include <iostream>
#include <stdio.h>
#include <map>
#include <string.h>
#include <algorithm>
#include <assert.h>
using namespace std;
#define maxint 2147400000
// 10 de 6 cifang
int n, a, b, tmp, ans=1, tot=0;
int get (int num) {
int t=0;
while (tmp%num... |
#include <cstdlib>
#include <iostream>
#include <cassert>
#include <vector>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <png.h>
#include "Texture.h"
#include "FurTexture.h"
#include "FurGeometry.h"
#include "Shader... |
#include <iostream>
#include "ventana.h"
int main()
{
Ventana* w= &Ventana::win;
if (!w->init("../../otelo/otelo/resources", 5, 6)) { // Directorio con recursos, filas, columnas
std::cerr << "No se ha podido inicializar la ventana del juego... " << std::endl;
return 1;
}
// Lo de w es... |
# include <Entity.hpp>
Entity::Entity(const std::string & folder, const float & velocity)
: AnimatedSprite(folder),
Attributes(3u),
m_velocity(velocity)
{
# ifdef DEBUG
Report::report_id(Report::report::entity_created);
# endif // DEBUG
}
Entity::Entity(const Entity & copy)
: AnimatedSprite(copy),
m_veloc... |
#include <NodeMessage.h>
#include <arduino.h>
#include <stdlib.h>
//Appends a char array to the buffer array
void NodeMessage::CreateSendString(char *buffer, uint8_t &bufferLength, const char *tag, char *value) {
bufferLength += sprintf(&buffer[bufferLength],"%s",tag);
bufferLength += sprintf(&buffer[bufferLength],... |
#include "instrument.h"
class Instrument{
public:
void instrument::buildInstrument(std::string type){
std::unique_ptr<Instrument> instrument;
}
}; |
//
// Created by matan on 1/14/20.
//
#ifndef SOLID_SERVER_REDO_ISEARCHER_H
#define SOLID_SERVER_REDO_ISEARCHER_H
#include "../Searchables/ISearchable.h"
template<class Solution, class Var>
class ISearcher {
public:
virtual Solution search(ISearchable<Var>* iSearchable) = 0;
};
#endif //SOLID_SERVER_REDO_ISEAR... |
#include "IBVHBuilderAPI.h"
#include <windows.h>
typedef IBVHBuilder2* (*CreateFunc)(char* cfg);
IBVHBuilder2* CreateBuilderFromDLL(const wchar_t* a_path, char* a_cfg)
{
HMODULE hDll = LoadLibraryW(a_path);
if (hDll == NULL)
return nullptr;
CreateFunc func = (CreateFunc)GetProcAddress(hDll, "CreateBuilder... |
#include "Game.h"
#include <iostream>
using namespace std;
Game::Game(const Board& b, Player* south, Player* north):m_b(b)
{
S=south;
N=north;
curr_player=S;
}
void Game::display() const
{
cout<<" "<<N->name()<<endl;
cout<<" ";
for(int i=1;i<=m_b.holes();i++)
cout<<m_b.be... |
//CtrlCKey.cpp
#include "CtrlCKey.h"
#include "MemoForm.h"
CtrlCKey::CtrlCKey(Form *form)
:KeyAction(form) {
}
CtrlCKey::CtrlCKey(const CtrlCKey& source)
: KeyAction(source) {
}
CtrlCKey::~CtrlCKey() {
}
CtrlCKey& CtrlCKey::operator=(const CtrlCKey& source) {
KeyAction::operator=(source);
return *this;
}
... |
// This file has been generated by Py++.
#include "boost/python.hpp"
#include "generators/include/python_CEGUI.h"
#include "XMLSerializer.pypp.hpp"
namespace bp = boost::python;
void register_XMLSerializer_class(){
{ //::CEGUI::XMLSerializer
typedef bp::class_< CEGUI::XMLSerializer, boost::noncopyable >... |
// ConsoleApplication4.cpp : Définit le point d'entrée pour l'application console.
//
#include "stdafx.h"
#include <iostream>
#include <random>
#include <string>
#include <stdlib.h>
#include <windows.h>
int intro(); int block1_parchemin(); int block2_fin1(); int block3_porte(); int block4_coffre(); int block5_choix()... |
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(ui->btnNewWindow,SIGNAL(clicked()),this,SLOT(open_window2()));
connect(ui->btnSalir,SIGNAL(clicked()),this,SLOT(close()));// Cierra l... |
#ifndef STRUCTS_H
#define STRUCTS_H
// CPP libs
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
#include <memory>
#include <random>
//#include <vector>
//#include <stack>
//#include <exception>
//#include <stdexcept>
// C libs
#include <cmath>
#include <cctype>
#include <cstring>
#includ... |
/*
* Author : BurningTiles
*/
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main(){
int n;
cin >> n;
double b[n], rate, sum=0;
for(int i=0; i<n; ++i){
cin >> b[i];
b[i] = pow(b[i],3)*3.14*4/3;
}
cin >... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.