text stringlengths 8 6.88M |
|---|
#ifndef STEK_HPP
#define STEK_HPP
#include "vect.hpp"
class Stek : private Vect {
private:
int* arr;
int size;
public:
Stek ();
~Stek ();
Stek (Stek& obj);
Stek(Stek&& obj);
Stek (int a);
void pushStek (int a);
void popStek ();
};
|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2012 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#ifndef DESKTOPOPUIINFO_H
#define DESKTOPOPUIINFO_H
#include "mo... |
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "ListeningItem.h"
#include "TestGlowItem.generated.h"
/**
*
*/
UCLASS()
class HYPOXIA_API ATestGlowItem : public AListeningItem
{
GENERATED_BODY()
public:
ATestGlowItem();
virtual void Hear(float volume) ove... |
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <algorithm>
#include <QMainWindow>
#include <QAction>
#include <QFileDialog>
#include <QMessageBox>
#include <QDateTime>
#include <QSettings>
#include <QMouseEvent>
#include <QVector>
#include <QMap>
#include <QTimer>
#include <QDebug>
#include <QRadioButton>
#inclu... |
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
void GetInput(string& s){
cin>>s;
if(not(s=="가위"||s=="바위"||s=="보"))
throw "\"가위\", \"바위\", \"보\" 중에서만 선택하세요.";
}
void ComputerInput(string& t){
srand((unsigned int)time(NULL));
int n=rand()%3;
if (n==0)
t="가위";
else if(n==1)
t="바위... |
// Blood_Node.cpp
// Ben Howe
// COSC 2030
// 10/24/2018
/*
Modified node class that was provided for Lab 2.
Modifications:
- converted from singly-linked to doubly-linked
- additional data elements added
*/
#include "Blood_Node.h"
Blood_Node::Blood_Node(float min, float max, string sum, unsigned l... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*-
*
* Copyright (C) 2012 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#ifndef MEDIATHREAD_H
#define MEDIATHREAD... |
// Copyright 2017 Elias Kosunen
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to ... |
#include <iostream>
#include <sstream>
#include <string>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
return 0;
}
|
#include "InfoBoard.h"
#include "Serial.h"
#include "Command.h"
#include "Util.h"
#include "Maths.h"
#include <iostream>
InfoBoard::InfoBoard(int serialId) : serialId(serialId), serial(NULL), errorRaised(false), goReceived(false), goRequested(false), firstAngle(true), targetSide(Side::UNKNOWN) {
serial = new Serial(... |
/* -*- 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.
*/
#ifndef EOI_FRAGMENTS_H
#define EOI_FRAGMENTS_H
#include "module... |
// bytebear
// Creative Commons Attribution 3.0 License
// http://creativecommons.org/licenses/by/3.0/
class ByteBear {
public:
ByteBear();
~ByteBear();
unsigned char* d;
int Run(unsigned long t);
};
|
/* @author Aytaç Kahveci */
#ifndef KRLREAL_H
#define KRLREAL_H
#include <kuka_ros_open_comm/KRLVariable.h>
#include <string>
class KRLReal
{
private:
std::string name_;
int id_;
long readTime_;
KRLVariable* krl_var_;
public:
double value_ = (double) NULL;
KRLReal(){}
KRLReal(std::strin... |
#include <SFML/Graphics.hpp>
#include "Constants.hh"
#include "World.hh"
void SineWave(sf::Vector2f &p, int time, int middle)
{
if (p.x < middle - 50 || p.x > middle + 50)
{
if (p.x < middle)
p.y += sin((p.x / 8) + time) * 20;
else
p.y += sin((p.x / 8) - time) * 20;
}
}
void d... |
// Created on: 2015-07-13
// Created by: Irina KRYLOVA
// 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 publ... |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Person
{
public:
Person(int age)
{
this->age = age;
}
Person operator+(Person &p2)
{
Person p(this->age + p2.age);
return p;
}
int age;
};
#if 0
Person operator + (Person &p1, Person... |
#include "shader_program.h"
#include <fstream>
#include <sstream>
// Shader base path is found by SDL the first time it is needed
std::string ShaderProgram::shader_base_path_ = "";
// The folder to look in relative to the base path
#define SHADER_FOLDER "shaders"
#ifdef _WIN32
#define PATH_SEPERATOR '\\'
#else
... |
#ifndef SPRITEBATCH_H
#define SPRITEBATCH_H
#include "../maths/MathCore.h"
#include "RecTangle.h"
#include "SystemDefs.h"
class SpriteBatch
{
public:
SpriteBatch();
~SpriteBatch();
//Function: Initialize SpriteBatch
//PostCondition: SpriteBatch is initialized
void Initialize();
//Function: Render 2D plane
//... |
#include <stdio.h>
#define MAXN 10
typedef float ElementType;
ElementType Median( ElementType A[], int N );
int main ()
{
ElementType A[MAXN];
int N, i;
scanf("%d", &N);
for ( i=0; i<N; i++ )
scanf("%f", &A[i]);
printf("%.2f\n", Median(A, N));
return 0;
}
#include <stdlib.h>
#inclu... |
// https://oj.leetcode.com/problems/powx-n/
class Solution {
public:
double pow(double x, int n) {
// not a number
volatile double t = x;
if (t != t) {
return x;
}
if (x == 1.0) {
return 1.0;
} else if (x == -1.0) {
return (n... |
//任意一个5位数,比如:34256,
//把它的各位数字打乱,重新排列,可以得到一个最大的数:65432,一个最小的数23456。
//求这两个数字的差,得:41976,把这个数字再次重复上述过程(如果不足5位,则前边补0)。
//如此往复,数字会落入某个循环圈(称为数字黑洞)。
//比如,刚才的数字会落入:[82962, 75933, 63954, 61974] 这个循环圈。
#include <iostream>
#include <vector>
#include <algorithm>
#define number 5
using namespace std;
vector<int> heidong;
vector<int... |
#include <stdio.h>
#include <string.h>
main()
{
char str[100];
char str1[100];
char str2[100];
int i,j,k,p,h=0,m=0;
printf("Enter a phrase:");
gets(str);
for(p=strlen(str);p>=0;p--)
{
str2[h]=str[p];
h++;
}
for(i=0;i<=strlen(str);i++)
{
if (str... |
template <typename T>
struct unique_handle
{
using THANDLE = typename T::HandleType;
unique_handle(THANDLE h) : handle(h) {}
//NON COPYABLE
unique_handle(const unique_handle&) = delete;
unique_handle& operator=(const unique_handle&) = delete;
//MOVEABLE
unique_handle(unique_handle&& other)... |
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define FOR(i,n) for(ll i=0;i<n;i++)
#define FOR1(i,n) for(ll i=1;i<n;i++)
#define FORn1(i,n) for(ll i=1;i<=n;i++)
#define FORmap(i,mp) for(auto i=mp.begin();i!=mp.end();i++)
#define vll vector<ll>
#define vs vector<string>
#define pb(x) push_... |
/**
* Peripheral Definition File
*
* GPIO - General purpose and alternate function I/Os
*
* MCUs containing this peripheral:
* - STM32H7xx
*/
#pragma once
#include <cstdint>
#include <cstddef>
#include "io/reg/stm32/_common/gpio_v2.hpp"
namespace io {
namespace base {
static const size_t GPIOA = 0x58020000;
stat... |
#pragma once
class ITFMvMBossProgressUserAutoList {};
class CTFMvMBossProgressUser : public ITFMvMBossProgressUserAutoList
{
public:
virtual const char *GetBossProgressImageName() const = 0;
virtual float GetBossStatusProgress() const = 0;
}; |
/*
* Copyright 2021 The Android Open Source Project
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... |
#include <iostream>
#include <string>
#include <stdlib.h>
#include <stdio.h>
#ifdef __unix__
#include <unistd.h>
#endif
#include "sicarioClient.h"
#include "errors.h"
void catchError(unsigned short error) {
if(errorList[error].critical == true) {
std::cerr << errorList[error].text;
exit(error... |
////////////////////////
// Filename: Models.h
////////////////////////
#pragma once
#include <d3d11.h>
#include <D3DX10math.h>
#include "TextureClass.h"
#include <fstream>
#include "objfilemodel.h"
#include "LightShaderClass.h"
#include "LightClass.h"
using namespace std;
/////////////////////////
// Class name: Mod... |
#include "nrfs.h"
#include <sys/time.h>
#define COUNT 50
char name[][10] = {"/file1", "/file2", "/file3", "/file4", "/file5", "/file6"};
nrfs fs;
nrfsFile file;
struct timeval tv;
long long t1, t2;
int thread_num;
int filesize;
char buf[0x10000010];
void filesystem_test()
{
int op, i;
char path[255] = {0};
... |
//
// Created by Ilya on 1/21/2018.
//
#include <sstream>
#include "Mountain.h"
namespace mtm {
Mountain::Mountain(const std::string &name) : Area(name) {
this->dominating_group = "";
}
Mountain::~Mountain() = default;
static void isAreaLegit(const string &group_name, const string &clan,
... |
#include "kmint/ufo/human.hpp"
#include "kmint/random.hpp"
#include <string>
namespace kmint::ufo {
namespace {
constexpr char const *image_path = "resources/human.png";
graphics::image human_image() { return graphics::image{image_path}; }
math::vector2d random_location() {
return {random_scalar(60, 900), random_... |
///
/// @author Florian Feuerstein
///
/// @date 02/2017
///
/// @class ProjectionModel
///
/// @brief
///
#pragma once
#include <Eigen/Core>
#include <memory>
namespace Cvl
{
class ProjectionModel
{
public:
using Uptr = std::unique_ptr<ProjectionModel>;
ProjectionModel(
double focalLengthX,
... |
#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<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... |
#pragma once
#ifndef VERSION_H
constexpr int MAJOR_VERSION = 0;
constexpr int MINOR_VERSION = 0;
constexpr int BUILD_VERSION = 1;
constexpr int YEAR = 2020;
constexpr char AUTHOR[] = "Danylo Lebediev";
#endif // !VERSION_H |
#pragma once
#ifndef ZOMBIEEVENT_HPP
# define ZOMBIEEVENT_HPP
# include "Zombie.hpp"
# include <string>
# include <iostream>
# include <cstdlib>
# include <ctime> // time()
# define NAMES_NUM 7
class ZombieEvent
{
private:
std::string type_;
static std::string names_list_[NAMES_NUM];
int getRandomNumb... |
/* -*- 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.
**
*/
#include "core/pch.h"
#ifdef AUTO_UPDATE_SUPPORT
#include "a... |
#include<iostream>
#include<stdlib.h>
using namespace std;
struct node
{
string s;
struct node*next;
};
typedef struct node Node;
Node *head,*rear,*ptr;
void insertfront(string a)
{
Node *p=(Node*)calloc(1,sizeof(Node));
p->s+=a;
if(head==NULL)
{
head=p;
rear=p;
}
else {
p->next=head;
... |
#define NUM_AVG_VAL 25
// cal constant air = .01027
// cal constant water = .04854
int analogPin = 0;
float val = 0;
float avg = 0;
//float calConstant = 0.01027;
float calConstant = .047921;
int i = 0;
float prevVals[NUM_AVG_VAL];
float distance = 0;
void setup()
{
Serial.begin(9600);
Serial.print("Send any valu... |
/*
kamalsam
*/
#include<iostream>
#include<vector>
using namespace std;
int main()
{
vector<int> v;
int sum=0,c;
int a[101],i,j=0,n;
for(i=1;i<=100;i++)
{
sum+=(i*i);
a[i]=sum;
}
cin>>c;
while(c!=0)
{
v.push_back(c);
cin>>c;
}
for(i=0;i<v.size();i++)
cout<<a[v[i]]<<endl;
return 0;
} |
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
// Простая программа-пример рекурсии. Все рекурсии должны иметь условие для завершения!
// Рекурсия позволяет осуществлять повторяющиеся инструкции без использования циклов.
// V 1.0
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
#include<iostream>
#include <... |
/*
Crayfish - A collection of tools for TUFLOW and other hydraulic modelling packages
Copyright (C) 2016 Lutra Consulting
info at lutraconsulting dot co dot uk
Lutra Consulting
23 Chestnut Close
Burgess Hill
West Sussex
RH15 8HN
This program is free software; you can redistribute it and/or
modify it under the terms o... |
#ifndef PROFILEEDITORUI_HPP
#define PROFILEEDITORUI_HPP
#include <QWidget>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QGroupBox>
class SettingProfileEditorUI : public QWidget
{
Q_OBJECT
public:
explicit SettingProfileEditorUI(QWidget *parent = nullptr);
void in... |
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#include "Hypoxia.h"
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, Hypoxia, "Hypoxia" );
|
#include "calc/Calculator.h"
Calculator::Calculator()
{
adder = new Adder;
}
Calculator::~Calculator()
{
delete adder;
adder = nullptr;
}
double
Calculator::plus(double left, double right)
{
return adder->plus(left, right);
}
double
Calculator::minus(double left, double right)
{
return left - r... |
#pragma once
#include <stdio.h>
/**
* \brief Base Class
*/
class Object {
public:
Object() = default;
virtual ~Object() = default;
virtual char* toString() {
char *buf = new char[32];
sprintf_s(buf, 32,"Object(0x%p)",this);
return buf;
}
}; |
/* iffy: blinkt doesn't seem to work with this project */
#include <stdio.h>
#include <string.h>
#include "pico/stdlib.h"
#include "hardware/spi.h"
#include "hardware/gpio.h"
#include "hardware/pwm.h"
#include "hardware/clocks.h"
#include "hardware/irq.h"
#include "pace.h"
#include "../mcp4921/pico-hard-song-mcp4921/... |
// 导入 ros 头文件
#include "roscpp_tutorials/TwoInts.h"
#include <ros/ros.h>
bool serviceCallback(roscpp_tutorials::TwoInts::Request &request,
roscpp_tutorials::TwoInts::Response &response) {
// 返回值 bool:true代表成功响应,false代表拒绝响应
// 可根据业务实际情况返回相应数据,本例就不做false处理了
response.sum = request.a + r... |
#include "mpi.h"
#include<stdio.h>
#include<stdlib.h>
void Hello(void);
int main(void)
{
int rank,option,size;
MPI_Init(NULL,NULL);
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
MPI_Comm_size(MPI_COMM_WORLD,&size);
if(size<2){
fprintf(stderr, "systest requires at least 2 processors\n");
MPI_Abort(MPI_COMM_WORL... |
// Created on: 1996-01-25
// Created by: Frederic MAUPAS
// 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 GN... |
== 原稿料・デザイン料の決定
原稿料は、この本については出ません。各自の善意によって成り立っている本であり、収益に関しては「技術書界隈を盛り上げる会」の運営に使うことを明記したうえで著者の募集を行っています。
それぞれが「寄稿」という形で少しずつ原稿を書き、みんなで作り上げるという形式の本にしています。
表紙のデザイン料については悩みました。執筆と違い「要件定義」「デザイン」「フィードバック」という工程を何度も繰り返す、かなり負荷の高い作業ですので、デザイン料を設定することにしました。
具体的なデザイン料については、coconalaというCD・書籍デザインを請け負う人たちの集まるポータルサイトを参考に、2万円という価格で合意を... |
#include "testApp.h"
#include "ofxIldaFrame.h"
//--------------------------------------------------------------
void testApp::setup(){
showHud = true;
w = 1.0;//ofGetWidth();
h = 1.0;//ofGetHeight();
ofBackground(0);
// ofSetFrameRate(30);
etherdream.setup();
etherdream.setPPS... |
// Created on: 1999-01-04
// Created by: Xuan PHAM PHU
// Copyright (c) 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 GNU Lesse... |
#pragma once
#include "AncillaryRecord.h"
namespace OpenFlight
{
//-------------------------------------------------------------------------
class OFR_API IndexedStringRecord : public AncillaryRecord
{
public:
IndexedStringRecord() = delete;
explicit IndexedStringRecord(PrimaryRecord... |
#include "stdafx.h"
#ifndef SHARED_HANDLERS
#include "CocosTool.h"
#endif
#include "CocosToolDoc.h"
#include "CocosToolView.h"
#include <CCStdC.h>
#include <CCApplication.h>
#include "MainFrm.h"
#include "GtGLView.h"
#include "GnLayerMain.h"
#include "ActorMacro.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
GnVect... |
#pragma once
#include "EverydayTools/Bitset/EnumBitset.h"
namespace keng::graphics
{
enum class DeviceBufferUsage
{
Default,
Immutable,
Dynamic,
Staging,
Last
};
}
namespace edt
{
template<>
struct enable_enum_bitset<keng::graphics::DeviceBufferUsage>
{
static... |
// -*- Mode: C; indent-tabs-mode: nil -*-
#include "pty.h"
#include "VT100.h"
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <signal.h>
#include <pwd.h>
#include <termios.h>
#include <sys/ioctl.h>
#include <pthread.h>
#include <cstring>
#include <iostream... |
#include<iostream>
#include<vector>
#include<stdlib.h>
#include<fstream>
#include "goldchase.h"
#include "Map.h"
#include<unistd.h>
#include<errno.h>
#include<sys/types.h>
#include <fcntl.h> /* For O_* constants */
#include <sys/stat.h> /* For mode constants */
#include <semaphore.h>
#include <sys/mman... |
class v3 {
public:
float x,y,z;
v3();
v3(float, float, float);
void randomize();
__host__ __device__ void normalize();
__host__ __device__ void scramble();
};
|
#include<iostream>
#include<cstdlib>
using namespace std;
typedef int ElemType;
typedef struct node {
ElemType data;
struct node *next;
}LNode, *LinkList;
LinkList CreateLinkList(int n)
{
LinkList p, q, list = NULL;
ElemType e;
for (int i = 1; i <= n; i ++) {
cout << "Please input number:" << endl;
cin >> e;... |
// Created on: 1994-03-24
// Created by: model
// Copyright (c) 1994-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 GNU Lesser G... |
/*
* Created by Peng Qixiang on 2018/5/27.
*/
/*
* 输入一个整数数组,实现一个函数来调整该数组中数字的顺序。
* 使得所有的奇数位于数组的前半部分,所有的偶数位于位于数组的后半部分
* 并保证奇数和奇数,偶数和偶数之间的相对位置不变。
*
*/
# include <iostream>
# include <vector>
# include <stack>
using namespace std;
void reOrderArray(vector<int> &array) {
stack<int> odd;
stack<int> pair;
... |
#include <iostream>
#include <fstream>
#include <vector>
#include <time.h>
#include "Grafo.h"
#include "No.h"
#include "Adjacencia.h"
#include "Test.h"
int main(int argc, const char *argv[])
{
// GrafosGrupo2.exe instancias/instance_30.txt 20 100 0.2 10 5
if (argc <= 6) {
std::cout << "Uso: nome_do_pr... |
//-----------------------------------graphl.cpp------------------------------
//Johnathan Hewit
//Created: 02/04/2019
//Modified: 02/16/2019
//---------------------------------------------------------------------------
//Purpose: Implementation file for GraphL class. GraphL is designed to read a
// .txt f... |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <quic/state/OutstandingPacket.h>
#include <quic/state/QuicStreamUtilities.h>
#include <quic/state/StateData.h>
namespac... |
#ifndef MULTITIMER_H_MYIDENTIFY_1985
#define MULTITIMER_H_MYIDENTIFY_1985
#include <boost/function.hpp>
namespace threadpool
{
typedef boost::function<void()> task_type;
//used for multi timers.
class multitimer
{
private:
task_type m_timertask;
int m_delaysec;
int m_elapse;
... |
// IPDetective Project
//
// Status: Aborted
//
// by Alessandro Polo 2002
// eWorld Network :: www.ewgate.net
//------------------------------------------------------------------------------
#ifndef mainH
#define mainH
//---------------------------------------------------------------------------
#include <Classes.hpp... |
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
char str[100000000];
main()
{
while(cin>>str)
{
ll len = strlen(str);
ll i, B_cont=0, u_cont=0, l_cont=0, b_cont=0, a_cont=0, s_cont=0, r_cont=0, t_cont=0;
for(i=0; i<len ; i++)
{
if(str[i]=='B')B_cont... |
#include <iostream>
using namespace std;
int main ()
{
int array[1000], element_to_search, size_of_array;
cout<<"Enter the size of the array :- "<<" ";
cin>>size_of_array;
for(int i = 0; i<size_of_array; i++){
cin>>array[i]; //Input by the user
}
cout<<"Enter the element to search :- ";
cin>>ele... |
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <map>
#include <specex_unbls.h>
#include <specex_message.h>
#include <specex_string.h>
#include <specex_trace.h>
#include <specex_spot.h>
#include <specex_spot_array.h>
#include <specex_lamp_lines_utils.h>
#include <specex_fits.h>
#... |
/*In this program we will be seeing about LOOPS in C++ Program*/
/*In C++ while, do while and for are different loop Statements , which is used to execute certain number of codes for certain number of times. That is the code inside the loop will be execute certain number of times till the condition fails and loop come... |
//My solution. Store the postion of each char. Not extendable to K distinct. 4ms
class Solution {
public:
int lengthOfLongestSubstringTwoDistinct(string s) {
vector<int> dict(128, -1);
int i, len = 0, curr = 0, count = 0;
for(i = 0; i < s.length(); ++i){
char c = s[i];
... |
#include<bits/stdc++.h>
#define rep(i,n) for (int i =0; i <(n); i++)
using namespace std;
using ll = long long;
const double PI = 3.14159265358979323846;
int main(){
int N;
string S;
cin >> N >> S;
const ll num = 10000000000;
string S;
cin >> S;
if(S == "1"){
cou... |
//hw2
#include <math.h>
#include <vector>
#include <algorithm>
#include <iostream>
#include <time.h>
#include <set>
//GLOBAL S boxes
int S1[4][4]={{1,0,3,2},{3,2,1,0},{0,2,1,3},{3,1,3,2}};
int S2[4][4]={{0,1,2,3},{2,0,1,3},{3,0,1,0},{2,1,0,3}};
//diffy helman stuff
std::vector<int> divis_2(int num){
// std::co... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** Copyright (C) 1995-2004 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser.
** It may not be distributed under any circumstances.
**
** Edward Welbourne (by copy-and-bodge f... |
#ifndef _NETWORK_H
#define _NETWORK_H
#include <SDL_Net.h>
#include <string.h>
class Network{
private:
TCPsocket socket;
IPaddress myip;
char *hoststring;
Uint16 portnum;
public:
Network(){hoststring=0; portnum=0; socket=0;};
void setPort(Uint16 p){portnum=p;};
void setIp(const char *c){
... |
#ifndef uuid_guard_73cec3fe_6bb746c2_f6bee7d3_851fe697
#define uuid_guard_73cec3fe_6bb746c2_f6bee7d3_851fe697
namespace tul{
namespace crypto{
bool init();
}
}
#endif // uuid_guard_73cec3fe_6bb746c2_f6bee7d3_851fe697
|
class M113Ambul_UN_EP1;
class M113Ambul_UN_EP1_DZ : M113Ambul_UN_EP1 {
scope = 2;
displayName = $STR_VEH_NAME_M113_AMBULANCE_UN;
vehicleClass = "DayZ Epoch Vehicles";
crew = "";
typicalCargo[] = {};
class TransportMagazines{};
class TransportWeapons{};
commanderCanSee = 2+16+32;
gunnerCanSee = 2+16+32;
driver... |
#pragma once
#include <fstream>
#include <string>
#include <cstdio>
#include <vector>
class MapLevel
{
public:
std::vector< std::vector < int > > level_data; // level_data[3][1]
MapLevel();
bool LoadFromFile(std::string path);
bool SaveToFile(std::string path);
int width, height;
};
|
#include <iostream>
#include <vector>
using namespace std;
int computeStairs(int n, vector<int> &memo)
{
if (memo[n] != 0)
return memo[n];
if (n == 1)
return 1;
if (n == 2)
return 2;
else
{
memo[n] = computeStairs(n - 1, memo) + computeStairs(n - 2, memo);
}
... |
#include <vector>
#include <array>
#include <set>
#include <iterator>
#include <fstream>
#include <iostream>
#include "StringUtils.h"
#include <boost/utility/string_view.hpp>
#include <QFile>
#include <QtEndian>
#include <PhoneticService.h>
#include <sndfile.h>
#include <SpeechProcessing.h>
#include <WavUtils.h>
#inclu... |
#include "Merchant.h"
#include "MerchantState.h"
Merchant::Merchant(int id) : BaseGameEntity(id)
{
_sm = new StateMachine<Merchant>(this);
_sm->SetCurrentState(StoreState::Instance());
//_sm->SetGlobalState(FactoryGlobalState::Instance());
}
Merchant::~Merchant()
{
delete _sm; _sm = nullptr;
}
void Merchant::Upd... |
/** Kabuki SDK
@file /.../Source/Kabuki_SDK/_2D/Point_i.cpp
@author Cale McCollough
@copyright Copyright © 2016 Cale McCollough
@license Free and open-source. You can find a copy of the license that YOU MUST READ in the accompanying ./ReadMe.md, file incorporated herein by this reference, ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2011 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*
* @author Arjan van Leeuwen (arjanl)
*/
#ifndef MANAGER_HOLDER_H... |
/*
* File: player.h
* Author: Dirk Vermeir
* Edited by: Wouter Van Rossem
*
*/
#ifndef _PLAYER_H
#define _PLAYER_H
#include <set>
#include <map>
#include <sstream>
#include <dvutil/shared_ptr.h>
#include <dvnet/socket.h>
#include <dvthread/thread.h>
#include <dvthread/mailbox.h>
/** The Player class represe... |
#include <iostream>
using namespace std;
typedef pair<int , int> P;
int main()
{
int n, t; cin >> n >> t;
int ans = 1001;
P ct;
for (int i = 0; i < n; i++) {
cin >> ct.first >> ct.second;
if (ct.second <= t && ct.first < ans) {
ans = ct.first;
}
}
if (ans... |
//////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006 Audiokinetic Inc. / All Rights Reserved
//
//////////////////////////////////////////////////////////////////////
#ifndef _AKVOLUMEAUTOMATION_H_
#define _AKVOLUMEAUTOMATION_H_
#include <AK/SoundEngine/Common/AkTypes.h>
#in... |
#include <sys/stat.h>
#include <signal.h>
#include "IniFile.h"
#include "Configure.h"
#include "Logger.h"
#include "Util.h"
#include "Protocol.h"
#ifndef WIN32
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
#include <getopt.h>
#endif
Configure::Configure() : GameConfig(GAME_TYPE, E_MSG_SOURCE_... |
// Copyright (c) 1999-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 spe... |
/**
* created: 2013-4-9 15:21
* filename: FKLoginSvrConnecter
* author: FreeKnight
* Copyright (C):
* purpose:
*/
//------------------------------------------------------------------------
#include "FKLoginSvrConnecter.h"
#include "FKGameSvrSession.h"
#include "FKDBSvr.h"
#include "FKDBScript.h"
//----------... |
/** Kabuki SDK
@file /.../Source/Kabuki_SDK/include/_Com/MIDI/ShortMessage.h
@author Cale McCollough
@copyright Copyright © 2016 Cale McCollough ©
@license Read accompanying /.../README.md or online at http://www.boost.org/LICENSE_1_0.txt
*/
#pragma once
#include "Message.h"
namespace _... |
#pragma once
#include <string>
#include <Poco/SharedPtr.h>
#include <Poco/JSON/Object.h>
#include <Poco/Net/IPAddress.h>
#include "gwmessage/GWMessage.h"
#include "model/GatewayID.h"
namespace BeeeOn {
/**
* @brief Represents message sent by the gateway after connecting to the server.
* Message is intended to ga... |
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "GameFramework/GameMode.h"
#include "MartellucciGameMode.generated.h"
UCLASS(minimalapi)
class AMartellucciGameMode : public AGameMode
{
GENERATED_BODY()
public:
AMartellucciGameMode(const FObjectInitializer& ObjectInitializer);
};... |
#include <rapidjson/document.h>
#include <rapidjson/writer.h>
#include <rapidjson/stringbuffer.h>
#include "cjson.h"
#include <iostream>
#include <memory.h>
using namespace rapidjson;
struct RapidWriter {
StringBuffer buf;
Writer<StringBuffer> *ptr;
};
#define CONVERT_WRITER_PTR(x) \
struct RapidWriter *... |
class hilux1_civil_1_open;
class hilux1_civil_1_open_DZE: hilux1_civil_1_open {
displayName = "$STR_VEH_NAME_PICKUP_TAN";
vehicleClass = "DayZ Epoch Vehicles";
terrainCoef = 2.5;
crew = "";
typicalCargo[] = {};
class TransportMagazines {};
class TransportWeapons {};
class HitPoints;
supplyRadius = 1.5;
class... |
#pragma once
#include <iostream>
using namespace std;
void InputVector(double a[], int n);
void OutputVector(double a[], int n);
void addVector(double a[], double b[], int n); //cong 2 vector
void multiVector(double a[], int n, double x); //nhan vector voi 1 so thuc |
// RAVEN BEGIN
// bdube: note that this file is no longer merged with Doom3 updates
//
// MERGE_DATE 09/30/2004
#include "../idlib/precompiled.h"
#pragma hdrstop
#include "Game_local.h"
/*
===============================================================================
idItem
====================================... |
#include <cstdio>
#include <iostream>
#include <vector>
#include <string>
using namespace std;
bool isPalindrome(string s){
int length = s.length();
for(int i=0;i<length/2;i++){
if(s[i]!=s[length-1-i]) return false;
}
return true;
}
int minCut(string s){
int length = s.length();
if(length == 1) ret... |
#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pb push_back
#define rep(i, begin, end) \
for (__typeof(end) i = (begin) - ((begin) > (end)); \
i != (end) - ((begin) > (end)); i += 1 - 2 * ((beg... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.