text stringlengths 8 6.88M |
|---|
#include "child.h"
const char * Child::getName() {return "Child";} |
#include<iostream>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>
#include<stdio.h>
#include<getopt.h>
#include<errno.h>
#include<string.h>
#include<limits.h>
using namespace std;
void print_helpinfo(){
//打印帮助信息
cout<<"copy the content of src file to dst file, dst can be a new fi... |
#include <iostream.h>
#include <conio.h>
void main() {
clrscr();
int a,b,t,i;
cout <<"\n\nEnter the Table no: ";
cin >>t;
cout <<"\n\nEnter the starting range for table: ";
cin >>a;
cout <<"\n\nEnter the Ending range for table: ";
cin >>b;
for (i=a; i<=b; i++)
cout <<"\n\n" <... |
/*
* stampTrait.h
*
* Created on: Dec 1, 2012
* Author: chjd
*/
#ifndef STAMPTRAIT_H_
#define STAMPTRAIT_H_
/*
* Trait design
*/
/*
* Policy may be more appropriate than Trait
*/
template<typename _DcSup,typename _DcLoad,
typename _AcSup,typename _AcLoad
typename _TranSup,typename _TranLoad
>
c... |
class Solution {//BFS with common if() X 4
public:
int numIslands(vector<vector<char>>& grid) {
if(grid.size() == 0 || grid[0].size() == 0) {
return 0;
}
int res = 0;
for(int i = 0; i < grid.size(); i++) {
for(int j = 0; j < grid[0].size(); j++) {
... |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
int main()
{
int n;
cin >> n;
string s; cin >> s;
char bef = 0;
int ans = 0;
rep(i, n){
if (bef != s[i]) ans++;
bef = s[i];
}
... |
#ifndef _LIST_H_
#define _LIST_H_
/* Include Headers */
#include "Headers.h"
/* Define Data type for list */
typedef char * ListDataType;
/* Defining structure for list */
struct ListStructure{
ListDataType dataPointer;
struct ListStructure *next;
};
/* Define type for pointer for ListStructure *... |
#include "SimpleDENFAC.hpp"
#include <vector>
#include <string>
#include <iostream>
#include <boost/serialization/list.hpp>
#include <boost/serialization/set.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/serialization/deque.hpp>
#include "nn/MLP.hpp"
#include "arch/AACAgent.hpp"
#include "bib/Seed.hp... |
//
// TextBox.cpp
// OpenGL_Timer_CPP
//
// Created by Ran Bao on 4/27/13.
// Copyright (c) 2013 Ran Bao. All rights reserved.
//
#include "TextBox.h"
NewTextBox::NewTextBox(){
x_axis = y_axis = 0;
font = NULL;
}
NewTextBox::NewTextBox(float x, float y, const float *fontColor, void *f){
for (int i = 0; i <... |
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <memory.h>
#include <math.h>
#include <string>
#include <string.h>
#include <queue>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <functional>... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** 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.
**
*/
#include "core/pch.h"
#include "mo... |
#include "Spark.h"
#include "SparkComms.h"
#include "BluetoothSerial.h"
// NEW CODE ------------------------------------------
void notifyCB_sp(BLERemoteCharacteristic* pRemoteCharacteristic, uint8_t* pData, size_t length, bool isNotify){
int i;
byte b;
Serial.print("Spark: ");
for (i = 0;... |
// API_06_Dialog.cpp : 애플리케이션에 대한 진입점을 정의합니다.
//
#include "framework.h"
#include "API_06_Dialog.h"
#define MAX_LOADSTRING 100
// 전역 변수:
TCHAR output[200];
HWND hWnd;
HINSTANCE hInst; // 현재 인스턴스입니다.
WCHAR szTitle[MAX_LOADSTRING]; // 제목 표시줄 텍스트입니다.
WCHAR szWindowClass[M... |
#include <iostream>
#include <unistd.h>
#include <stdlib.h>
#include <ctype.h>
#include <semaphore.h>
#include <string>
#include <cstring>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <stdio.h>
#include <fcntl.h>
#define RWRR (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
using namespace std;
//Roman Sobolenko
/... |
/* $Id$ */
/* Symbol table data structure.
Each identifier structure refers to a list of possible meanings of this
identifier. Each of these meanings is represented by a "symbol" structure.
*/
typedef union constant { /* depends on type */
long co_ival;
double co_rval;
char *co_sval;
char *co_setval;
} ... |
/*
* Created by Peng Qixiang on 2018/8/9.
*/
/*
* 数字在排序数组中出现的次数
* 统计一个数字在排序数组中出现的次数。
*
*/
# include <iostream>
# include <vector>
using namespace std;
class Solution {
public:
// binary search
int GetNumberOfK(vector<int> data ,int k) {
if(data.empty()) return 0;
int firstIndex = biSea... |
#include "core/pch.h"
#if defined _NEED_LIBSSL_VERIFY_SIGNED_FILE_
#include "modules/libssl/sslv3.h"
#include "modules/libssl/sslopt.h"
#include "modules/url/url2.h"
#include "adjunct/desktop_util/string/stringutils.h"
unsigned long GeneralDecodeBase64(const unsigned char *source, unsigned long len, unsigned long &r... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2007 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"
#if defined(INTERNAL_XBM_SUPPORT) || defined... |
#pragma GCC optimize("Ofast")
#include <algorithm>
#include <bitset>
#include <deque>
#include <iostream>
#include <iterator>
#include <string>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <unordered_map>
#include <unordered_set>
using namespace std;
void abhisheknaiidu()... |
// Client side C/C++ program to demonstrate Socket programming
// Project #1 :: RealTime ::<< endl
// Project #1 :: RealTime ::<< endl
// Project #1 :: RealTime ::<< endl
// Project #1 :: RealTime ::<< endl
// Project #1 :: RealTime ::<< endl
// cout << Yahya Shqair :: 1160699 :: << Firas maali ::
// cout << Yahy... |
#include <iostream>
using namespace std;
long long f(long long v) {
long long b, n, t;
//Init
b = 15;
n = 21;
while(n < v) {
t = (2 * n) + (3 * b) - 2;
n = (3 * n) + (4 * b) - 3;
b = t;
}
return b;
}
int main() {
cout << "Result:" << f(1000000000000) << endl... |
#include <cstdio>
void verificaIntervalo(double n);
int main() {
double valor[4];;
scanf("%lf %lf %lf %lf", &valor[0],&valor[1],&valor[2],&valor[3]);
double media = (2*valor[0] + 3*valor[1]+ 4*valor[2]+valor[3])/10;
printf("Media: %.1lf\n", media);
if(media>=7.0){
printf("Aluno a... |
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#define LED_WIFI LED_BUILTIN
#define INPUT_ADC A0
#define ssid "YOUR-SSID"
#define password "YOUR-SECRET-PASSWORD"
#define SERVER_URL "SERVER-URL"
void setup_wifi(void);
void read_data(void);
void upload_data(void);
float temperature;
HTTPClient http;
void s... |
//FOR CYCLE
int main(){
for(int i = 1; i < 10; i++){
cout << i << endl;
}
return 0;
}
// Հաշվել (0;50) ընկած հատվածում ընկած զույգ թվերի գումարը
//1-ին եղանակ
int main(){
int sum=0;
for(int i = 0; i <= 50; i++){
if(i % 2 == 0){
sum += i;
}
}
cout << sum << endl;
return 0;
}
//2-րդ եղանակ
int main(){
int s... |
#pragma once
#include "elog/appenders/appender.hpp"
#include <string>
namespace elog
{
class RawAppender: public BaseAppender
{
public:
RawAppender(Formatter& formatter);
~RawAppender();
void append(const Record& record) override;
protected:
virtual void write(const std::string&) = 0;
};
}
|
// Created on: 1996-10-11
// Created by: Christian CAILLET
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the ... |
#ifdef QT_QML_DEBUG
#include <QtQuick>
#endif
#include <sailfishapp.h>
int main (int argc, char * argv []) {
return SailfishApp::main (argc, argv);
}
|
#ifndef INCLUDE_PROCESSORSTATE_H_
#define INCLUDE_PROCESSORSTATE_H_
class ParserState
{
public :
virtual ~ParserState(){};
virtual void receiveChar(char received) = 0;
};
#endif /* INCLUDE_PROCESSORSTATE_H_ */
|
// Hardware: https://www.tindie.com/products/AllAboutEE/esp8266-analog-inputs-expander/
#include <AllAboutEE_MCP3021.h>
/**
* @brief Sets the pin and fixed address bits for I2C
*
* @author Carlos (4/12/2015)
*
* @param sda The SDA pin number
* @param scl The SCL pin number
*/
void AllAboutEE::MCP3021::begin(i... |
/*
ID: stevenh6
TASK: barn1
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
using namespace std;
ofstream fout("barn1.out");
ifstream fin("barn1.in");
int M, S, C;
class Gap
{
public:
int dist, pos;
};
bool comppos(Gap first, Gap second)
{
return first.pos < second... |
#pragma once
#if AE_COMPILER == AE_COMPILER_MSVC
#undef __PRETTY_FUNCTION__
#define __PRETTY_FUNCTION__ __FUNCSIG__
#endif
namespace aeEngineSDK
{
#if AE_COMPILER == AE_COMPILER_MSVC
#pragma warning( push )
#pragma warning(disable : 4275)
#endif
class AE_UTILITY_EXPORT aeException : public std::exception
{
p... |
#include "world.h"
World::World(btScalar averageFPS,btScalar lowestFPS,btVector3 gravity):mWorld(NULL)
{
initNormal(averageFPS,lowestFPS,gravity);
}
void World::stepDebug()
{
mWorld->stepDebug();
}
void World::initNormal(btScalar averageFPS,btScalar lowestFPS,btVector3& gravity)
{
mWorld = new worldsingle... |
#ifndef B_MC_HPP
#define B_MC_HPP
namespace b_mc {
extern char const* mocs_compilation();
}
#endif
|
/**
* Copyright (C) Omar Thor, Aurora Hernandez - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited
* Proprietary and confidential
*
* Written by
* Omar Thor <omar@thorigin.com>, 2018
* Aurora Hernandez <aurora@aurorahernandez.com>, 2018
*/
#ifndef DMTK_ELEMEN... |
#include <iberbar/Base/Lua/LuaStateRef.h>
iberbar::CLuaStateRef::CLuaStateRef( void )
: m_pLuaState( NULL )
{
}
iberbar::CLuaStateRef::~CLuaStateRef()
{
if ( m_pLuaState )
{
lua_close( m_pLuaState );
m_pLuaState = NULL;
}
} |
#include <bits/stdc++.h>
using namespace std;
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
#define MAXN 100
#define INF 0x3f3f3f3f
#define DEVIATION 0.00000005
int main(int argc, char const *argv[])
{
int kase;
scanf("%d\n",&kase);
char kind;
int m,n;
while( kase-- ){
scanf("%c %d %d\n", &k... |
#pragma once
#include "../../Toolbox/Toolbox.h"
#include "../Vector/Vector3.h"
namespace ae
{
/// \ingroup math
/// <summary>
/// 3D plane represented by a point (on the plane) and a normal vector.
/// </summary>
class AERO_CORE_EXPORT Plane
{
public:
/// <summary>
/// Pla... |
// 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 <iostream>
#include <vector>
#include <cmath>
int main()
{
long long int number = 600851475143LL;
long long int highestPrimeFactor = 0LL;
long long int currentFactor = 2LL;
while (number > highestPrimeFactor)
{
if (
(number % currentFactor == 0) &&
(currentF... |
#pragma once
#include <memory>
#include <QVector>
#include <QPointF>
#include "item/item.h"
using std::unique_ptr;
class broken_line : public item
{
Q_OBJECT
public:
static std::unique_ptr<broken_line> make (json data, QPointF pos, item* parent);
QRectF boundingRect () const override;
void paint (QPai... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2010 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#include "core/pch.h"
#include "modules/scope/src/scope_transport.h"
... |
////////////////////////////////////////////////////////////////////////////////
#include "delaunay.h"
#include <geogram/mesh/mesh.h>
#include <geogram/delaunay/delaunay.h>
#include <igl/adjacency_matrix.h>
#include <igl/sum.h>
#include <igl/diag.h>
//////////////////////////////////////////////////////////////////////... |
#ifndef COUNTERWIDGET_HPP_
#define COUNTERWIDGET_HPP_
#include <QWidget>
#include <QTimer>
#include <QtCharts>
#include "LogModel.hpp"
#include "PlayerStatsModel.hpp"
#include "GameStatsModel.hpp"
namespace Ui {
class CounterWidget;
}
/**
A widget with a treeview to display and manipulate a LogModel.
*/
cl... |
/**
* Project: ows-qt-console
* File name: main_window.h
* Description: this header describes the program's main window
*
* @author Mathieu Grzybek on 2012-04-30
* @copyright 2012 Mathieu Grzybek. All rights reserved.
* @version $Id: code-gpl-license.txt,v 1.2 2004/05/04 13:19:30 garry Exp $
*
* @see The GNU P... |
#include "StaticGameObject.h"
StaticGameObject::StaticGameObject(SDL_Rect *r, SDL_Surface *s,double x,double y,double a):GameObject(r,s)
{
worldX = x;
worldY = y;
angle = a;
//collisionRadius = (rect->w + rect->h)/2/2;
}
double StaticGameObject::getWorldX()
{
return worldX;
}
double StaticGameObject::getWorldY... |
#include <string.h>
const unsigned int line1Y = 5;
const unsigned int line2Y = 20;
const unsigned int col1X = 5;
const unsigned int col2X = 20;
const unsigned int col3X = 85;
const unsigned int wordSize = 8;
const unsigned int blinkPeriod = 600;
static enum State{
mainMenu = 0,
playerMove = 1,
movingMotors = ... |
#pragma once
class AI_CarrierReleaseEnemies : public hg::IAction
{
public:
void LoadFromXML( tinyxml2::XMLElement* data );
void Init( hg::Entity* entity ) override;
hg::IBehavior::Result Update( hg::Entity* entity ) override;
hg::IBehavior* MakeCopy() const;
private:
float m_Timer;
float m_Duration;
uint32... |
#pragma once
#ifndef __SURVEY_H__
#define __SURVEY_H__
#include <cmath>
#include <iomanip>
#include <Windows.h>
#include "GamingStudent.h"
class Survey
{
private:
int numOfStudents; // This will hold the amount of students in the survey
// Non-gamer related variables
int numOfNonGamers; // This will hold ... |
/**
* The n-queens puzzle is the problem of placing n queens on
* an n¡Án chessboard such that no two queens attack each other.
*
* Given an integer n, return all distinct solutions
* to the n-queens puzzle.
*
* Each solution contains a distinct board configuration of the
* n-queens' placement, where 'Q' and... |
// $Id$
//
// (C) Copyright Mateusz Loskot 2008, mateusz@loskot.net
// Distributed under the BSD License
// (See accompanying file LICENSE.txt or copy at
// http://www.opensource.org/licenses/bsd-license.php)
//
#if defined(_MSC_VER) && defined(USE_VLD)
#include <vld.h>
#endif
// liblas
#include <liblas/liblas.hpp>
#in... |
#pragma once
#include <Component.h>
#include <OGLML/Sprite.h>
namespace breakout
{
class SpriteComponent : public BaseComponent
{
public:
static EComponentType GetType()
{
return EComponentType::Sprite;
};
SpriteComponent();
~SpriteComponent();
oglml::Sprite& Sprite();
private:
oglml::Spri... |
#pragma once
#include "GnSignal.h"
#include "GcPropertyGridProperty.h"
class GcPropertyGridCtrl : public CMFCPropertyGridCtrl
{
DECLARE_DYNAMIC(GcPropertyGridCtrl)
public:
GcPropertyGridCtrl();
virtual ~GcPropertyGridCtrl();
public:
virtual int OnDrawProperty(CDC* pDC, CMFCPropertyGridProperty* pProp) const;
vi... |
/***********************************************/
/*************** IPv6 Server ******************/
/***********************************************/
#include "winsock2.h"
#include "iostream.h"
#include "ws2tcpip.h"
#include "tpipv6.h"
#pragma comment(lib,"WS2_32.lib")
//
#include <stdlib.h>
#include <stdio.h>
#include... |
#include "utils/time_utils.hpp"
#include "utils/service_thread.hpp"
#include <cppunit/extensions/HelperMacros.h>
#include <atomic>
#include <thread>
using namespace std;
namespace nora {
namespace test {
class time_utils_test : public CppUnit::TestFixture {
CPPUNIT_TES... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) Opera Software ASA 1995 - 2006
*/
#include "core/pch.h"
#include "modules/regexp/include/regexp_api.h"
#include "modules/regexp/include/regexp_advanced_api.h"
#include "modules/regexp/src/regexp_private.h"
OP_STATUS
OpRe... |
#include <reactor/base/SimpleLogger.h>
#include <reactor/net/EventLoop.h>
using namespace reactor;
using namespace reactor::base;
using namespace reactor::net;
void f1() {
LOG(Info) << "f1";
}
void f2() {
LOG(Info) << "f2";
}
void f3() {
LOG(Info) << "f3";
}
int main() {
EventLoop loop;
loop.run_after(1, f1... |
#ifndef SHOC_UTIL_H
#define SHOC_UTIL_H
#include "utl/bit.h"
#include "utl/str.h"
namespace shoc {
/**
* @brief Alias for underlying byte type.
*
*/
using byte = uint8_t;
/**
* @brief Input (const) span.
*
* @tparam N Size
* @tparam T Type
*/
template<size_t N = std::dynamic_extent, class T = byte>
using ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-file-style: "stroustrup" -*-
**
** Copyright (C) 1995-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 OPELEMENTCALLBACK_SUPPORT
... |
/*
* @author : imkaka
* @date : 31/1/2019
*/
#include<iostream>
#include<cstdio>
using namespace std;
int binary_search_itr(int arr[], int size, int val){
int l = 0, r = size-1;
int mid = (l + r) / 2;
while(arr[mid] != val && l <= r){
if(val < arr[mid]){
r = mid - 1;
}
... |
////////////////////////////////////////////////////////////////////////////////
#include "load_points.h"
#include "MeshUtils.h"
#include <geogram/mesh/mesh_io.h>
////////////////////////////////////////////////////////////////////////////////
namespace cellogram {
void load_points(const std::string &filename, Eigen:... |
/* -*- Mode: c++; indent-tabs-mode: nil; c-file-style: "gnu" -*-
*
* Copyright (C) 1995-2005 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 XPATH_SUPPORT
#include "modules/xpath/src/... |
#pragma once
namespace BroodWar
{
namespace Loader
{
private ref class AIManaged abstract sealed
{
private:
static AiBase^ aiBase;
internal:
static AIManaged();
static void Reload();
static void Start();
static void End(bool isWinner);
static void Frame();
static void SendText(System... |
//
// Created by Benoit Hamon on 10/4/2017.
//
#include <iostream>
#include <fstream>
#include <regex>
#include <exception>
#include <boost/dll/import.hpp>
#include <boost/range/iterator_range.hpp>
#include "ModuleManager.hpp"
#include "ssl/Base64.hpp"
ModuleManager::ModuleManager(IModuleCommunication *moduleCommuni... |
#ifndef SYNERGIST_H_
#define SYNERGIST_H_
#include "Skill.h"
#include "CharacterEntity.h"
class Synergist : public CharacterEntity
{
public:
Synergist();
~Synergist();
virtual void Init(int Level);
virtual void LevelUp(bool);
void Update(double dt);
// OffensiveSkill* skill_1;
};
#endif |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int x, y, z, T;
scanf("%d", &T);
while(T--){
scanf("%d %d %d", &x, &y, &z);
printf("%d\n", z*(2*x-y) / (x+y));
}
return 0;
}
|
#ifndef _MAC_SERVICES_HANDLER_H_
#define _MAC_SERVICES_HANDLER_H_
#ifdef SUPPORT_OSX_SERVICES
#ifndef NO_CARBON
const CFStringRef kOperaOpenURLString = CFSTR("openURL");
const CFStringRef kOperaMailToString = CFSTR("mailTo");
const CFStringRef kOperaSendFilesString = CFSTR("sendFiles");
const CFStringRef kOperaOpenFi... |
/*
* Copyright (c) 2015-2021 Morwenn
* SPDX-License-Identifier: MIT
*/
#ifndef CPPSORT_FIXED_LOW_MOVES_SORTER_H_
#define CPPSORT_FIXED_LOW_MOVES_SORTER_H_
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <cstddef>
#include ... |
//
// Created by carte on 11/7/2019.
//
#include "LinkedList.h"
#ifndef PROJECT7_QUEUE_H
#define PROJECT7_QUEUE_H
#endif //PROJECT7_QUEUE_H
class Queue: public LinkedList{
public:
Queue();
void enqueue_tail(Data stat);
bool dequeue_head();
private:
Node* tail;
}; |
// SubDoc.h : interface of the CSubDoc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_SUBDOC_H__D55C4369_FDD2_11D2_8800_00A0C9062EBA__INCLUDED_)
#define AFX_SUBDOC_H__D55C4369_FDD2_11D2_8800_00A0C9062EBA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MS... |
#include "bullet.h"
#include "gamemanager.h"
void Bullet::handleCollisions()
{
hurtElements();
if (_is_damage_dealed) {
_game->deleteElement(this);
}
}
void Bullet::hurtElements()
{
for (int i=0; i<_elements->size(); i++)
{
//czyli jesli nie sprawdza samego siebie, oraz jesli jest ... |
#include "pch.h"
// Ship - length, hp, x, y, rotation,
// Field - 10x10 '~'
// Animation '*' 'o' 'O' x, y, end_char
// Player
// Enemy
int main()
{
game G;
G.menu();
system("pause");
// Phase 1: Menu
// Phase 2: Ship placement
// Phase 3: Turn based gameplay
// Phase 4: SOSAT
return 0;
} |
#pragma once
#include "ofMain.h"
#include "StopMotionController.h"
#include "ofxGui.h"
class ofApp : public ofBaseApp
{
shared_ptr<StopMotionController> mAnimation;
ofxPanel mGui;
ofParameterGroup mParams;
ofParameter<float> mLevel;
ofParameter<float> mGain;
ofParameter<float> mDecay;
... |
//Faça um programa que solicite 10 (dez) números inteiros do usuário. Informe os números, a soma e a média.
#include<stdlib.h>
#include<stdio.h>
main(){
int num1, num2, num3, num4, num5, num6, num7, num8, num9, num10;
float soma, media;
printf("Digite o primeiro numero: ");
scanf("%d",&num1);
print... |
#include "Galois/Galois.h"
#include "Galois/Accumulator.h"
#include "Galois/Bag.h"
#include "Galois/Statistic.h"
#include "Galois/UnionFind.h"
#include "Galois/Graphs/LCGraph.h"
#include "Galois/ParallelSTL/ParallelSTL.h"
#include "llvm/Support/CommandLine.h"
#include "Galois/Runtime/WorkList.h"
#include "Lonestar/Boi... |
#include "CppUnitTest.h"
#include "CppUnitTestAssert.h"
#include "../3XD_Lib/geometry/transform.h"
#include <math.h>
#include <vector>
#include <array>
#define M_PI 3.14159265358979323846
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
using namespace Z_3D_LIB_FOR_EGE;
namespace My3D_Lib_for_ege_UnitT... |
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include "serialadapter.h"
#include "rgbdapter.h"
#include "myconicalgradient.h"
#include "avaservice.h"
#include "gateadapter.h"
#include "buttonadapter.h"
#include "bme280adapter.h"
#include "compressoradapter.h"
int main(int argc, char *argv[])
{
QC... |
/*
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... |
#ifndef RENDERMANAGER_H
#define RENDERMANAGER_H
#include "renderer/quadrenderer.h"
#include "renderer/cuberenderer.h"
#include "renderer/chunkrenderer.h"
#include "renderer/uirenderer.h"
class Camera;
class ChunkMesh;
class Ui;
class RenderManager
{
public:
RenderManager();
void addQuad(const Vector3 &pos);... |
#include "CameraModel.h"
#include <ComputerVisionLib/CameraModel/ProjectionModel/PinholeModel.h>
Cvl::CameraModel::CameraModel(DistortionModel::Uptr pDistortionModel, ProjectionModel::Uptr pProjectionModel) :
mpDistortionModel(std::move(pDistortionModel)),
mpProjectionModel(std::move(pProjectionModel))
{
}
Cvl::Camer... |
//首先想到了hash表,然后是二分查找,但是没给范围,hash用起来有点慌
class Solution {
public:
vector<int> twoSum(vector<int>& numbers, int target) {
for(int i=0;i<numbers.size();++i){
if(numbers[i]*2==target){ //3.这种情况没考虑到
vector<int> result;
result.push_back(i+1);
result.push_back(i+2);
return result;
}
... |
#include <bits/stdc++.h>
using namespace std;
int n = 100, l, r, x;
int main() {
srand(time(0));
printf("%d %d\n", n, n);
for (int i = 1; i <= n; i++) {
x = rand() % 2, l = (rand() - 1) % n + 1, r = (rand() - 1) % n + 1;
if (l > r) swap(l, r);
printf("%d %d %d\n", x, l, r);
}
}
|
/****************************************************************************
** Copyright (C) 2017 Olaf Japp
**
** This file is part of FlatSiteBuilder.
**
** FlatSiteBuilder is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free S... |
// https://practice.geeksforgeeks.org/problems/fixed-two-nodes-of-a-bst/1/?track=md-tree&batchId=144
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left, *right;
Node(int x)
{
int data = x;
left = right = NULL;
}
};
void swap(int *a, int *b)
{
... |
#ifndef _ss_math_H_
#define _ss_math_H_
#include "ssVector2.h"
#include "ssVector3.h"
#include "ssVector4.h"
#include "ssBBox.h"
#include "ssMatrix3.h"
#include "ssMatrix4.h"
#include "ssPlane.h"
#include "ssPoint3.h"
#include "ssQuaternion.h"
#include "ssRay.h"
#include "ssSphere.h"
using std::min;
using std::max;
//... |
#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 show(x) {for(auto i: x){cout << i << " ";} cout<<endl;}
#define showm(m) {for(auto i: m){cout << m.x << " ";} cout<<endl;}
typedef long l... |
// Created on: 1993-04-07
// Created by: Laurent BUCHARD
// 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 it under
// the terms of the GN... |
#pragma once
#include "Epoch.h"
namespace ga
{
class GeneticAlgorithm
{
public:
GeneticAlgorithm(std::vector<size_t> config, int population_size);
virtual ~GeneticAlgorithm();
pEpoch epoch;
pEpoch Selection(double unchange_perc, double mutation_perc, double crossover_perc);
private:
int GetIndex(floa... |
// Grouping Vanilla Mod specific items together because they have limited use in Epoch and should be called sporadically.
// DayZ Mod base building is not enabled in Epoch so there is no reason to spawn many of these items.
// skigoggles posted a list of unused (junk) items here: https://helpthedeadreturn.wordpress.c... |
#pragma once
#include <bits/stdc++.h>
#include "expression.h"
class AbstractDispatcher;
class Var_decl {
public:
std::string type, id;
int *shapex;
int *shapey;
Expression *initial_value;
Var_decl(std::string, std::string, Expression *);
Var_decl(std::string, std::string, int, Expression *);
... |
#include "RequestHandler.hpp"
#include "SysrepoListener.hpp"
#include <unistd.h>
int main(int, char **) {
SysrepoListener l;
l.listen();
RequestHandler handler(l);
while (true) {
pause();
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
bool compare(int x, int y)
{
return abs(x) < abs(y);
}
void findMinSum(int arr[], int n)
{
sort(arr, arr + n, compare);
int min = INT_MAX, x, y;
for (int i = 1; i < n; i++) {
// Absolute value shows how close it is to zero
i... |
// USBOutput.h
#ifndef _USBOUTPUT_h
#define _USBOUTPUT_h
#include "Config.h"
#include "Output.h"
#if defined(ARDUINO) && ARDUINO >= 100
#include "arduino.h"
#else
#include "WProgram.h"
#endif
#ifndef TEENSY
#include <HID-Project.h>
#endif
class USBOutput : public Output
{
private:
float ... |
/*
* Copyright (c) 2016, The Regents of the University of California (Regents).
* 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 code must retain the a... |
/* -*- 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.
*
* @author Manuela Hutter (manuelah)
*/
#ifndef WEBSERVER_SERVICE... |
#include <Poco/AutoPtr.h>
#include <Poco/Timespan.h>
#include <Poco/Util/XMLConfiguration.h>
#include <cppunit/extensions/HelperMacros.h>
#include "di/DependencyInjector.h"
#include "cppunit/BetterAssert.h"
using namespace std;
using namespace Poco;
using namespace Poco::Util;
namespace BeeeOn {
class DependencyIn... |
#include <iostream>
#include <string>
#include <sstream>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
string envVar[50];
void parseEnv(char* inp)
{
string input(inp);
string delimiter = ":";
size_t pos = 0;
int i=0;
while((pos=input.find(delimiter)) != string::... |
#include <iostream>
using namespace std;
int p[11] = {0};
int c[11] = {0};
int calcScore(int score, int t, int goal) {
if (score >= goal) {
return t;
} else {
}
}
int main()
{
int d, g; cin >> d >> g;
for (int i = 1; i <= d; i++) {
cin >> p[i] >> c[i];
}
calcS... |
#ifndef _MSG_0X3F_PARTICLE_STC_H_
#define _MSG_0X3F_PARTICLE_STC_H_
#include "mcprotocol_base.h"
namespace MC
{
namespace Protocol
{
namespace Msg
{
class Particle : public BaseMessage
{
public:
Particle();
Particle(const String16& _particleName, float _x, float _y, float _z, float _offsetX, float _offsetY, float ... |
#include <signal.h>
#include <math.h>
#include "CDLReactor.h"
#include "Configure.h"
#include "ClientHandler.h"
#include "Despatch.h"
#include "Logger.h"
#include "Version.h"
#include "SvrConfig_.h"
#include "RedisAccess.h"
#include "ErrorMsg.h"
//#include "UdpManager.h"
#include "TrumptConnect.h"
#include "Packet.h"
#... |
#pragma once
#include <bitstream.h>
#include <json/Document.h>
#include "RWLockable.h"
#include "Page.h"
#include "credb/defines.h"
namespace credb
{
namespace trusted
{
class BufferManager;
class ObjectEventHandle;
/**
* All objects are stored in blocks
* Blocks hold a single buffer that can easily be written t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.