text stringlengths 8 6.88M |
|---|
//
// Created by manout on 18-4-5.
//
#include <iostream>
using namespace std;
static int fact(int num)
{
int ans = 1;
for (int i = 2; i <= num; ++i)
ans *= i;
return ans;
}
static int C(int m, int n)
{
return fact(n) / (fact(n - m) * fact(m));
}
static int common(int a, int b)
{
if (b ... |
//////////////////////////////////////////////////////////////////////
///Copyright (C) 2011-2012 Benjamin Quach
//
//This file is part of the "Lost Horizons" video game demo
//
//"Lost Horizons" is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published ... |
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "loginwidget.h"
#include "mainwidget.h"
/*
namespace Ui {
class MainWindow;
}*/
class LoginWindow : public QMainWindow
{
Q_OBJECT
public:
explicit LoginWindow(QWidget *parent = 0);
~LoginWindow();
LoginWidget *widget_login;
... |
#ifndef AOC_9_H
#define AOC_9_H
#include <vector>
#include "Classes/IntCodeCPU/IntCodeCPU.h"
namespace AoC_9 {
long long AB(std::vector<long long> program, long long input) {
IntCodeCPU computer(program);
computer.Input(input);
computer.RunToEnd();
return computer.Output();
}
... |
#ifndef STRIN_TO_CHAR_ARRAY_HPP
#define STRIN_TO_CHAR_ARRAY_HPP
#include <memory>
#include <string>
namespace String
{
std::unique_ptr<char[]> toCharArray(std::string str)
{
std::unique_ptr<char[]> chArr(new char[str.length()]);;
strcpy(chArr.get(), str.c_str());
return chArr;
}
... |
#include<bits/stdc++.h>
using namespace std;
struct point{
int x,y;
};
point p[200000];
double ans=0;
int n;
void readit(){
scanf("%d",&n);
for (int i=1;i<=n;i++)
scanf("%d%d",&p[i].x,&p[i].y);
}
void writeit(){
printf("%.1lf\n",ans);
}
bool cmp(point a,point b){
return a.x<b.x||a.x==b.x&&a.y<b.... |
#ifndef PGSACONFIG_H_INCLUDED
#define PGSACONFIG_H_INCLUDED
#include <climits>
using namespace std;
typedef long long int int_max;
typedef unsigned long long int uint_max;
namespace PgSAReadsSet {
typedef unsigned char uint_read_len_min;
typedef unsigned short uint_read_len_std;
typedef uint_read_len_s... |
#pragma once
#include <boost/range/adaptor/reversed.hpp>
#include "applications/heat_equation.hpp"
#include "datastructures/double_tree_view.hpp"
#include "spacetime/linear_form.hpp"
namespace applications {
namespace ErrorEstimator {
using datastructures::DoubleTreeVector;
using space::HierarchicalBasisFn;
using spa... |
#include "GnGamePCH.h"
#include "GAbilityListCtrlItem.h"
GnImplementRTTI(GAbilityListCtrlItem, GStateListCtrlItem);
GAbilityListCtrlItem::GAbilityListCtrlItem(const gchar* pcDefaultImage, const gchar* pcClickImage
, const gchar* pcDisableImage, eButtonType eDefaultType) : GStateListCtrlItem( pcDefaultImage... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 2008 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
/** \file
*
* \brief Declare an OpTracer object to be used for obje... |
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
//structure
typedef struct { char cin[12];
char nom[100];
char prenom[100];
float montant;
} clients;
//declaration d'un tableau de clients
clients comptebancaire[50];
//declaration des entiers globales.
int nombredecomptes=0;
int... |
/*
Name:
Copyright:
Author: Hill Bamboo
Date: 2019/9/10 16:44:03
Description:
*/
#include <bits/stdc++.h>
using namespace std;
const int maxn = 100;
int arr[maxn] = {1, 3, 4, 4, 4, 5, 7, 9, 14};
int n = 9;
bool check() {
return false;
}
int b1(int lo, int hi, int t) { // min
while (lo < hi) {
int mid = (lo + h... |
#include <iostream>
#include <vector>
using namespace std;
class MaxHeap
{
public:
vector<int> arr;
int N = 0;
private:
void exch(int i,int j)
{
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
void swim(int k)
{
while(k > 1 && arr[k/2] < arr[k])
... |
#include "gm_mgr_class.hpp"
#include "log.hpp"
#include "scene/scened.hpp"
#include "scene/recharge.hpp"
#include "scene/db_log.hpp"
#include "utils/service_thread.hpp"
#include "utils/exception.hpp"
#include "utils/game_def.hpp"
#include "config/serverlist_ptts.hpp"
#include "scene/player/player_mgr.hpp"
#include "pro... |
int foo();
int bar();
int main()
{
if (foo() != bar()) {
return 1;
}
return 0;
}
|
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
#define eps 1e-8
#define pi acos(-1.0)
using namespace std;
typedef long long L... |
#include "Technician.h"
#include "SaleManager.h"
#include <typeinfo>
int main()
{
//Technician tech1;
//tech1.calcSalary();
//tech1.promote();
//tech1.disInfo();
//cout << "------------------" << endl;
//Manager man;
//
//man.calcSalary();
//man.promote();
//man.disInfo();
//cout << "------------------"... |
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Portions of this file are from JUCE.
Copyright (c) 2013 - Raw Material Software Ltd.
Please visi... |
#include <iostream>
#include <utility> // std::swap
#include <math.h>
using namespace std;
typedef long long ll;
#include <string>
#include <stdio.h>
#include <iostream>
#include <vector>
#define max_num 1000
int main() {
string S="CABCBBABC";
int n=S.size();
string ans;
ans=S[0];
char tmp=a... |
#include<string>
#include<iostream>
#include<fstream>
#include"Factory.h"
#include"BankInterface.h"
using namespace std;
bool convertStringToBool(string myBool)
{
if (myBool == "true")
return true;
if (myBool == "false")
return false;
}
bool testAddingCorrectly(BankInterface*& bank, int expectedI... |
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <memory.h>
#include <cmath>
#include <string>
#include <cstring>
#include <queue>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <functional>
#inc... |
/*********************************************************\
* 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 "XVideoThread.h"
#include "XDecode.h"
extern "C"
{
#include "libavcodec/avcodec.h"
}
XVideoThread::XVideoThread()
{
}
XVideoThread::~XVideoThread()
{
}
bool XVideoThread::Repaint(AVPacket* pkt, long long seekpts)
{
vmux.lock();
bool re = decode->SendPkt(pkt);
if (!re)
{
vmux.unlock();
return false;... |
#pragma once
#include "components/component.hpp"
#include "point.hpp"
#include <vector>
struct Furniture;
namespace item {
struct ItemProperties;
}
struct Room : ecs::ComponentCRTP<ecs::Component::Room, Room> {
Room(const Rect& r);
virtual void on_add() override;
virtual void on_remove() override;
b... |
#include "binaryTree.hpp"
BinaryTree::BinaryTree() : m_root(nullptr) { }
BinaryTree::BinaryTree(const BinaryTree& object) {
m_root = copyNode(object.m_root);
}
BinaryTree::~BinaryTree() {
clear(m_root);
}
BinaryTree::Node* BinaryTree::copyNode(const Node* object) {
if (nullptr == object) ... |
/*
* License does not expire.
* Can be distributed in infinitely projects
* Can be distributed and / or packaged as a code or binary product (sublicensed)
*
* Commercial use allowed under the following conditions :
* - Crediting the Author
*
* Can modify source-code
*/
/*
* File: TerrainNode.cpp
* Auth... |
#include "stdafx.h"
#include "Engine/physics/Physics.h"
#include "RigitBody.h"
#include "PhysicsDebugDraw.h"
PhysicsWorld g_physics;
PhysicsWorld::PhysicsWorld() {
}
PhysicsWorld::~PhysicsWorld()
{
Release();
}
void PhysicsWorld::Release()
{
delete dynamicWorld;
delete constraintSolver;
delete overlappingPairCa... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2000 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef _DOC_TREE_H_
#define _DOC_TREE_H_
class DocTree
{
privat... |
#include <iostream>
#include<cstring>
using namespace std;
int main()
{
int Len,max(0),lo1,lo2,k(0),tmp(0);
char ch[81];
cin>>ch;
Len=strlen(ch);
for(int i=0;i<Len;i++)
for(int j=i+1;j<Len;j++)
if(ch[i]==ch[j])
{for(k=i;k<=(i+j)/2;k++)
... |
#include "ShapesBlocks.h"
void SqrBaseRectBlocks:: printVectorCube(){
for(int i=0; i<w.size(); i++)
{
if(w[i] == l[i]){
cout << w[i] <<" "<<h[i]<<" "<<l[i]<<endl;
}
}
}
|
#include "f3lib/io/O3dReader.h"
#include "f3lib/utils/BinaryFileReader.h"
#include "f3lib/utils/ReadHelper.h"
#include <assert.h>
using namespace f3::types;
bool readTMAnimation(f3::utils::BinaryFileReader& file, f3::Object3D* o3d, f3::GeometryModel* pObject)
{
int bFrame = 0;
bFrame = file.readInt32();... |
#include <iostream>
#include <cctype>
void convertirMayusculas(char *);
void imprimirCaracteres(const char *);
int main(){
char frase[] = "caracteres y $34.51";
std::cout<< "La frase antes de la conversi[on es :"<< frase<<std::endl;
convertirMayusculas(frase);
std::cout<< "\nLa frase despues de ... |
#pragma once
#include <string>
int DigestString(char* szSrc1, char* szSrc2, std::string& outMigdest); |
/*
Nome: Atm Da Caixa Economica v3.0
Autor : Casperento
Nao se esqueça de deixar os creditos caso voce queira usar em seu servidor !
*/
class cxp_atm_menu {
idd = 2700;
name= "cxp_atm_menu";
movingEnable = 0;
enableSimulation = 1;
class controlsBackground {
class MainBackgro... |
#include "StdAfx.h"
#include "GcEditorTextureListBox.h"
void GcEditorTextureListBox::OnBrowse()
{
if( mEnableAddItem == false )
return;
int nSel = GetSelItem();
CFileDialog dlg(true, _T("IMG"), NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_NOCHANGEDIR,
gsTextureFileFilter, GetParent() );
if( dlg.DoModal... |
#ifndef CATEGORY
#define CATEGORY
namespace Category
{
enum Type
{
None = 0,
Flower = 1 << 0,
Snake = 1 << 1,
};
}
#endif // CATEGORY
|
#pragma once
namespace ServerEngine
{
class IModuleInterface
{
public:
virtual void StartModule() = 0;
virtual void ShutdownModule() = 0;
};
typedef shared_ptr<IModuleInterface> IModuleInterfacePtr;
}
|
#include "GApp.h"
void GApp::onRender(void)
{
Surface::draw(surfGrid, display, 0, 0);
for (int i = 0; i < 9; ++i)
{
int x = (i % 3) * 200;
int y = (i / 3) * 200;
if (gameBoard.getCell(i) == TicTacToe::GRID_X) {
Surface::draw(surfX, display, x, y);
}
els... |
// Matrix Construct
//
// Copyright (C) Matrix Construct Developers, Authors & Contributors
// Copyright (C) 2016-2018 Jason Volk <jason@zemos.net>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice... |
#pragma once
#include<vector>
#include"tinyxml.h"
#include"tinystr.h"
#include<atlstr.h>
#include<string>
#include<io.h>
using namespace std;
class XMLSrv{
public:
void createXml(const char * ccXmlName ,vector<string> clounms);
void readXml(const char * ccXmlName);
string dumpNode(TiXmlNode * pNode,int flag);
voi... |
#pragma once
namespace OCScript
{
// イベントハンドラを表します。
class IEventHandler
{
public:
virtual ~IEventHandler() {}
// 実行対象のメソッドを表します。
virtual void Target() = 0;
};
}
|
#pragma once
#include "..//ACTEffect.h"
#include "IAct.h"
class Monster;
class CAct_Beam : public IAct
{
public:
~CAct_Beam();
void Fire(
Monster* me,
Monster* target,
const wchar_t* beamEffectPath,
const wchar_t* soundPath,
float range,
float baseDamage,
float cost,
CVector3 effectScale = { 3.5,3.... |
#include "mersennetwister.h"
#include <math.h>
using namespace std;
MTRand::MTRand(const uint32_t & oneSeed )
{
seed(oneSeed);
}
MTRand::MTRand(uint32_t *const bigSeed, const uint32_t seedLength )
{
seed(bigSeed,seedLength);
}
MTRand::MTRand()
{
seed();
}
double MTRand::rand()
{
return double(ran... |
#include<opencv2/opencv.hpp>
using namespace std;
using namespace cv;
extern Mat extractedRect;
int RectSegmentation(const Mat& imgIn, Mat&);
int PreOperation(const Mat& imgIn);
int InContours(Mat& imgIn, Mat&);
int largestSquare(const vector<vector<Point>>& squares, vector<Point>& largest_square);
int rectExtract(vec... |
#include "vm/stack.hpp"
#include "vm/exceptions.hpp"
#include "vm/processor.hpp"
#include <boost/test/unit_test.hpp>
#include <array>
#include <utility>
// Testing the stack
BOOST_AUTO_TEST_SUITE( vm )
BOOST_AUTO_TEST_SUITE( stack )
BOOST_AUTO_TEST_CASE( push_pop_test )
{
BOOST_TEST_MESSAGE( "pushing and popping... |
#include<iostream>
class Vect {
private:
int* arr;
int size;
public:
int getSize() {
return size;
}
int getElement(int i){
return *(arr + i);
}
void setElement(int i, int num){
arr[i] = num;
}
Vect () { //defolut constructor
arr = new int;
*arr = 0;
si... |
#include <bits/stdc++.h>
using namespace std;
#define debug(x) cout << '>' << #x << ':' << x << endl;
#define all(v) v.begin(), v.end()
#define pii pair<int, int>
#define mxN 1e7
#define newl cout<<"\n"
#define vi vector<int>
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x),... |
#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
#include <algorithm>
using namespace std;
string test(string b);
int main()
{
string a;
cin>>a;
cout<<test(a);
return 0;
}
string test(string b)
{
if(b=="hello")return "world";
else return "nope";
}
|
#include <QDir>
#include "filehandle.h"
bool FileHandle::verifyPath(QString path)
{
bool ret = true;
QString curr = QDir::currentPath();
QDir::setCurrent(getDirUserHome().path());
if (!verifyFile(path) && !verifyDir(path))
ret = false;
if (!ret) {
QDir::setCurrent(getPublicUserHome().path() + "file");
... |
#include <iostream>
#include <string>
#include "tablero.h"
#include "casillero.h"
#include "mensajes.h"
#define MAXJUGADAS 100
using namespace std;
int main(int argc, char ** argv){
Tablero * tablero = inicializarTablero();
int posicionX, posicionY, posicionInicialX, posicionInicialY, cantidadJugadas... |
#include <stdio.h>
#include <conio.h>
main()
{
int n,z,i,j,temp;
char a[12];
printf("Enter the no of inputs:");
scanf("%d", &n);
for(i=0;i<n;i++)
{
printf("enter a number or letter: ");
scanf("%s",&a[i]);
}
int T;
printf("input T value:1,2,3 or 4? T=\n");
scanf("%d",&T);
p... |
// -*- 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.
*
* @file RichTextEditorListener.h
* @author Owner: Alexander R... |
/*
* 题目:1734. 解码异或后的排列
* 链接:https://leetcode-cn.com/problems/decode-xored-permutation/
* 知识点:找规律、异或的性质
*/
class Solution {
public:
vector<int> decode(vector<int>& encoded) {
int n = encoded.size() + 1;
// 计算所有元素的异或和
int all = 1;
for (int i = 2; i <= n; i++) {
all ^= i... |
/*
** EPITECH PROJECT, 2019
** tek3
** File description:
** TcpSocket
*/
#include "TcpSocket.hpp"
#include "Core.hpp"
#include <iostream>
babel::network::TcpSocket::TcpSocket(std::string target_ip, int target_port, bool isSocketServer, babel::Core *parent):
QObject(parent)
{
_socket = new QTcpSocket(this);
... |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define showmap(is, js, x) {rep(i, is){rep(j, js){cout << x[i][j] << " ";}cout << endl;}}
#define show(x) {for(auto i: x){cout << i << " ";} cout... |
#include <iostream>
#include <string>
#include <string.h>
using namespace std;
#ifndef HASH_H_INCLUDED
#define HASH_H_INCLUDED
class hash1
{
private:
static const int tailleTableau = 10;
struct item
{
string nom;
string tel;
item *next;
};
item *HashTable[tailleTableau];
... |
#include <iostream>
#include <forward_list>
using namespace std;
/*
* Runs in O(n) time, but also takes O(n)
* This could pretty easily be converted into a loop to saved on space
*
* Assumes list1 and list2 are same length
*
*/
int sum_reverse(
forward_list<int>::const_iterator current1,
const ... |
#include "lagunita.hpp"
void Lagunita::init() {
// initialize the random seed with noise
srand(arduboy.generateRandomSeed());
// initiate arduboy instance
arduboy.begin();
// set the framerate to 32 FPS
arduboy.setFrameRate(32);
// start the music
arduboy.audio.begin();
}
void Lagunita::loop() {
... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
/**
* Stack setup
*/
// top of stack
extern unsigned __stacktop;
// put top of stack into ".stack" section
__attribute__((section(".stack"), used)) unsigned *__stack_init = &__stacktop;
|
/* -*- 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.
*/
/** \file
* This file declares the WindowsAUFileUtils interface ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** Copyright (C) 2000-2008 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser.
** It may not be distributed under any circumstances.
**
** Yngve Pettersen
*/
#include "core/pc... |
// Copyright (c) 2011-2017 The Cryptonote developers
// Copyright (c) 2018, The TurtleCoin Developers
// Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs
// Copyright (c) 2018-2023 Conceal Network & Conceal Devs
//
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or ht... |
#include "FUNCTION.h"
int main (){
try
{
cout << "Print 'help' for learn what you can use!" << endl;
calculate();
keep_window_open();
return 0;
}
catch (const exception& e)
{
cerr << "Exception: " << e.what() << endl;
return 1;
}
catch (...)
... |
/*
This file is part of the VRender library.
Copyright (C) 2005 Cyril Soler (Cyril.Soler@imag.fr)
Version 1.0.0, released on June 27, 2005.
http://artis.imag.fr/Members/Cyril.Soler/VRender
VRender is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as pub... |
/*
* the implementation of the Class Stack
*/
#include "stack.h"
#include <iostream>
Stack::Stack()
{
InitStack();
}
Stack::~Stack()
{
DestoryStack();
}
bool Stack::ClearStack()
{
S.top = S.base;
return OK;
}
bool Stack::StackEmpty()
{
if(S.base == S.top)
return OK;
else
return ERROR;
}
int Stack::S... |
// Enlarge_DLG.cpp : 实现文件
//
#include "stdafx.h"
#include "MFC综合实验.h"
#include "Enlarge_DLG.h"
#include "afxdialogex.h"
// Enlarge_DLG 对话框
IMPLEMENT_DYNAMIC(Enlarge_DLG, CDialogEx)
Enlarge_DLG::Enlarge_DLG(CWnd* pParent /*=NULL*/)
: CDialogEx(IDD_DIALOG1, pParent)
{
}
Enlarge_DLG::~Enlarge_DLG()
{
}
void Enlar... |
#include "XPlayer.h"
#include <QFileDialog>
#include "XDemuxThread.h"
#include <QMessageBox>
static XDemuxThread demux;
XPlayer::XPlayer(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
demux.Start();
startTimer(40);
}
XPlayer::~XPlayer()
{
demux.Stop();
}
void XPlayer::timerEvent(QTimerEvent *e)
{... |
#include <string>
#include "Can.h"
#include <iostream>
using namespace std;
Can::Can() {
type = 'X';
volume = 'X';
}
Can::Can(std::string type,int volume){
this->volume = volume;
this->type = type;
}
void Can::setCan(std::string type,int volume) {
this->volume = volume;
this->type = type;
}
int Can::ge... |
#include<iostream>
#include<string>
#include<string.h>
#include<dirent.h>
#include<vector>
using namespace std;
class mp3file{
private:
string f_name;
string f_path;
public:
string showFile(){
return f_name;
}
string showPath(){
return f_path;
}
mp3file(string... |
#pragma once
namespace aeEngineSDK
{
enum struct AE_ENGINE_RESOURCE_ID : uint32
{
AE_ENGINE_RESOURCE_TEXTURE_2D,
AE_ENGINE_RESOURCE_MATERIAL,
AE_ENGINE_RESOURCE_MODEL
};
class AE_ENGINE_EXPORT aeEngineResource
{
public:
aeEngineResource() {}
aeEngineResource(const aeEngineResource& Resource) { *this =... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2005-2007 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Peter Karlsson
*/
#if !defined ENCODINGS_MODULE_H
#define ENC... |
class Solution {
public:
string customSortString(string S, string T) {
int N = S.size(), M = T.size();
int letterCount[26] = {};
// count characters in T
for(int i=0;i<M;i++)
letterCount[T[i] - 'a']++;
string res = "";
// put characters exist in both S, ... |
#pragma once
#include "RepoFile.h"
class TestRepositoryFile
{
private:
RepositoryFile<Car> repo;
public:
TestRepositoryFile();
void testLoadFromFile();
void testAddElem();
void testFindElem();
void testDelElem();
void testGetAll();
void testUpdateElem();
void testElemAtPos();
void testSize();
... |
#pragma once
#include "m2_model.h"
#include "elfbase.h"
#include "elf_string_table.h"
#include "elf_section_description.h"
#include <map>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
namespace elf {
#pragma pack(push)
#pragma pack(1)
template <typename T>
struct elf_header_middle_common... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
using namespace std;
typedef long long ll;
#define INF 10e10
#define rep(i,n) for(int i=0; i<n; i++)
#define r... |
// Copyright (c) 2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special ... |
#include <stdio.h>
using namespace std;
int main()
{
char name []="name";
char address[]="adress";
char gender[]="gender";
int married;
int age = 0;
float hight = 0;
printf("insert your name! \n");
scanf("%s",name);
printf("insert your age! \n");
scanf("%d",&age);
printf("insert your hight! \n");
scanf(... |
#pragma once
#include <vector>
#include <random>
#include <algorithm>
#include <iterator>
#include <iostream>
#include <functional>
struct DelegateRecord
{
bool embedded;
union
{
uint8_t data[20];
void* ptr;
};
void (*fptr) (void*, void*);
};
struct Delegate
{
std::vector<Dele... |
// Created on: 2014-03-17
// Created by: Kirill GAVRILOV
// Copyright (c) 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 Lesser General Public License version 2.1 as pu... |
#include<iostream>
#include<string>
#include "Test06.h"
using namespace std;
Test06::Test06()
{
cout << "Test06 constructor" << endl;
TestCnt = 0;
TestStr = NULL;
}
Test06::~Test06()
{
cout << "Test06 destructor" << endl;
if (NULL != TestStr)
{
cout << "Test06_sub TestStr memory free" << endl;
free(TestS... |
#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>
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2008 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
//Partially processed Link HTTP headers
// Source in url_pd.cpp
... |
#include "stdio.h"
#include "conio.h"
#include "string.h"
int DecToBin(int decimal){
int count;
int bin[9];
for(int i=8;i>=0;i--) {
bin[i]=(decimal%2);
decimal=(decimal/2);
}
printf("\n\nDecimal to binary is: ");
for(i=0;i<=8;i++)
printf(" %d",bin[i]);
}
void main(){
clrscr();
int deci... |
//----------------------------------------------------------------
// Buying.cpp
//
// Copyright 2005 Ritual Entertainment
//
// This file essentially serves as an extension to the Game DLL
// source files Multiplayer.cpp and Player.cpp, in an attempt
// to isolate, as much as possible, these changes from the main
// b... |
#include<iostream>
using namespace std;
int main()
{
//输入数组
int n;
cout << "请输入数组的长度:";
cin >> n;
int* lon = new int[n];
cout << "请输入一串非零数组:";
for (int i = 0; i < n; i++) {
cin >> lon[i];
}
//根据高度统计对应长度
int maxArea = 0;
for (int i = 0; i < n; i++) {
int cnt = 1;
int j = i;
while (++j < n && lon[j] ... |
#include<iostream>
using namespace std;
#include<algorithm>
long long countPairs(int x[], int y[], int n, int m)
{
long res=0;
sort(x,x+n);
sort(y,y+m); //sorting arr y
int i=0,j=0;
while(i<n){
if(j>=m){
j=0;
i++;
continue;
}
if(x[i]==1){
i+... |
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
using namespace std;
struct node
{
struct node *next;
int data;
};
void commonnodelist(int d,struct node *head1,struct node *head2);
int countnodes(struct node *head);
void printlist(struct node *head)
{
while(head!... |
#include"../head/Video.h"
using namespace cv;
using namespace std;
//void Image_TO_Video(int number_of_frame)//图片转视频
//{
// string s_image_name;
// cv::VideoWriter writer;
// int isColor = 1;//只向视频输入彩度图
// int frame_fps = 30;//帧率
// int frame_width = 660; //必须是图像真实的分辨率,这不是指定生成视频的分辨率
// int frame_height = 660;
//
... |
/*================================================================
* Copyright (C) 2018 Navin Xu. All rights reserved.
*
* 文件名称:Main.cpp
* 创 建 者:Navin Xu
* 电子邮箱:admin@navinxu.com
* 创建日期:2018年08月17日
* 描 述:C++版简易图书管理系统
================================================================*/
/**
*
* # C++版图书... |
#pragma once
#include <string>
#include "ParseType.hpp"
#include "TextFile.hpp"
class TextFileParser
{
public:
TextFileParser(TextFile& text_file);
~TextFileParser();
int ParseFile(const TextFile& text_file, const ParseType parse_type);
private:
TextFile& m_text_file;
int CountSubstringOccuren... |
#pragma once
#include "kompute/operations/OpAlgoBase.hpp"
namespace kp {
OpAlgoBase::OpAlgoBase()
{
SPDLOG_DEBUG("Kompute OpAlgoBase constructor base");
}
OpAlgoBase::OpAlgoBase(std::shared_ptr<vk::PhysicalDevice> physicalDevice,
std::shared_ptr<vk::Device> device,
... |
#pragma once
#include "Components/Component.h"
#include "Components/SpriteRenderer.h"
#include "Components/Transform.h"
#include "StateMachine/StateMachine.h"
#include "GameObjectData/GameObjectData.h"
#include "Constants.h"
/*
GameObject is the class that represents any entity on the game.
It consists in a collecti... |
#include "Figures.h"
#include <math.h>
#include <iostream>
#define PRIORITY_PAWN 1
#define PRIORITY_CASTLE 2
#define PRIORITY_BISHOP 2
#define PRIORITY_KNIGHT 3
#define PRIORITY_QUEEN 10
#define PRIORITY_KING 20
Figures::Figures(int _x, int _y, int _priority, bool _color, ChessBoard& _board, TurnsCounter& _turnsCount... |
/**
* Copyright (c) 2020, 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 <arba/evnt/event_manager.hpp>
#include <arba/evnt/event_box.hpp>
inline namespace arba
{
namespace evnt
{
event_manager::event_manager(std::size_t max_number_event_types)
: max_number_event_types_(0)
{
if (max_number_event_types)
resize(max_number_event_types);
}
event_manager::~event_manager... |
#ifndef __VIVADO_SYNTH__
#include <fstream>
using namespace std;
// Debug utility
ofstream* global_debug_handle;
#endif //__VIVADO_SYNTH__
#include "sobel_16_stage_x_unrolled_1_opt_compute_units.h"
#include "hw_classes.h"
struct img_img_update_0_write0_merged_banks_6_cache {
// RAM Box: {[-1, 30], [-1, 30]}
/... |
#include "circbutton.hpp"
#include "xmlhelper.hpp"
#include <filesystem>
#include <iostream>
#include <fstream>
enum TabMode {
MANUAL,
AUTO,
GROUPINGS,
IGNORELST
};
/* Tab functions like a button but is not actually one. The Tab class will deal
* with all the tab switching completely EXCEPT for the tab lin... |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Base
{
public:
static int getNum()
{
return sNum;
}
static int getNum(int param)
{
return sNum + param;
}
public:
static int sNum;
};
int Base::sNum = 10;
class Derived : public Base
{
pub... |
#include "vertex.h"
#include <Windows.h>
#include <GLFW/glfw3.h>
Vertex::Vertex(const glm::vec4& p, const Color& c)
:_position(p), _color(c)
{}
Vertex::Vertex(const glm::vec3& p, const Color& c)
: _position(p.x, p.y, p.z, 1.0f), _color(c)
{}
void Vertex::draw_with_color() const
{
glColor3ub(_color.get_red(), _colo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.