text stringlengths 8 6.88M |
|---|
//用递归来解决全排列问题
#include<cstdio>
const int maxn=11;//因为有0-9这十个数
int n,P[maxn],hashTable[maxn]={false};//P为当前排列,hashTable记录整数x是否已经在P中
void generateP(int index);
int main()
{
n=5;//输出3的全排列
generateP(1);//从1开始试探
return 0;
}
void generateP(int index)
{
if(index==n+1)//递归边界,说明1-n位已经排好
{
//输出已经排好的序列
for(int i=1;i<=... |
double jackson(unsigned n, unsigned N);
Eigen::Array<TR, -1, -1> calc_dos(Eigen::Array<TR, -1, -1> mu, Eigen::Array<TR, -1, -1> energies, std::string mode);
void extended_euclidean(int a, int b, int *x, int *y, int *gcd);
class variables{
public:
double avg_time;
unsigned iter;
unsigned m... |
#pragma once
#include <cstddef>
#include <cstring>
#include <string>
#include "CIL/xadd.h"
namespace cil {
class FileNode;
class String {
public:
typedef char value_type;
typedef char& reference;
typedef const char& const_reference;
typedef char* pointer;
typedef const char* const_pointer;
typedef ptr... |
//
// Created by 王润基 on 2017/4/8.
//
#ifndef INC_2RAYTRACE_INTERSECTRESULT_H
#define INC_2RAYTRACE_INTERSECTRESULT_H
#include <iostream>
#include "Ray.h"
class Material;
class IRayCastable;
class Shape;
class Object;
struct IntersectInfo {
// Request
Ray ray;
float testBlockT = 0; // 若此数不为0,则直接给success赋... |
#include <iostream>
#include "Ant.hpp"
#include "Doodlebug.hpp"
#include "Grid.hpp"
int main()
{
Grid grid;
grid.displayGrid();
int steps = 20;
for (int step = 0; step < steps; step++)
{
grid.moveCritters();
}
return 0;
}
|
#include "MyListView.h"
#include <QMouseEvent>
#include <QDebug>
MyListView::MyListView(QWidget *parent) :
QListView(parent)
{
}
void MyListView::mouseMoveEvent(QMouseEvent *event)
{
//qDebug()<<event->x()<<" "<<event->y();
int x = mapToGlobal(event->globalPos()).x();
int y = mapToGlobal(event->globalPos()).y()... |
//
// Created by wiktor on 25.04.18.
//
#ifndef JIMP_EXERCISES_PESEL_H
#define JIMP_EXERCISES_PESEL_H
#include <string>
namespace academia{
using std::string;
class Pesel {
public:
Pesel(string);
~Pesel() = default;
void validatePESEL(string);
private:
string pesel_... |
#include <iostream>
#include "Medico.h"
#include "Ginecologista.h"
Ginecologista::Ginecologista(){}
Ginecologista::Ginecologista(string n, float a, float p, string e){
setNome(n);
setAltura(a);
setPeso(p);
setEspecialidade(e);
}
void Ginecologista::setEspecialidade(string e){
especialidade = e;
}
string G... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.Security.Authentication.Web.Core.1.h"
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::Foundation::Collections {
#ifndef WINRT_GENERIC_ac7f26f2_feb7_5b2a_8ac4_345bc62... |
//
// Created by Tidesun on 2019-04-23.
//
#include "file_reader.hpp"
// util function to split string into vector
template<typename Out>
void split(const std::string &s, char delim, Out result) {
std::stringstream ss(s);
std::string item;
while (std::getline(ss, item, delim)) {
*(result++) = item;... |
#pragma once
#include "Obstacle.hh"
const std::string kModelCuboid("solid/cuboidRead.dat");
const std::string kCuboidFile("solid/cuboid.dat");
/**
* @brief 3D type of obstacle
*
*/
class Cuboid: public Obstacle{
public:
Cuboid();
virtual ~Cuboid() override;
virtual void draw(std::string filename) c... |
#ifndef _SQMMDB_DATABASE_HPP_
#define _SQMMDB_DATABASE_HPP_
// ------------------------------------------------------------------------------------------------
#include "Handle/Database.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
/* -----... |
#include <stdlib.h>
#include <iostream>
#include "TQueue.cpp"
//#include "support.h"
#include "Customer.h"
#include "Cashier.h"
using namespace std;
int compare(int * a, int *b){
if(*a < *b) return -1;
else if(*a > *b) return 1;
else return 0;
}
int Random(const int start, const int end){
return(start + random()... |
#include "Particle.hpp"
#include <math.h>
Particle::Particle(float xpos, float ypos) {
location = new Location(xpos, ypos);
trajectory = new Vector2(0, 0);
color.red = color.blue = color.green = 1.0;
}
void Particle::setColor(float red, float blue, float green) {
if (red < 0.2 && green < 0.2 && blu... |
#include "stdafx.h"
#include "plotModel.h"
#include "data/grader.h"
#include "data/locator.h"
plot_model::plot_model(bool m)
: plot_maker(m)
, bitmap_maker_(this)
, valid_(false)
{
bitmap_maker_.attach_listener(this);
}
plot_model::~plot_model()
{
bitmap_maker_.detach_listener(this);
}
bool plo... |
/*
* CylindricalCoordinate.h
*
* Created on: Feb 18, 2012
* Author: wjones
*/
#ifndef CYLINDRICALCOORDINATE_H_
#define CYLINDRICALCOORDINATE_H_
#include "Utilities/Definitions.h"
#include "GeometricComponents/SpatialVector.hpp"
namespace CoordinateComponents
{
template<typename T>
class CylindricalCoordin... |
#include<iostream>
#include<queue>
#include<string.h>
#include<vector>
#define MAX 51
using namespace std;
int d[MAX][MAX];
bool visit[MAX][MAX];
typedef struct {
int x;
int y;
}Point;
vector<Point> list;
int w, h;
int xy[8][2] = { {-1, 0}, { 1, 0 }, { 0, -1 }, { 0, 1 }
,{ -1, -1 } ,{ 1, 1 },{ -1, ... |
#include "pch.h"
#include "Color.h"
using namespace GameEngine;
Color::Color(float r, float g, float b, float a)
{
R = r;
G = g;
B = b;
A = a;
}
uint32_t Color::ToUInt32() const
{
uint32_t r = (uint32_t)(R * 255.0f);
uint32_t g = (uint32_t)(G * 255.0f);
uint32_t b = (uint32_t)(B * 255.0f);
uint32_t a = (uint32... |
#include "utils.h"
using namespace wheel;
int main() {
std::vector<std::string> strVec;
std::string str = "HELLO TOYOTA|HELLO TOYODA|HELLO TOYO";
std::string pattern = "|";
Utils* u = new Utils();
strVec = u->split(str, pattern);
std::cout<<"Utils::split test: "<<std::endl;
for(auto ite... |
#include <cstdio>
const int MAXN = 2000;
int main() {
int a = 0,
b = 0,
i = 0,
result[MAXN] = {0};
int len = 0;
int tmp = 0;
bool isZero = true;
// 无须腾出空格
while(scanf("%d%d", &a, &b) != EOF) {
if(b != 0) {
result[i++] = a * b;
result[i++] = b - 1;
if(b-1 != 0)
... |
#include <bits/stdc++.h>
using namespace std;
int main()
{
freopen("page.txt", "r", stdin);
int frames;
while (cin >> frames)
{
int n = 0, h;
vector<int> arr;
while (cin >> h)
{
if (h == -1)
break;
arr.push_back(h);
++n;
}
int uu = 0;
int uu2 = 0;
int house[500][500] = {0}, current[50... |
#include "RectF.h"
RectF::RectF()
{
}
RectF::RectF(float left, float top, float right, float bottom)
{
this->left = left;
this->top = top;
this->right = right;
this->bottom = bottom;
}
RectF::RectF(RectF * r)
{
if (r == NULL)
{
left = top = right = bottom = 0.0f;
}
else
... |
#include "StdAfx.h"
#include "BRenderer.h"
#include "BViewport.h"
#include "BDriver.h"
#include "BCamera.h"
#include "BRenderPass.h"
#include "BRenderingBatch.h"
#include "InputDefine.h"
#include "UWorld.h"
#include "CWindowsApplication.h"
#include "CWindowsViewport.h"
#include "RResourceManager.h"
... |
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int change(int amount, vector<int> &coins)
{
if (amount == 0)
return 1;
int ssize = coins.size();
vector<vector<int>> dp(ssize + 1, vector<int>(amount + 1, 0));
for (int i = 0; i <= ssize; i++)... |
///
/// \file expression.h
/// \brief Déclare la classe Expression
///
/// La classe Expression est abstraite
///
#ifndef EXPRESSION_H
#define EXPRESSION_H
#include "../headers/computer.h"
/*_______________ Expression ________________
Interface de toute expression existante
dans le programme. Toute expression... |
#include "pixel.h"
Pixel::Pixel (uint16_t x_, uint16_t y_, const uint16_t color_)
:x(x_), y (y_), color (color_)
{
}
void Pixel::draw () const
{
displayDriver->pixel(x,y,color);
}
void Pixel::setPosition (uint16_t x_, uint16_t y_)
{
x = x_;
y = y_;
}
|
#pragma once
#include <string>
#include <cstdio>
#include <cstring>
#include <iostream>
#include "JsonLog.h"
#include "JObject.h"
class JSONDocument {
private:
static bool is_special(char c);
static bool is_ws(char c);
static bool is_num(char* str);
public:
static JObject* parseFromFile(const st... |
/*****************************************************************
* Filename: main.cpp
*
* Author: Patrick Cook
* Start Date: 9-23-2020
*
* Description: QApplication which instantiates and displays the game
* window.
*
*****************************************************************/
#include <QApplication>
... |
#ifndef ZDDTOPDOWN_H
#define ZDDTOPDOWN_H
/// @file ZddTopDown.h
/// @brief ZddTopDown のヘッダファイル
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2005-2012 Yusuke Matsunaga
/// All rights reserved.
#include "YmLogic/Zdd.h"
#include "YmLogic/ZddMgr.h"
#include "YmNetworks/bdn.h"
BEGIN_NAMESPACE_YM
//////... |
#pragma once
#include <vector>
#include <algorithm>
#include <sstream>
namespace Poker
{
enum class Suit { suit_unknown, suit_diamonds, suit_clubs, suit_hearts, suit_spades };
enum class CardSource { source_unknown, source_from_player, source_from_board };
// ------------------------------------------------------... |
// Copyright 2020-2021 Russ 'trdwll' Treadwell <trdwll.com>. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Steam.h"
#include "SteamEnums.h"
#include "SteamStructs.h"
#include "UObject/NoExportTypes.h"
#include "SteamVideo.generated.h"
//DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnBroadcastUploadSta... |
#include "TransformCmp.h"
namespace cello
{
REGISTER_COMPONENT(TransformCmp, "transform")
TransformCmp::TransformCmp()
{
}
TransformCmp::~TransformCmp()
{
}
} |
#include <stdio.h>
#include <unistd.h>
int main() {
fork();
fork();
fork();
printf("Good Bye\n");
return 0;
} |
#pragma once
#include <string>
#include "Registry.h"
enum Type
{
Stream,
Char,
Period,
String
};
class Parser : public IRegistryEntry<Type>
{
public:
virtual const Type& getRegistryType() const = 0;
virtual std::string parse(std::string& str) = 0;
}; |
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QFileDialog>
#include <QDebug>
#include <Qfile>
#include <fstream>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_... |
#include<bits/stdc++.h>
using namespace std;
void operation(string &s,int n)
{
for(int i=0;i<=n;i++)
{
if(s[i]=='1')s[i]='0';
else s[i]='1';
}
reverse(s.begin(),s.begin()+n+1);
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
ci... |
#include "stdafx.h"
#include "LocWindow.h"
#include "zonalLocationDlg.h"
#include "LinearLocationDlg.h"
#include "PlanarLocationDlg.h"
#include "VesselLocationDlg.h"
#include "NagDlg.h"
#include "utilites/Localizator.h"
#include "utilites/serl/Archive.h"
#include "utilites/document.h"
#include "data/locationSetup.... |
#include "cybMLM.h"
#include "cybMatrixOperator.h"
CybMLM::CybMLM(int variablesNumber,float prioriProbability)
{
this->variablesNumber = variablesNumber;
this->precisionMatrix = NULL;
this->prioriProbability = prioriProbability;
this->variables = new mfList<int>;
this->mean = new float[getVariablesNumber()];
th... |
//
// Created by 邓岩 on 2019/2/28.
//
# include <iostream>
# include <string>
# include <sstream>
# include <iomanip>
# include <algorithm>
# include <vector>
# include <stdio.h>
using namespace std;
class teacher {
public:
static int uid;
double salary;
double add;
int time;
int id;
virtual v... |
#include "FoundationPch.h"
#include "Foundation/Reflect/ReflectionInfo.h"
using namespace Helium;
using namespace Helium::Reflect;
const tchar_t* ReflectionTypes::Strings[ ReflectionTypes::Count ] =
{
TXT("Type"),
TXT("Enumeration"),
TXT("Composite"),
TXT("Structure"),
TXT("Class"),
};
Reflection... |
#include "Scheduler.h"
/**********************************************************************
* Create a new Scheduler with the process interval specified by
* <loopInterval>. The specified interval is the frequency at which
* the scheduler will check to see if a callback should be executed, so
* its best if thi... |
#include "DebugWindow.h"
#include <imgui.h>
#include "DebugUIElements.h"
vkw::DebugWindow::DebugWindow(const std::string& name)
:m_Name{ name }
{
}
vkw::DebugWindow::~DebugWindow()
{
Cleanup();
}
void vkw::DebugWindow::Render() const
{
ImGui::Begin(m_Name.c_str(), nullptr, ImGuiWindowFlags_HorizontalScrollbar | I... |
#include <cstdio>
#include <iostream>
#include <queue>
using namespace std;
typedef long long ll;
struct Node {
int id, arrive, process, priority;
Node(int _id, int _arrive, int _process, int _priority) : id(_id), arrive(_arrive), process(_process), priority(_priority) {}
bool operator<(const Node& a) cons... |
#ifndef PARSERS_PARSER_HEADER
#define PARSERS_PARSER_HEADER
#include "Source/Units/SystemUnit.h"
#include "Source/Units/Unit.h"
namespace solar
{
//Loads simulated data for the simulation and optionally also saves them after the simulation finished.
class Parser : public SystemUnit
{
public:
//Loads input from ... |
#include <touchgfx/Font.hpp>
FONT_KERNING_LOCATION_FLASH_PRAGMA
KEEP extern const touchgfx::KerningNode kerning_arial_20_4bpp[] FONT_KERNING_LOCATION_FLASH_ATTRIBUTE =
{
{ 0x0041, -1 }, // (First char = [0x0041, A], Second char = [0x0020, space], Kerning dist = -1)
{ 0x004C, -1 }, // (First char = [0x004C, L... |
#ifndef TREE_MESH_PRESENTER_H
#define TREE_MESH_PRESENTER_H
#include <Data/MultiMesh.h>
#include <View/EdgeVisualizer/GL/MeshRenderer/GLTriangleList.h>
#include "TreeDataPresenter.h"
class TreeMeshPresenter : public TreeDataPresenter
{
private:
//
struct BranchPresenter
{
Mesh<vec4> *wrappedBranch;
GLTriang... |
/*
* 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... |
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
string s;
cin>>s;
if(s.length()<3){
cout<<"0\n";
continue;
}
if(s.length()==0){
cout<<"0\n";
continue;
}
int one=0,zero=0,zi=-1,oi=-1;
for(int i=0; i<s.length(); i++){
if(s[i]=='1'){
one++... |
/**
* @file numericalDiff.cpp
* @brief Numerical differentiation.
* @author Michael Kaess
* @version $Id: numericalDiff.cpp 4038 2011-02-26 04:31:00Z kaess $
*
* Copyright (C) 2009-2013 Massachusetts Institute of Technology.
* Michael Kaess, Hordur Johannsson, David Rosen,
* Nicholas Carlevaris-Bianco and John. J. Leon... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "base.h"
WINRT_WARNING_PUSH
#include "internal/Windows.Foundation.3.h"
#include "internal/Windows.Devices.Background.3.h"
#include "Windows.Devices.h"
WINRT_EXPORT namespace winrt {
... |
#ifndef OPERATEUROR_H
#define OPERATEUROR_H
#include "../headers/operateur.h"
#include "../headers/pile.h"
#include "../headers/entier.h"
#include "../headers/expressionmanager.h"
///
/// \brief Opération logique OU
///
class OperateurOR : public Operateur
{
friend class ExpressionManager;
private:
///
/... |
#ifndef _HS_SFM_SFM_UTILITY_CAMERA_ROTATED_BOUNDING_BOX_INTERSECTOR_HPP_
#define _HS_SFM_SFM_UTILITY_CAMERA_ROTATED_BOUNDING_BOX_INTERSECTOR_HPP_
#include "hs_math/geometry/plane_from_3points.hpp"
#include "hs_sfm/sfm_utility/camera_type.hpp"
#include "hs_sfm/sfm_utility/projective_functions.hpp"
namespace hs
{
nam... |
//eStack.h - stack class implemenation using linked list
#include "linkedList.h"
class eStack{
private:
linkedList list;
public:
eStack();
void push(int); //enter an element
int pop(); //return element
int getCount(); //return count of list elements
int fullStack();//return 1 if stack is full
int emptystack();... |
#ifndef ELEMENTS_ELEMENT_HEADER
#define ELEMENTS_ELEMENT_HEADER
#include <string>
#include <vector>
#include "Source/Math/Math.h"
#include "PhysicsUnits.h"
namespace solar
{
//Basic unit of simulated data - planet, star, moon...
struct Unit
{
public:
explicit Unit(const Vec3d& pos = Vec3d(), const Vec3d&vel = V... |
#include "DirectionalLight.h"
void DirectionalLight::setUniform(std::shared_ptr<Shader>& shader, int index)
{
shader->use();
shader->setUniform("directionalLights["+std::to_string(index)+"].color", properties.color);
shader->setUniform("directionalLights[" + std::to_string(index) + "].direction", properties.direc... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct cities
{
pair <ll,ll> coordinates;
bool visited;
double price;
};
double distance(cities c1, cities c2)
{
double dist = sqrt(pow((c1.coordinates.first - c2.coordinates.first), 2) + pow((c1.coordinates.second - c2.... |
/**
* \file VectorToc.hpp
*
* \brief To describe the content with conversion specific informations of a type.
*
*
* \todo use hashes instead of strings to describe the place in a type.
*/
#ifndef TYPETOVECTOR_VECTORTOC_HPP
#define TYPETOVECTOR_VECTORTOC_HPP
#include <string>
#include <vector>
#include <boost/... |
// Given two binary trees with head reference as T and S having at most N nodes. The task is to check if S is present as subtree in T.
// A subtree of a tree T1 is a tree T2 consisting of a node in T1 and all of its descendants in T1.
// bool isIdentical(Node* T,Node* S)
{
if(T==NULL && S==NULL)
{
retur... |
#include "std_lib_facilities.h"
#include "Image.h"
#include "ImageFilter.h"
#include "ComplementImageFilter.h"
#include <numeric>
ComplementImageFilter::T ComplementImageFilter::getMaxIntensity() {
//compute the max intensity value of the image (function of std)
T maxValue = *max_element(getInput().begi... |
#if (defined HAS_VTK && defined HAS_CONTRIB)
#include <irtkImage.h>
#include <irtkTransformation.h>
// Minimum norm of an eigenvector
#define MIN_NORM 0.01
#include <vtkStructuredGrid.h>
#include <vtkStructuredGridReader.h>
#include <vtkStructuredGridWriter.h>
#include <vtkUnstructuredGrid.h>
#include <vtkUnstructur... |
#include "imath.h"
#include <cassert>
#include <algorithm>
Vec2::Vec2(float x, float y)
: x(x),
y(y)
{}
void Vec2::set(float x, float y) {
x = x;
y = y;
}
Vec2 Vec2::operator-() const {
return Vec2(-x, -y);
}
Vec2 Vec2::operator*(float s) const {
return Vec2(x * s, y * s);
}
Vec2 Vec2::operator/(flo... |
#ifndef QMLTOAST_H
#define QMLTOAST_H
#include <QObject>
class QmlToast : public QObject
{
Q_OBJECT
public:
enum Duration {
Short = 0x00000000,
Long = 0x00000001
};
Q_ENUM(Duration)
explicit QmlToast(QObject *parent = nullptr);
public slots:
void toast(const QString &text, Duration duration = Short);
};
... |
// Filename: dnaSignBaseline.h
// Created by: skyler (2001-30-01)
//
////////////////////////////////////////////////////////////////////
#ifndef DNASignBaseline_H
#define DNASignBaseline_H
//
#include "dnaNode.h"
#include "dnaBuildings.h"
#include "textFont.h"
#include "pandaNode.h"
#include "nodePath.h"
#include "... |
#include <bitset>
#include <iostream>
int main(int argc, char *argv[])
{
enum Color{red, yellow, green,blue, white, black ,numColors};
std::bitset<numColors> usedColors;
usedColors.set(red);
usedColors.set(blue);
std::cout << "bitfield of used colors: " << usedColors << std::endl;
std::cout... |
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <set>
#include <cmath>
#include <list>
#include <unordered_map>
#include <unordered_set>
#include <cstring>
#include <climits>
#include <queue>
#include <assert.h>
using namespace std;
int R,C;
int h,v;
int color;
int ... |
#include "Student.h"
Student::Student() {
this->id = 0;
this->name = "";
this->school = "";
this->score = 0;
}
void Student::showInfo() {
cout << "학번 : " << this->id << endl;
cout << "이름 : " << this->name << endl;
cout << "출신학교 : " << this->school << endl;
cout << "점수 : " << this->score... |
//
// Created by zanbo on 2020/5/2.
//
class Solution {
public:
bool isSameTree(TreeNode* p, TreeNode* q) {
if( (p==NULL && q!=NULL) || (p!=NULL && q==NULL)) return false;
if(p==NULL && q==NULL) return true;
if(p->val != q->val) return false;
return isSameTree(p->left,q->left) && is... |
/*
* SomaInt.cpp
*
* Created on: 10 de fev de 2018
* Author: kryptonian
*/
#include <iostream>
using namespace std;
int main() {
int x = 10;
int y = 25;
int z = x + y;
cout << endl;
cout << x << " + " << y << " = " << z;
}
|
#pragma once
#include <QThread>
#include "MyFFmpeg.h"
#include <list>
using namespace std;
class PlayThread : public QThread
{
Q_OBJECT
public:
// static PlayThread* GetObj()
// {
// static PlayThread pt(MyFFmpeg::GetObj());
// return &pt;
// }
~PlayThread();
PlayThread(MyFFmpeg *... |
/***********************************************************************
created: Fri Jun 06 2014
author: Timotei Dolean <timotei21@gmail.com>
*************************************************************************/
/***************************************************************************
* Copyr... |
#ifndef MATRIXGRAPH_H
#define MATRIXGRAPH_H
#include "Graph.h"
#include "Exception.h"
#include "DynamicArray.h"
namespace DTLib
{
template <int N, typename V, typename E>
class MatrixGraph : public Graph<V, E>
{
protected:
V* m_vertexes[N];
E* m_edges[N][N];
int m_eCount;
public:
... |
/* Copyright (C) 2014 Digipen Institute of Technology */
#include "HMC5883L.h"
#define X_SF 1.09195f
#define Y_SF 1
#define X_OFF -7.097f
#define Y_OFF -30.5f
void HMC5883L::SetupHMC5883LDevice()
{
I2CObject->frequency(Standard);
//setup continuous mode
int buffer[1];
buffer[0] = HMC5883_L_75HZ_NORMAL;
Writ... |
#ifndef QEMPLOYEELISTFORCALC_H
#define QEMPLOYEELISTFORCALC_H
#include <QWidget>
#include <QVBoxLayout>
#include <QPushButton>
#include <vector>
#include <utility>
#include "qemployeeforcalc.h"
#include "../../model/headers/worker.h"
#include "../../model/headers/container.h"
class QEmployeeListForCalc : public QWidg... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.Devices.Perception.Provider.1.h"
#include "Windows.Foundation.1.h"
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::Foundation::Collections {
#ifndef WINRT_GENERIC_e2... |
#ifndef __DISPLAY__AUTHOR__HPP
#define __DISPLAY__AUTHOR__HPP
#include "display.hpp"
#include <iostream>
#include <string>
using namespace std;
class Display_Author : public Display {
private:
string author;
public:
Display_Author(const string& author) : author(author) {}
void display(vector<Book*> books,ostream& ... |
#include<iostream>
using namespace std;
int main() {
double a, b;
a = 4.2;
b = 5.1;
a = a + b;
cout << fixed;
cout.precision(6);
cout << a;
//이러면 소수점 4번째 자리까지 나옴
//소수점 바꾸고 싶으면
/* cout << fixed
cout.precision(4) */
//이런식으로 써야함
}
|
//
// Copyright Jason Rice 2017
// 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)
//
#ifndef NBDL_WEB_NAV_ROUTE_HPP
#define NBDL_WEB_NAV_ROUTE_HPP
#include <nbdl/fwd/webui/nav_route.hpp>
#include <nbdl/message.hpp... |
/*************************************************************
* > File Name : CF1247A.cpp
* > Author : Tony
* > Created Time : 2019/10/26 19:15:54
* > Algorithm : +
**************************************************************/
#include <bits/stdc++.h>
using namespace std;
inline... |
#include "freeglut.h"
//#include "glut.h"
#include <stdio.h>
#include <math.h>
// Inicijalizacija funkcije
void drawRect(GLfloat, GLfloat, int, int, float, float, float);
void update();
// Dimenzije prozora
const int Width = 1000;
const int Height = 500;
// Dimenzije bloka
#define paddleHeight 10
#define paddleWidth... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::UI {
struct Color;
}
namespace Windows::UI {
using Color = ABI::Windows::UI::Color;
}
namespace ABI::Windows::UI {
struct IColorH... |
/*
Copyright (c) 2013-2014 Sam Hardeman
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, publish, dist... |
#pragma once
#include <algorithm>
#include <map>
#include <memory>
#include <set>
#include <sstream>
#include <stdexcept>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>
#include "drake/common/drake_assert.h"
#include "drake/common/drake_copyable.h"
#include "drake/common/drake_throw.h... |
#pragma once
#include <cmath>
namespace FastBVH {
//! \brief A type-generic 3 dimensional vector.
//! Used for the representation of bounding volumes
//! as well as the representation of rays and intersections.
//! \tparam Float The type used for the vector components.
template <typename Float>
struct alignas(sizeof... |
#pragma once
#ifndef WOTPP_INTRINSICS
#define WOTPP_INTRINSICS
#include <string>
#include <vector>
#include <structures/environment.hpp>
namespace wpp {
std::string intrinsic_log (wpp::node_t, wpp::node_t, wpp::Env&, wpp::FnEnv* = nullptr);
std::string intrinsic_error (wpp::node_t, wpp::node_t, w... |
#include<iostream>
#include<string>
using namespace std;
template <class T>
class AutoPtr
{
public:
//构造函数
AutoPtr(T* ptr = NULL)
:_ptr(ptr)
{}
//拷贝构造
AutoPtr(AutoPtr<T>& ap)
{
//管理权转移
_ptr = ap._ptr;
ap._ptr = NULL;
}
//赋值运算符重载
Au... |
/*-----------------------------------------------------------------------
Matt Marchant 2015 - 2016
http://trederia.blogspot.com
Robomower - Zlib license.
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 thi... |
#ifndef __DUI_APP_H__
#define __DUI_APP_H__
#include "DUILib.h"
DUI_BGN_NAMESPCE
class DUILIB_API CDUIApp: public IDUIApp
{
public:
CDUIApp();
~CDUIApp();
virtual BOOL Init(const CDUIString& strEntryXML);
virtual void Term();
virtual IDUISkinMgr* GetSkinMgr() const;
virtual IDUIControlFactory* GetControlFa... |
class Codec {
public:
string serialize(Node* root) {
if (!root) return "#"; // NOTE, "#"
queue<Node*> q {{root}};
string res = "";
while (!q.empty()) {
auto t = q.front(); q.pop();
// NOTE, children size to seperate nodes
res += to_string(t->val) + " " + to_string(t->children.size()) + " ";
for (auto & a ... |
#include <bits/stdc++.h>
using namespace std;
int dist(int a,int b, int c, int d){
int y;
y = abs(c-a) + abs(d-b);
return y;
}
int man(int a, int b, int c, int d){
int y;
y = pow(abs(c-a),2) + pow(abs(d-b),2);
return y;
}
FILE* inf;
FILE* outf;
int row,col,prow,pcol,frow,fcol,que;
int main(){
inf = fopen("pr... |
#include "graphics\Singularity.Graphics.h"
namespace Singularity
{
namespace Graphics
{
class Texture2D
{
protected:
#pragma region Variables
ID3D10Device* m_pDevice;
ID3D10Texture2D* m_pTexture;
ID3D10ShaderResourceView* m_pShaderResView;
D3D10_TEXTURE2D_DESC m_kDescrip... |
#pragma once
#include <basetsd.h>
#include <string>
#include <rapidxml/rapidxml.hpp>
#include <dxgi1_2.h>
namespace GraphicsEngine
{
class SettingsManager
{
public:
static SettingsManager Build(const std::wstring& filename);
uint32_t GetAdapterIndex() const;
const std::wstring& GetAdapterDescription() cons... |
// This file has been generated by Py++.
#ifndef StateIterator_hpp__pyplusplus_wrapper
#define StateIterator_hpp__pyplusplus_wrapper
void register_StateIterator_class();
#endif//StateIterator_hpp__pyplusplus_wrapper
|
#include <cmath>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <set>
#include <stack>
#include <sstream>
#include <string>
using namespace std;
struct TreeNode
{
int val;
TreeNode* left;
Tr... |
#include <bits/stdc++.h>
using namespace std;
int main(){
int N;
bool cc = false;
while(cin >> N,N)
{
if(cc) cout << endl;
cc = true;
string ids[1001];
vector<int> ages;
while(N--)
{
string nome;
int idade;
cin >> n... |
#include "thunderbolt.h"
thunderbolt::thunderbolt(int x, int y)
{
image.load("thunderbolt.png");
rect = image.rect();
rect.translate(x, y);
hit = false;
std::cout << "wtf" << std::endl;
}
thunderbolt::~thunderbolt() {
std::cout << "thunderbolt deleted" << std::endl;
}
void thunderbol... |
#include <ros/ros.h>
#include <std_msgs/String.h>
#include <math.h>
#include <time.h>
#include "boost/date_time/posix_time/posix_time.hpp"
//Librerias propias usadas
#include "constantes.hpp"
#include "camina10/v_repConst.h"
#include "../../Convexhull/vector3d.hpp"
#include "../../Convexhull/convexhull.cpp"
#include ".... |
#ifndef _WEBCREATOR
#define _WEBCREATOR
#include "Style.hpp"
#include "Element.hpp"
#include <vector>
using namespace std;
class WebCreator
{
private:
vector<Style> m_styleList;
vector<IElement*> m_elementList;
string m_title;
void ReadStyle(const string& stylePage);
void ReadPage(const string& pagePath);
void... |
/*====================================================================*
- Copyright (C) 2001 Leptonica. 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 c... |
/*
* File: main.cpp
* Author: azizm
*
*
*/
//Time Complexity O(n^2)
#include <iostream>
using namespace std;
#include <bits/stdc++.h>
void Q2()
{
int maxlen = 5;
cout<<"Length of rod = ";cin>>maxlen;
int length[maxlen];
int rate[maxlen];
for(int i =0;i<maxlen;i++)
length[i]=i+1;
co... |
#include<stdio.h>
#include "statemachine.h"
#include "clusterip.h"
#include "params.h"
HA_STATES CActiveWithStandbyNoLink::Handler( HA_EVENTS p_event )
{
HA_STATES next_state = ACTIVE_WITH_STANDBY_NOLINK;
CStateMachine *cSM = CStateMachine::GetInstance();
CParams cp;
HA_EVENTS hb_event = HB_A_L;
cp = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.