text stringlengths 8 6.88M |
|---|
#ifndef PCH_H
#define PCH_H
#include <iostream>
#include <stdlib.h>
#include <thread>
#include <chrono>
#include <Windows.h>
#include <String>
#include <vector>
#include "console.h"
#include "player.h"
#include "AI.h"
#include "game.h"
#include "GUI.h"
using namespace std;
#define NOMINMAX
#define WIN32_LEAN_AND_ME... |
#ifndef int_var_h
#define int_var_h
#include <chuffed/core/engine.h>
#include <chuffed/core/sat-types.h>
#include <chuffed/support/misc.h>
#include <chuffed/vars/bool-view.h>
#include <chuffed/vars/vars.h>
#include <cstdint>
#include <new>
#ifndef INT64_MAX
#define INT64_MAX 9223372036854775807LL
#endif
#ifndef INT6... |
#pragma once
#include <string>
#include <list>
class Sekcija;
using namespace std;
struct Simbol {
string ime;
Sekcija* sekcija;
int rbr;
int offset;
char lokal;
};
class SymTab {
public:
list<Simbol*> simboli;
bool exist(string name);
Simbol* get(string name);
SymTab();
~SymTab();
}; |
/*
* @lc app=leetcode.cn id=221 lang=cpp
*
* [221] 最大正方形
*/
// @lc code=start
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
int maximalSquare(vector<vector<char>>& matrix) {
int m = matrix.size();
if(m==0)return 0;
int n = matrix[... |
//------------------------------------------------------------------------------
/*
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 "BaseFont.h"
using namespace DirectX::SimpleMath;
BaseFont::BaseFont()
{
}
BaseFont::~BaseFont()
{
}
void BaseFont::Initialize(Vector2 position)
{
m_position = position;
}
void BaseFont::Update(Vector2 position )
{
//m_position = position;
}
bool BaseFont::Render(wchar_t * text)
{
return false;
}
|
#pragma once
////////////////////////////////////////////////////////////////////////////////
#include <cellogram/common.h>
#include <vector>
#include <Eigen/Dense>
////////////////////////////////////////////////////////////////////////////////
namespace cellogram {
//
// @brief { Linear interpolation of a fun... |
#pragma once
#include "SDLGameObject.h"
class NumberObject : public SDLGameObject
{
public:
NumberObject();
virtual void draw();
virtual void load( const LoaderParams* pParams );
virtual void update();
virtual void clean();
void setFrame(int framenumber) { m_currentFrame = framenumber; }
private:
};
|
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,x,i,j,k;
int sum=0;
cin>>n>>x;
int a[n];
for(i=0;i<n;i++)
cin>>a[i];
for(i=0;i<n-2;i++)
{
for(j=i+1;j<n-1;j++)
{
for(k=j+1;k<n;k++)
{
if(a[i] + a[j] + a[k] < x... |
#pragma once
#include <map>
#include <vector>
//#include <iostream>
#include "DocumentParser.h"
#include "files.h"
typedef unsigned int DocumentUID_t;
typedef unsigned_ints Frequency_t;
struct DocFreq_t {
DocumentUID_t docID;
Frequency_t frequency;
};
typedef std::unordered_map<std::string, Frequency_t> TFID_t;... |
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmConnection.h"
#include <cassert>
#include <cstring>
#include "cm_uv.h"
#include "cmServer.h"
struct write_req_t
{
uv_write_t req;
uv_buf_t buf;
};
void... |
#ifndef __WXDATETIMEPROPERTY_H
#define __WXDATETIMEPROPERTY_H
//-----------------------------------------------------------------------------
#include "_pch.h"
//using whModelFilter = wh::ModelFilter;
//WX_PG_DECLARE_VARIANT_DATA(whModelFilter)
//------------------------------------------------------------------------... |
#pragma once
#include "ofMain.h"
#include "shapeBase.h"
class sphere : public shapeBase
{
public:
float radius;
sphere();
void updateMesh(float width, float height, float depth);
void updateMaterial(int r, int g, int b);
void draw();
}; |
#include "headers/misctools.h"
bool MiscTools::openDirectory(QString directory) {
directory = getFilePrefix()+directory;
return QDesktopServices::openUrl(QUrl(directory));
}
bool MiscTools::isWindows() {
#if defined(Q_OS_WIN)
return true;
#else
return false;
#endif
}
QString MiscTools::getAppPath() {... |
#include <chuffed/branching/branching.h>
#include <chuffed/core/engine.h>
#include <chuffed/core/propagator.h>
#include <chuffed/vars/modelling.h>
#include <cassert>
#include <cstdio>
static const int length[] = {0, 0, 1, 3, 6, 11, 17, 25, 34, 44, 55, 72, 85, 106, 127};
class GolombRuler : public Problem {
public:
... |
#include "MeleeWeapon.h"
MeleeWeapon::MeleeWeapon(const float damage, const float range, const unsigned int frameSize, const sf::Vector2i offset, std::string textureFilePath)
{
this->damage = damage;
this->range = range;
this->texture.loadFromFile(textureFilePath);
sprite.setTexture(this->texture);
sprite.setTe... |
#pragma once
#if defined(_MSC_VER)
#define ACCEL_FORCEINLINE __forceinline
#define ACCEL_UNREACHABLE() __assume(0)
#define ACCEL_SSE2_AVAILABLE (_M_IX86_FP >= 2 || _M_AMD64)
#define ACCEL_AVX2_AVALIABLE __AVX2__
#elif defined(__GNUC__)
#define ACCEL_FORCEINLINE __attribute__((always_inline)) inline... |
#include "GameLand.h"
#include "publicDef/gameConfig.h"
#include "game_scene/GameScene.h"
#include "RoleCreateLayer.h"
#include "network/SaveDataManager.h"
#include "network/PuzzleRPC.h"
Scene* GameLand::scene()
{
auto scene = Scene::create();
auto layer = GameLand::create();
scene->addChild(layer);
return scene;... |
//Librerias:
#include <Timer.h>
#include <Switches.h>
//Temporizadores
TON* tVaciado;
//Entradas
Switches* sensorNivel;
Switches* pulsadorMarcha;
Switches* interruptorPrograma1;
Switches* interruptorPrograma2;
Switches* sensorFuga;
//Entradas Digitales
#define pMarcha 7
#define pPrograma1 8
#define ... |
//
// HolyHandGrenade.hpp for cpp_indie_studio in /home/lopez_i/cpp_indie_studio/HolyHandGrenade.hpp
//
// Made by Loïc Lopez
// Login <loic.lopez@epitech.eu>
//
// Started on ven. juin 16 10:35:53 2017 Loïc Lopez
// Last update Sun Jun 18 18:52:45 2017 Stanislas Deneubourg
//
#ifndef CPP_INDIE_STUDIO_HOLYHANDGRENA... |
#pragma once
#include<memory>
#include<string>
class comImpl;
class communication
{
public:
communication(std::string ipStr="183.230.40.33",unsigned portNum=80);
bool connectServer();
bool sendString(const std::string& content);
bool recvString(std::string& content);
private:
std::shared_ptr<comImpl> impl;
};
s... |
#include "Student.h"
#include <string>
#include <iostream>
/*
private:
int score;
std::string name;
public:
Student();
Student(std::string name, int score);
int getScore();
std::string getName();
char getGrade();
void print();
*/
Student::Student()
{
name = "";
score = 0;
}
S... |
class Solution {
public:
int findPeakElement(vector<int>& nums) {
int len = nums.size();
int l = 0, r = len-1;
while(l< r){
int mid = (l+r)/2;
if(nums[mid] > nums[mid+1]) r = mid;
else l = mid+1;
}
return r;
}
}; |
#include "GdiWndProc.h"
GdiWndProc::GdiWndProc(void) {}
GdiWndProc::~GdiWndProc(void) {}
LRESULT CALLBACK GdiWndProc::PartWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL* pIsReturn)
{
switch (uMsg) {
case WM_PAINT:
HDC hdc;
PAINTSTRUCT ps;
LPTSTR lptStr = TEXT("この文字列はGDIで描画しています。");
//h... |
#ifndef READER_HPP
#define READER_HPP
#include <QMainWindow>
#include <QFileDialog>
#include <QMutex>
namespace Ui {
class Reader;
}
class Reader : public QMainWindow
{
Q_OBJECT
public:
explicit Reader(QWidget *parent = 0);
~Reader();
private slots:
void on_start_clicked();
void on_open_cl... |
#include <bits/stdc++.h>
using namespace std;
#define MAX 1000
int primenum[MAX + 1];
int multiply(int a, int b);
void Primeee();
int main(){
int arrrzz[][2] = { { 5, 11 }, { 5, 10 } };
int len = sizeof(arrrzz) / sizeof(arrrzz[0]);
Primeee();
for(int i = 0; i < len; i++)
cout <<multiply(arrrzz[i][0], arrrzz[i]... |
/*
* This file contains the functions which read all the
* sensors and refresh sensor data
*
* Creation date: 2019 07 30
* Author: Pascal Pfeiffer
*/
// includes
#include "readSensors.h"
#include "lineTracking.h"
#include "lidar.h"
#include "PublicStructures.h"
#include "HCSR04P.h"
#include "colorTracking.h"
#i... |
/*
Invisible entities that affect other entities or the world when activated.
*/
#include "../idlib/precompiled.h"
#pragma hdrstop
#include "Game_local.h"
#include "Projectile.h"
/*
===============================================================================
idTarget
==========================================... |
#include<bits/stdc++.h>
using namespace std;
#define d 256
#define q 3001
void rabinKarp(string txt, string pat)
{
int n=txt.length();
int m=pat.length();
int h=1;
for(int i=0; i<m-1 ;i++)
{
h=(h*d)%q;
}
int p=0,t=0;
for(int i=0; i<m ;i++)
{
p=(p*d+pat[i])%q;
t=(t*d+txt... |
#pragma once
#include "all_include.h"
#include "HuffmanTreeTable.h"
#include <memory>
// 编译顺序未知所以即使包含HuffmanTreeTable头文件仍有可能在其之前编译,所以要加上对HuffmanTreeTabl类的超前声明
struct Node;
class HuffmanTreeTable;
class HuffmanTreeTablePraser
{
public:
HuffmanTreeTablePraser() :begofSource(),endofSource(),dataSourcePtr(... |
#include "Rasteriser.h"
Rasteriser app;
bool Rasteriser::Initialise()
{
_modelLoaded = false;
if (!MD2Loader::LoadModel("marvin2.md2", _model,
&Model::AddPolygon,
&Model::AddVertex))
{
return false;
}
else
{
_modelLoaded = true;
}
_ambientLight = AmbientLight(10);
_camera.SetPosition(Vertex(0, 0, -4... |
/*
injector.pde - Example usage of NabaztagInjector Arduino Library
Copyright (c) 2012 Tobias Bielohlawek. All right reserved.
*/
// uncomment when using Arduino IDE
// #include <Wire.h>
// #include <ByteBuffer.h>
#include <Nabaztag.h>
void setup() {
Serial.begin(115200);
Nabaztag.begin(9); // RFID Reader... |
#include<iostream>
int compare1( int num1, int num2 ) {
return num1 < num2 ? num1 : num2;
}
int compare2( int num1, int num2 ) {
return num1 > num2 ? num1 : num2;
}
void inputArrElements( int array[], int size ) { // the method inputs the elements in array
for( int i = 0; i < size; ++i ) {
s... |
// 특정한 최단 경로
//
// issue 1 :각 함수 마다 -1을 반환하는지 확인하는게 어렵다.
// 해결방법 : define INF를 통해 정수 최대값으로 설정해주고 합에서 INF를 넘었는지 검증한다.
// 그러나 채점 결과 코드 길이는 줄었으나 메모리는 오히려 조금 더 사용하였다.
#include <iostream>
#include <queue>
#include <vector>
#define INF 0x7fffffff
using namespace std;
struct edge {
int x, y;
};
int V, E;
vector<edg... |
#pragma once
#include "entities/entity.hpp"
#include <string>
struct CitizenName : ecs::ComponentCRTP<ecs::Component::CitizenName, CitizenName> {
CitizenName(std::string n, std::string s)
: name(n), sector(s) { }
std::string name;
std::string sector;
};
CitizenName* random_citizenname();
|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2003 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#include "core/pch.h"
#ifdef USER_JAVASCRIPT
#include "modules/dom... |
/*
* (C) Copyright 2016-2018 Ben Karsin, Nodari Sitchinava
*
* 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... |
#pragma once
#include "MatrixOp-inl.h"
#include <glog/logging.h>
using namespace std;
namespace ICG {
class Frame {
public:
OrientationType orientationType;
shared_ptr<Orientation> orientation;
shared_ptr<TranslationVec> translationVec;
shared_ptr<ScalingVec> scalingVec;
Frame(OrientationType orientationTy... |
//
// GOMEA.cpp
// GA
//
// Created by Tom den Ottelander on 28/11/2019.
// Copyright © 2019 Tom den Ottelander. All rights reserved.
//
#include "GOMEA.hpp"
using namespace std;
GOMEA::GOMEA(FitnessFunction * fitfunc, FOS *fos, bool forcedImprovement = false) : GA(fitfunc), fos(fos), gom_variation(*new GOM_Vari... |
/* -*- Mode: c++; indent-tabs-mode: nil; c-file-style: "gnu" -*-
*
* Copyright (C) 1995-2002 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"
#ifdef XSLT_SUPPORT
#include "modules/xslt/src/xs... |
#include <stdio.h>
#include <iostream>
using namespace std;
void showmsg(){
printf("Welcome to ICS Database Management System Version 1.0\n");
printf("This is the Storage Management and File structure part \n");
printf("Assume that all the input values are in lower case given by the processor\n");
printf("written ... |
#ifndef DEFAULT_SCREEN_TAP_LISTENER_HPP
#define DEFAULT_SCREEN_TAP_LISTENER_HPP
#include <iostream>
#include "BaseScreenTapListener.hpp"
/*
* Prints ScreenTap events to standard output.
* @author: Grzegorz Mirek
*/
class DefaultScreenTapListener : public BaseScreenTapListener {
protected:
void onScreenTap(const Le... |
#include "PlayerBehaviorBroadcastComponent.h"
UPlayerBehaviorBroadcastComponent::UPlayerBehaviorBroadcastComponent()
{
PrimaryComponentTick.bCanEverTick = true;
}
void UPlayerBehaviorBroadcastComponent::BeginPlay()
{
Super::BeginPlay();
PlayerBehaviorEvents.Add(BH_None, FPlayerBehaviorEvent());
PlayerBehaviorEve... |
#pragma once
#include "MsgList.h"
class CMessageWnd : public WindowImplBase
{
public:
CMessageWnd(RECT rect);
~CMessageWnd(void);
public:
LPCTSTR GetWindowClassName() const;
virtual CDuiString GetSkinFile();
virtual CDuiString GetSkinFolder();
virtual void Notify( TNotifyUI& msg );
void OnPrepare();
RECT G... |
// Created on: 2014-10-08
// Created by: Denis BOGOLEPOV
// 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... |
void setup_Modbus()
{
#ifdef USE_MODBUS
mb.slave();
mb.addHreg(hrSECONDS);
mb.addHreg(hrDSTEMP);
mb.addHreg(hrPSET);
mb.addHreg(hrPNOW);
mb.addHreg(hrUNOW);
mb.addHreg(hrINOW);
mb.addHreg(hrU_CNTR);
mb.addHreg(hrI_CNTR);
PRINTLN("+ MODBUS Slave started.");
#else
PRINTLN("-- N... |
#include "system.h"
#include "util.h"
#include <cstdio>
#include <unistd.h>
#include <limits.h>
#include <sys/statvfs.h>
#include <sys/vfs.h>
#include <linux/magic.h>
#include <mntent.h>
namespace libzinlidac {
// throws a `StatvfsError` if statvfs fails
unsigned long get_filesystem_capacity() {
struct statvfs vf... |
#include <iostream>
using namespace std;
int main() {
int N, X;
int number[10000]; // 초기 배열
int less_than[10000]; // x보다 작은 수의 배열
int count = 0; // 작은 경우 카운트
cin >> N >> X;
for (int i = 0; i < N; i++) {
cin >> number[i];
}
for (int i = 0; i < N; i++) {
if (number[i] < X) {
less_than[count++] = numb... |
#include <iostream>
#include <iomanip>
#include <fstream>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <sstream>
#include <string>
using namespace std;
int main()
{
int numberOfValues;
string fileName;
clock_t start;
clock_t end;
// Ask user what file they would like to us... |
#ifndef __COMMON_H__
#define __COMMON_H__
/*
==============================================================
Common
==============================================================
*/
// RAVEN BEGIN
// mekberg: added more save types
typedef enum {
ST_REGULAR,
ST_QUICK,
ST_AUTO,
ST_CHECKPOINT,
} saveType_t;
// ... |
//
// SoundFromRAM.hpp
// DrumConsole
//
// Created by Paolo Simonazzi on 20/03/2016.
//
//
#ifndef SoundFromRAM_hpp
#define SoundFromRAM_hpp
#include "DrumKit.hpp"
class SoundFromRAM {
public:
SoundFromRAM(int note);
~SoundFromRAM();
void loadSamplesFromFolder (const String& soundName, const S... |
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <list>
#include <algorithm>
#include <sstream>
#include <set>
#include <cmath>
#include <map>
#include <stack>
#include <queue>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <numeric>
using namesp... |
#pragma once
#include <iostream>
#include<vector>
#include <fstream>
#include <regex>
#include "Map.h"
class MapLoader
{
public:
MapLoader();
~MapLoader();
MapLoader(string* mapPath, string* mapName, int numCountries, int numContinents);
MapLoader(const MapLoader& loader2);
string getMapName();
int getNumCountr... |
// 매개변수의 상수화 (모든 함수)
// 메서드의 상수화 (맴버 메서드)
#include <iostream>
using namespace std;
class Account{
public:
Account() : money(0){
}
Account(int money) : money(money){
}
void Deposit(const int d){
money = money + d;
cout << d << " 예금 완료 " << endl;
}
void Withdraw(const int w){
if (money >=... |
/*
* @lc app=leetcode.cn id=718 lang=cpp
*
* [718] 最长重复子数组
*/
// @lc code=start
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
int findLength(vector<int>& A, vector<int>& B) {
int lenA = A.size();
int lenB = B.size();
if(lenA==0 |... |
#include<iostream>
#include<vector>
using namespace std;
typedef vector<int> vi;
class UnionFind{
private: vi p,rank;
public:
UnionFind(int N){
rank.assign(N,0);p.assign(N,0);
for(int i=0;i<N;i++)p[i]=i;}
int findSet(int i){return (p[i]==i)?i:(p[i]=findSet(p[i]));}
bool isSameSet(int i,in... |
//
// Created by 송지원 on 2020/07/17.
//
//바킹독님 코드
//2의 k승을 '(1<<k)'로 표현함!!!
//그리고 내가 짠 toggle 코드는 '6-a-b'로 대체 가능함!!!
#include <iostream>
using namespace std;
void func(int a, int b, int n) {
if (n==1) {
cout << a << ' ' << b << '\n';
return;
}
func(a, 6-a-b, n-1);
cout << a << ' ' << b... |
//
// Activity_study.hpp
// projekt_programowanie_obiektowe
//
// Created by Phillip on 11/06/2018.
// Copyright © 2018 Phillip. All rights reserved.
//
#ifndef Activity_study_h
#define Activity_study_h
#include "Activity.hpp"
class Activity_study : public Activity {
public:
void start_new_activity();
};
#en... |
#pragma once
#include <string>
class Rational
{
public:
Rational(int numerator = 0, int denominator = 1) :m_Numerator(numerator),m_Denominator(denominator){};
int GetNumerator() const{return m_Numerator;};
int GetDenominator() const{return m_Denominator;};
std::string ToString() const{return std::to_string(m_Nume... |
/*
IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
By downloading, copying, installing or using the software you agree to this license.
If you do not agree to this license, do not download, install,
copy or use the software.
BSD 3-Clause License
Copyright (C) 201... |
/*
Name: �������ܼƻ�
Copyright:
Author: Hill bamboo
Date: 2019/8/17 22:28:08
Description: ��
14min ���
*/
#include <bits/stdc++.h>
using namespace std;
int m, n, x, y, k, ans;
int dx[] = {0, 1, -1, 0};
int dy[] = {1, 0, 0, -1};
bool outside(int x, int y) {
return x < 0 || m <= x || y < 0 || n <= y;
}
void df... |
/*
* Flowing LEDs
* Author: Zhimin Lin
* Date: 2017-02-14
*
* Turn LEDs connected to the board on and off consecutively. LEDs are turned on one by one,
* and then turned off one by one in the reversed direction.
*/
#define LOW_PIN 2 //The lowest pin used to connect a LED
#define HIGH_PIN 9 //The highest pi... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** Copyright (C) 1995-2005 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** @author { Morten Rolland <mortenro@o... |
#pragma once
//
// This file defines the input source we use for parsing the .cqenum
// file. It's the usual thing, in that it wraps an input stream,
// tracks current location (for error output), and provides lexical
// type parsing to break out tokens based on the known separator
// characters and such.
//
// ... |
// Copyright (c) 2015 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<bits/stdc++.h>
using namespace std;
main()
{
long long int i,t;
double j,wide,len,area_rec,radius,pi,area_of_cir, result;
pi = 3.14159265358979323846;
while(scanf("%lld",&t)==1)
{
j=0.6;
for(i=1; i<=t; i++)
{
scanf("%lf",&len);
wide = len*0.6... |
#ifndef SPECEX_LAMP_LINES_UTILS__H
#define SPECEX_LAMP_LINES_UTILS__H
#include <string>
#include <vector>
namespace specex {
class Spot;
void allocate_spots_of_bundle(vector<specex::Spot_p>& spots,
const std::string& lamp_lines_filename, const TraceSet& traceset,
int fiber_bundle, int fiber_min, in... |
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/MainView.g.uno.
// WARNING: Changes might be lost if you edit this file directly.
#include <_root.app18_bundle.h>
#include <_root.app18_FuseControlsShadow_Color_Property.h>
#include <_root.app18_FuseElementsElement_Opacity_Property.h>
#include <... |
//====================================================================================
// @Title: HUD MANAGER
//------------------------------------------------------------------------------------
// @Location: /game/battle/include/cBattleHudMgr.h
// @Author: Kevin Chen
// @Rights: Copyright(c) 2011... |
#include <gtest/gtest.h>
#include <string>
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
int status= RUN_ALL_TESTS();
return status;
}
|
// Created on: 1993-01-09
// Created by: CKY / Contract Toubro-Larsen ( Anand NATRAJAN )
// Copyright (c) 1993-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... |
//print matrix in spiral form
//seperate the reverse printing function insted of using ternary
//does not work properly.
#include<iostream>
#include<vector>
using namespace std;
void printvec(vector<vector<int>> &vec){
for (int i = 0; i < vec.size(); i++)
{
for (int j = 0; j<vec[i].size(); j++)
... |
#include <iostream>
using namespace std;
//long double sum_value()
//{
// return (long double)0;
//}
template<typename T>
long double sum_value(T value)
{
return (long double)value;
}
template<typename T, typename ...Args>
long double sum_value(T a, Args...args)
{
long double sum = 0;
sum = a + sum_value(args...... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2005-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef SVG_TRAVERSER_H
#define SVG_TRAVERSER_H
#if defined(SVG_... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2012 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*
* @author: Deepak Arora (deepaka), Karianne Ekern (karie)
*
*/
#ifndef C... |
#include "hammertile.h"
#include "ui_hammertile.h"
hammertile::hammertile(int row, int col, QWidget *parent) :
QPushButton(parent),
ui(new Ui::hammertile)
{
this->row = row;
this->col = col;
this->setText(QString(""));
}
hammertile::~hammertile()
{
delete ui;
}
void hammertile::setValue(char ... |
#pragma once
#ifndef Roster_H
#define Roster_H
#include "student.h"
#include "stdafx.h"
#include "networkStudent.h"
#include "softwareStudent.h"
#include "securityStudent.h"
using namespace std;
class Roster {
public:
void Add(string, string, string, string, int, int, int, int, Degree);
void R... |
#include "mycanvas.h"
void MyCanvas::set_line_color(const QColor& new_color)
{
color.color_line = new_color;
update_scene();
}
void MyCanvas::set_cut_color(const QColor& new_color)
{
color.color_cut = new_color;
update_scene();
}
void MyCanvas::set_cutter_color(const QColor &new_color)
{
color.co... |
#include "iostream"
#include "string"
using namespace std;
int result[4][3] = { 0, 5, 0, 0, 4, 0, 1, 6, 2, 0, 3, 0 };
void CoutResult() {
cout << result[2][0] << result[2][2] << result[3][1] << result[1][1] << result[0][1] << result[2][1] << endl;
}
void L() {
int number1 = result[2][0], number2 = result[2][1], num... |
/* -*-C++-*-
*/
/*
* Copyright 2016 EU Project ASAP 619706.
*
* 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 app... |
/*
* FieldAnalyse.cpp
*
* Created on: 12/feb/2012
* Author: jetmir
*/
#include "FieldAnalyse.h"
CvPoint p_corners[4];
bool waiting_corners;
int corners;
void on_mouse(int event, int x, int y, int flags, void* param) {
if (event == CV_EVENT_LBUTTONDOWN) {
p_corners[corners].x = x;
p_corners[corners].y... |
#include<stdio.h>
#include<iostream>
float cal (float x,float y);
int main()
{
float total,allscore = 0,mean;
int pass = 0;
std::cin>>total;
struct student
{
char name[5];
int score;
};
student testscore[10000];
for(int i=0;i<total;i++)
{
std::cin>>testscore[i].name;
std::cin>>testscore[i].score;
allscore += testscore... |
#include<iostream>
#include<string>
using namespace std;
int main()
{
int k, n, i;
int x;
cin >> n >> k;
x = n;
for (i = 0; i<k; i++)
{
if (x % 10 == 0)
{
x = x / 10;
}
else
{
x = x - 1;
}
}
cout << x;
return 0;
} |
/********************************************************************************
** Form generated from reading UI file 'mywidget.ui'
**
** Created by: Qt User Interface Compiler version 5.13.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
***********************************... |
#ifndef MARKETDATA_H
#define MARKETDATA_H
class MarketData
{
public:
//deterministic discount factors - can be used for forwarding the equity and discounting.
virtual double discountFactorTo(double time)const=0;
virtual double equityPrice() const = 0;
virtual double equityVolatility() const = 0; //this is ... |
#pragma once
#include "ode.h"
#include "red_type.h"
class threebody : public ode
{
public:
threebody(uint16_t n_ppo, computing_device_t comp_dev);
~threebody();
void load(std::string& path);
void load_ascii(ifstream& input);
void load_ascii_record(ifstream& input, ttt_t* t, threebody_t::metadata_t *md, threebo... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
#include <iostream>
#include <future>
#include <vector>
#include <boost/filesystem.hpp>
using namespace std;
using namespace boost::filesystem;
template<typename T>
class cqueue {
private:
std::mutex _mutex;
std::condition_variable _cond;
std::deque<T> _queue;
bool done;
public:
cqueue():done(false) { }
... |
//从0到15到10到40到55 过了前11组数据,后面的都是超时,最后一组溢出
//这次酸水写的比较多吧,但是写的太水了 过度自信没有分块是一个大原因
/* 2017-02-22 00:48:40 55.0/100.0 很大的逻辑错误
2017-02-22 00:09:50 40.0/100.0 加上清理空指针
2017-02-22 00:08:15 40.0/100.0 -3变成-2
2017-02-21 23:17:40 10.0/100.0 那些清理废弃指针先注释掉
2017-02-21 22:54:01 10.0/100.0 >=1改为>=3
2017-02-21 22:15:4... |
//一眼看上去 题目并不难 背景也挺有意思
// 60 ms 66.51 %
class Solution {
public:
int findPoisonedDuration(vector<int>& timeSeries, int duration){
if(timeSeries.size()==0){
return 0;
}
int result = duration; //最后一次攻击直接加上
for(int i=0;i<timeSeries.size()-1;++i){
int temp = timeSeries[i+1]-timeSe... |
#include <bits/stdc++.h>
using namespace std;
int main()
{
long long a,i,co;
while(scanf("%lld",&a)!=EOF){
if(a==0)break;
i=sqrt(a);
if(i*i==a)
cout<<"yes"<<endl;
else
cout<<"no"<<endl;
}
return 0;
}
|
/* -*- 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.
**
** Jan Borsodi
*/
#ifndef OP_SCOPE_TRANSPORT_MESSAGE_PARSER_H
#define ... |
#include<iostream>
#include<vector>
#include<algorithm>
#include<iterator>
using namespace std;
struct TreeNode {
int val;
TreeNode* left;
TreeNode* right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
#define inf 9999
void Init_TreeNode(TreeNode** T, vector<int>& vec, int& pos)
{
if (vec[pos] == inf || ... |
#include "stdafx.h"
#include <clocale>
#include <ctime>
#include "menu.h"
#include "resource.h"
#define _CRT_SECURE_NO_WARNINGS
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
srand(time(0));
setlocale(LC_ALL, "Russian");
menu main;
main.start();
return IDR_MENU1;
}; |
//
// Created by moon on 25.08.2021.
//
#include "gtest/gtest.h"
#include "gmock/gmock.h"
#include "HowManyCharIsDuplicated.h"
TEST(HowManyCharIsDuplicated, ReturnExceptionIfEmptyString) {
ASSERT_THROW(HowManyCharIsDuplicated(""), EmptyStringException );
}
TEST(HowManyCharIsDuplicated, ZeroDupliactesForOneSizeS... |
/*
Copyright (c) 2000-2022 Xavier Leclercq
Released under the MIT License
See https://github.com/ishiko-cpp/test-framework/blob/main/LICENSE.txt
*/
#ifndef _ISHIKO_CPP_TESTFRAMEWORK_CORE_HEAPALLOCATIONERRORSTEST_HPP_
#define _ISHIKO_CPP_TESTFRAMEWORK_CORE_HEAPALLOCATIONERRORSTEST_HPP_
#include "Test.hpp"
... |
#ifndef PALABRASINESPACIO_H_INCLUDED
#define PALABRASINESPACIO_H_INCLUDED
#include <string>
using namespace std;
class palabrasinespacio
{
string renglon;
unsigned int posactual;
string unapalabra;
public:
/*
pre:
Ninguna.
post:
Devuelve true si no hay más palabras para devo... |
//Using Dijkstra. Time-0.070s
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll tc,n,m,s,t,p,u,v,c;
cin>>tc;
for(int i=0;i<tc;i++)
{
cin>>n>>m>>s>>t>>p;
s--; t--;
... |
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <iostream>
#define MAX_ERROR_MESSAGE 1024
#define ERROR -1
#define CHAR_SIZE 1
/**
* Prints the message error to the output, that checks if val is -1 then there is error
* @param val int for the error.
* @param err the error message.
* @return ... |
#include <iostream>
#include <fstream>
using namespace std;
/*
Banking Management System
Version : 0.8
Author : Prathmesh Ranaut
Created Date : 21 July 2013
*/
void lines(int count)
{
for(int j = 0; j < count; j++)
{
for(int i = 0; i < 50; i++)
{
cout<<"-";
}
cout<<endl;
}
}
void dis... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.