text stringlengths 8 6.88M |
|---|
/*
* LocMando.h
*
* Created on: Nov 6, 2019
* Author: annuar
*/
#ifndef OURS_LOCMANDO_H_
#define OURS_LOCMANDO_H_
#include "Arduino.h"
#include <LocMQTT.h>
#include <pins.h>
//#define MUX_S0 5
//#define MUX_S1 17
//#define MUX_S2 16
class LocMando {
private:
void _processMandoData();
String _mandoRaw... |
/*******************************************************************************
* Cristian Alexandrescu *
* 2163013577ba2bc237f22b3f4d006856 *
* 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ... |
#include "networking\Singularity.Networking.h"
namespace Singularity
{
namespace Networking
{
class NetworkTask : public Singularity::Threading::Task
{
DECLARE_OBJECT_TYPE;
private:
#pragma region Static Variables
static NetworkTask* g_pInstance;
#pragma endregion
#pragma r... |
#include<iostream>
using namespace std;
int greatestOddDivisor(int i) {
int j = i % 2;
int k;
if(j!=0) {
return i;
}
else {
k = greatestOddDivisor(i/2);
return k;
}
}
int main(){
int testCase, temp;
unsigned long long int n , m, sum;
cin>>testCase;
while(testCase > 0) {
int i=1;
sum = 0;
c... |
#include<stdio.h>
#include<stdlib.h>
typedef int SElemType;
typedef struct SNode
{
SElemType data;
struct SNode *next;
}SNode,*LinkStack;
/**************************************************************************************/
/*初识化操作*/
bool InitStack(LinkStack *S)
{
*S = NULL;
return true;
}
/*******************... |
/*
* abcdRandomRotationSource.h
*
* Created on: Dec 2, 2011
* Author: paul
*/
// Julie C Mitchell, Sampling Rotation Groups by Successive Orthogonal
// Image, SIAM J Sci comput. 30(1), 2008, pp 525-547
// Seek R = [u0 u1 u2] where the columns are the images of the unit axis
// vectors under the rotation.
... |
/*************************************************************
* > File Name : P2123.cpp
* > Author : Tony
* > Created Time : 2019/06/13 15:31:22
* > Algorithm : [Greedy]
**************************************************************/
#include <bits/stdc++.h>
using namespace std;
i... |
# define HUD_HPP
# ifndef ANIMATEDSPRITE_HPP
# include <AnimatedSprite.hpp>
# endif
# ifndef ATTRIBUTES_HPP
# include <Attributes.hpp>
# endif
class HUD : public sf::Drawable
{
public:
enum class healtState
{
empty = 0, almost_empty = 1, almost_full = 2, full = 3
};
HUD(const Attributes &, const ... |
#include<stdio.h>
#include<string.h>
int main(){
int n=0;
int count=0;
while(count==n);
printf("tis is working");
printf("oooovd");
return 0;
}
|
#include<bits/stdc++.h>
using namespace std;
int main()
{
vector<string> str;
map<string,set<string>> mp;
int n;
cin >> n;
while(n--) {
string a,b;
cin >> a >> b;
if(!mp.count(b))
str.push_back(b);
mp[b].insert(a);
}
for(auto s : str) {
... |
/*******************************************************************************
* Cristian Alexandrescu *
* 2163013577ba2bc237f22b3f4d006856 *
* 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ... |
#include<iostream>
using namespace std;
int main(){
int N;
cin>>N;
int h[N+1];
int hsl[1];
h[N] = 0;
hsl[0] = 0;
for(int i=0; i<N; i++){
cin>>h[i];
}
int j=0;
while(j<N){
if(h[j]<h[j+1]){
int k=1;
for(int i=j+1; i<N; i++){
k++;
if(h[i]>h[i+1]){
int temp = h[... |
string solution(string &S, int K) {
string str = "";
for (auto it = S.begin(); it != S.end(); ++it) {
if (*it != '-') {
str += toupper(*it);
}
}
int count = 0;
for (auto it = str.end(); it != str.begin(); --it, ++count) {
if (count == K) {
... |
#include<cstdio>
#include<iostream>
using namespace std;
const int maxn=1005;
const int Max=0x3f3f3f3f;
int main()
{
int n,m;
cin>>n >>m;
int a[maxn],j;
int t=Max;
memset(a,0,sizeof(a));
for(int i=0; i<m; i++)
{
cin >> j;
a[j]++;
}
for(int i=1; i<=n; i++)
... |
#ifndef __ELEMENT__
#define __ELEMENT__
#include <string>
#include <sstream>
class element
{
public:
// element symbol
std::string sym;
// atomic weight
double wt;
// chemical potential
double mu;
// thermal debroye wavelength
double tb;
// reference density
double rho;
// min max threshold
double r_min, ... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
vector<int> output;
while(t--)
{
int n;
cin >> n;
int* arr = new int[n];
for(int i=0;i<n;i++)
{
cin >> arr[i];
}
vector<long long> result ;
// 0<= t <= 10^9
for(int i=0;i<n;i+... |
#include "Digger.h"
#include "Controller.h"
#include <iostream>
Digger::Digger() : m_event({}) {}
Digger::Digger(sf::Vector2f location, sf::Vector2f size, sf::Vector2f scale, sf::Color color)
: MobileItem(location, size, scale, color), /*m_rect(location, size, scale, color), */m_starsLoc(location), m_sprite(m_res.ge... |
#pragma once
#include <vulkan\vulkan.h>
#include <vector>
#include <string>
class VulkanShader;
class VulkanDevice;
class VulkanShaderStage
{
VulkanShader* vertexShader = nullptr;
VulkanShader* geometryShader = nullptr;
VulkanShader* fragmentShader = nullptr;
std::vector<VkPipelineShaderStageCreateIn... |
#include <iostream>
#include "Joystick.h"
using namespace std;
Joystick joystick;
void start(void)
{
uint8_t nKeyPressed;
Joystick tempJoystick;
cout << "Enter the mode: ";
cin >> nKeyPressed;
if (nKeyPressed == 'P')
{
cout << "Postavi Mode running!" << endl;
joystick.setMode(MODE_POSTA... |
//
//
//
//
//
#ifndef SECTOR_H
#define SECTOR_H
#include <string>
#include "Planet.h"
#include "Starport.h"
#include "Celestial.h"
const int MAX_CONNECTIONS = 6;
const int MAX_PLANETS = 6;
const int MAX_STARPORTS = 1;
const int MAX_CELESTIALS = 3;
using namespace std;
class Sector
{
public:
Sector();
Sec... |
#ifndef VECTOR3D_HPP
#define VECTOR3D_HPP
#include <iostream>
#include <iomanip>
#include <math.h>
#include "geometry/PrintFormat.hpp"
using namespace std;
template <typename T>
class Vector3D {
public:
/* Members */
const T x;
const T y;
const T z;
/* Constructors */
Vector3D(T x, T y, T z) ... |
// https://www.hackerrank.com/contests/practice-9-sda/challenges/forest-1
#include <cstdio>
#include <vector>
#include <set>
using namespace std;
static const int INF = 1 << 10;
struct Edge {
int to = -1;
int cost = INF;
bool operator<(const Edge &other) const {
if (cost == other.cost) {
... |
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/ObjectMacros.h"
#include "CyLandGizmoActor.h"
#include "CyLandGizmoActiveActor.generated.h"
class UCyLandInfo;
class UCyLandLayerInfoObject;
class UMaterial;
class UMaterialInstance;
class UTexture2... |
#include <string>
#include <mysql++.h>
#include <sys/types.h>
#include <unistd.h>
#include <fstream>
#include "dominio.h"
#include "util.h"
#include "configuracion.h"
#include "servicio.h"
#include "servicioASP.h"
#include <vector>
#include <iostream>
using namespace std;
using namespace mysqlpp;
cServicioASP::cSer... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
bool check(vector<ll>a[],ll x,ll parent,vector<bool>&v){
v[x]=true;
for(ll i=0;i<a[x].size();i++){
if(v[a[x][i]]==true && parent!=a[x][i])
return true;
else if(v[a[x][i]]==false && check(a,a[x][i],x,v))
... |
////////////////////////////////////////////////////////////////////////////////
/// \file
/// \brief Unit tests for some xi::RBTree private implementation
/// \author Sergey Shershakov
/// \version 0.1.0
/// \date 01.05.2017
/// This is a part of the course "Algorithms and Data Structures"
/... |
#include<stdio.h>
#include<stdlib.h>
struct stack
{
int data;
struct stack* next;
};
struct stack* top1=NULL;
struct stack* top2=NULL;
struct stack* nn(int data)
{
struct stack* p=(struct stack*)malloc(sizeof(struct stack));
p->data=data;
p->next=NULL;
return p;
}
void insert()
{
int data;
struct stack* ptr;
... |
/// @file gatemgr_test.cc
/// @brief GateMgr のテストプログラム
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2013 Yusuke Matsunaga
/// All rights reserved.
#include "led_nsdef.h"
#include "GateObj.h"
#include "GateMgr.h"
#include "GateColor.h"
BEGIN_NAMESPACE_YM_LED
class GateMgrTestWidget :
public QWidge... |
#include <iostream>
#include <queue>
#include <algorithm>
#include <vector>
using namespace std;
int isvisit[1001][1001];
queue<pair<int,int>> q;
int main() {
int N;
cin >> N;
isvisit[1][0] = 0;
q.push({1,0});
while(!q.empty()){
int screen = q.front().first;
int clipboard = q.front().second;
q.po... |
#include "Utils/Logger.h"
namespace vazgen {
namespace {
spdlog::level::level_enum get_spdlog_level(Logger::Level level)
{
switch (level) {
case Logger::INFO:
return spdlog::level::level_enum::info;
case Logger::WARN:
return spdlog::level::level_enum::warn;
case Logger::ERR:
r... |
#include "mainwindow.h"
#include <QApplication>
#include <QSplashScreen>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QSplashScreen *splash = new QSplashScreen;
splash->setPixmap(QPixmap(":/images/moji.jpg"));
splash->show();
MainWindow *mainWin = new MainWindow;
mainWin->... |
#ifndef _APP_EVENT_HANDLER_H_
#define _APP_EVENT_HANDLER_H_
#include "base/nextai_app.h"
class AppEventHandler : public NextAI::AppEventListener
{
public:
static AppEventHandler* instance();
virtual NextAI::ListenerResult initStarted();
virtual NextAI::ListenerResult initCompleted();
virtual NextAI::ListenerRe... |
#pragma once
struct Data;
namespace Reader
{
Data readData(std::istream & in);
};
|
/***********************************************************************
*
* Copyright (c) 2012 Alcatel-Lucent Technologies.
* All rights reserved.
*
* ALL RIGHTS ARE RESERVED BY ALCATEL-LUCENT TECHNOLOGIES.
* ACCESS TO THIS SOURCE CODE IS STRICTLY RESTRICTED
* UNDER CONTRACT. THIS CODE IS TO BE KEPT STRICT... |
#include "AsmOperand.h"
#include "AsmOperandParser.h"
#include "AsmParserToken.h"
std::string Operand::GetString()const {
if (type == Type::RegisterValue) {
return Register::GetRegisterString(data.base);
}
else if (type == Type::ImmediateValue) {
return std::to_string(data.displacement);
}
else if (type == Typ... |
#include "MKL26Z4.h"
#include "pin.h"
#include "spi.h"
#include "intrpt.h"
#include "delay.h"
#ifndef NRF24L01_H
#define NRF24L01_H
namespace nrf24Def
{
//CE
const Gpio::Port cePort = Gpio::D;
const uint8_t cePin = 0;
//CS
const Gpio::Port csPort = Gpio::E;
const uint8_t csPin = 16;
//IRQ
const Gpio:... |
#include "stdafx.h"
#include <ulib/debug/DebugLoop.hpp>
#include <ulib/debug/ProcessMemory.hpp>
#include <ulib/debug/ToolHelp.hpp>
#include <ulib/win32/ErrorMessage.hpp>
#include <vector>
#ifdef UNICODE
#define DBGHELP_TRANSLATE_TCHAR
#endif
#pragma warning(push)
#pragma warning(disable: 4091) // 'typedef ': ignored o... |
#include "memory.h"
#include <list>
#ifdef TRACE_MEMORY_LEAKS
#ifdef _DEBUG
// Allocation info
typedef struct {
DWORD address;
DWORD size;
char file[64];
DWORD line;
} ALLOC_INFO;
// A list with memory allocations
typedef std::list<ALLOC_INFO*> AllocList;
AllocList *allocList;
void AddTrack(DW... |
#include "Posicion.hpp" |
/* path_test.cpp -*- C++ -*-
Rémi Attab (remi.attab@gmail.com), 30 Apr 2014
FreeBSD-style copyright and disclaimer apply
Tests for pathing utility
This test is a leaky boat but cleaning up isn't worh the effort.
*/
#define BOOST_TEST_MAIN
#define BOOST_TEST_DYN_LINK
#defin... |
#include "stenographer.h"
#include "wavpcmfile.h"
#include "recthread.h"
#include "googlespeech.h"
#include "downloadandplay.h"
#include <QFile>
#include <QDir>
#include <QTextStream>
#include <QUrl>
#include <QTranslator>
Stenographer::Stenographer(QObject *parent) :
QObject(parent)
{
this->l... |
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <iostream>
using namespace std;
class ReverseInteger {
public:
int reverse(int x);
int reverse2(int x);
void Main();
~ReverseInteger() {};
}; |
#include "stdafx.h"
int main()
{
int i, j, sum;
for (i = 2; i <= 1000; i++)
{
sum = 1;
for (j = 2; j <= i / 2; j++)
if (i%j == 0)
sum += j;
if (sum == i)
{
printf("%d its factors are 1, ", i);
for (j = 2; j <= i / 2; j++)
if (i%j == 0)
printf("%d, ", j); ... |
/*
* Hacker's Monitor for XFCE Generic Monitor applet
* Copyright (C) 2015-2018 Ciriaco Garcia de Celis
*
* This program 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 Software Foundation; either version 2
* of the License... |
#include <iostream>
#include <unistd.h>
#include <vector>
#include <sys/wait.h>
#include <sstream>
#include <iterator>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <cstddef>
#include <numeric>
#include <functional>
using namespace std;
int main()
{
const string filePath = "/bin/"; // Helps lo... |
#include <iostream>
#include <set>
#include <algorithm>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
set<string, greater<string>> s;
string name, state;
int N;
cin>>N;
for(int i=0; i< N; i++){
cin>>name>>state;
if(state == "leave")
... |
#pragma once
#include "../pch.h"
#include "GameEngine.h"
#include "../GameCore/GameBuilder.h"
#include "../GameCore/GameCore.h"
#include "../GameCore/GameReport.h"
#include "GameContext.h"
#include "PlayerContext.h"
#include "PlayerType.h"
#include "GameEnginePrompts.h"
GameEngine::GameEngine()
{
}
GameContext GameEn... |
#include "algorytmy2.h"
double czas(clock_t poczatek, clock_t koniec)
{
double p,k;
p=static_cast < double >( poczatek ) / CLOCKS_PER_SEC;
k=static_cast < double >( koniec ) / CLOCKS_PER_SEC;
return (k-p) *(1000/60);
}
void czysc(Wynik tab[M])
{
for(int i=0; i<M; i++)
{
... |
#ifndef _TNA_MESHDATA_H_
#define _TNA_MESHDATA_H_
#include "../common.h"
#include "buffer.h"
#include "../shapes/aabb.h"
namespace tna
{
struct mesh_data_t
{
vertex_buffer_t* m_vertex_buffer;
index_buffer_t* m_index_buffer;
uint32_t m_num_vertices;
uint32_t m_num_indices;
aabb_t ... |
#include <iostream>
#include <stdlib.h>
#include <string>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <iomanip>
using namespace std;
int main(int argc, char *argv[]){
//boot up message
cout<<"The client is up and running\n";
... |
#include <iostream>
using namespace std;
int numero[5];
void arreglo (int numero[])
{
for (int i=0; i<5;i++)
{
cout<<"Ingresar Numero...";
cin>>numero[i];
}
for (int i=0; i<5;i++)
{
cout<<"Numero..."<<numero[i]<<"\n";
}
}
float promedio (int numero[])
{
int i;
... |
#include "easytf/operators/op_lstm.h"
#include "easytf/operators/op_sigmoid.h"
#include "easytf/operators/op_tanh.h"
#include "easytf/easytf_assert.h"
#include "easytf/easytf_logger.h"
easytf::OP_LSTM::OP_LSTM(const int32_t input_dim, const int32_t output_dim, const bool output_sequence,
const float32_t* wih, const f... |
// CharacterArray
#include <iostream>
using namespace std;
int main(){
char a[100]={'H','A','R','R','Y','\0'};
char b[]={'H','A','R','R','Y','\0'};
char d[5]={'X','Y','C','D','\0'};
char c[6]="Hello";
cout<<a<<endl;
cout<<&a[0]<<endl;
cout<<&a[1]<<endl;
cout<<&a[2]<<endl;
cout<<&a[3]<<endl;
cout<<a[0]<<end... |
//
// Created by 邓岩 on 2019/5/22.
//
/*
* 约数倍数选卡片
问题描述
闲暇时,福尔摩斯和华生玩一个游戏:
在N张卡片上写有N个整数。两人轮流拿走一张卡片。要求下一个人拿的数字一定是前一个人拿的数字的约数或倍数。例如,某次福尔摩斯拿走的卡片上写着数字“6”,则接下来华生可以拿的数字包括:
1,2,3, 6,12,18,24 ....
当轮到某一方拿卡片时,没有满足要求的卡片可选,则该方为输方。
请你利用计算机的优势计算一下,在已知所有卡片上的数字和可选哪些数字的条件下,怎样选择才能保证必胜!
当选多个数字都可以必胜时,输出其中最小的数字。如果无论如何都会输,则输出-1... |
/*
* Coordinates.h
*
* Created on: 29 May 2011
* Author: "SevenMachines <SevenMachines@yahoo.co.uk>"
*/
#define COORDINATES_DEBUG
#ifndef COORDINATES_H_
#define COORDINATES_H_
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
namespace cryomesh {
namespace spacial {
template<... |
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell... |
#include <iostream>
#
#include "FileExplorer.h"
using namespace std;
int main()
{
FileExplorer explorer;
int command;
do
{
cin >> command;
switch(command) {
case 1: // open
case 2: // more
case 3: // go back
case 4: // go forward
... |
/****************/
/* Oleksandr Diachenko */
/* Date */
/* CS 244B */
/* Spring 2016 */
/****************/
#define DEBUG
#include <stdio.h>
#include <server.h>
#include <fcntl.h>
#include <fstream>
#include <map>
#include <sstream>
#include <sys/stat.h>
/* -----------------------------------------------------------... |
#include<bits/stdc++.h>
#include<stdio.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
#define ll long long
#define fr(i,n) for (ll i=0;i<n;i++)
#define fr1(i,n) for(ll i=1;i<=n;i++)
#define l(s) s.size()
int main()
{
... |
/*
Tu Tran
Programming II
Due: July 2, 18
Webpage
Input data to webpage, return another webpage
*/
#include <iostream>
#include <string>
#include "choice.cpp"
using namespace std;
int main(int argc, char *argv[])
{
string input;
cin >> input;
choice(input);
return 0;
}
|
/*
* MainMenu.h
*
* Created on: 16 сент. 2017 г.
* Author: Соня
*/
#ifndef MAINMENU_H_
#define MAINMENU_H_
class MainMenu {
public:
MainMenu();
virtual ~MainMenu();
};
#endif /* MAINMENU_H_ */
|
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006-2010 MStar Semiconductor, Inc.
// All rights reserved.
//
// Unless otherwise stipulated in writing, any and all information contained
// herein regardless in any format shall remain the sole proprietary of
... |
// node_b28Dlg.h : header file
//
#if !defined(AFX_NODE_B28DLG_H__169F2837_7F47_48D6_965E_2D14E5CEA363__INCLUDED_)
#define AFX_NODE_B28DLG_H__169F2837_7F47_48D6_965E_2D14E5CEA363__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//////////////////////////////////////////////////////////... |
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006-2010 MStar Semiconductor, Inc.
// All rights reserved.
//
// Unless otherwise stipulated in writing, any and all information contained
// herein regardless in any format shall remain the sole proprietary of
... |
#include <iostream>
#include <WinSock2.h>
using namespace std;
DWORD WINAPI ThreadFunc(LPVOID threadParameter)
{
SOCKET clientSocket = *((SOCKET*)threadParameter);
// Считываем строку.
char line[256];
size_t length = (size_t)recv(clientSocket, line, sizeof(line), 0);
line[length] = '\0';
cout... |
#pragma once
#include "Common.h"
class AnimSet;
struct Bone;
using BoneVec = vector< Bone* >;
struct MeshTexture;
using MeshTextureVec = vector< MeshTexture* >;
struct Effect;
using EffectVec = vector< Effect* >;
struct EffectDefault;
struct EffectPass;
class File;
class GraphicLoader
{
// Model... |
//All functionality and structs pertaining to the barrier modifier go in this file
float4 OutputBarrierPosition(float3 position, float3 velocity, float3 acceleration, float age, float interval, float3 controlPoint)
{
position = position + velocity * age;
return float4(position, 1.0f);
} |
// $Id: DIV.h,v 1.10 2013/02/09 19:00:34 david Exp $ -*- c++ -*-
#ifndef __CDK8_NODE_EXPRESSION_DIV_H__
#define __CDK8_NODE_EXPRESSION_DIV_H__
#include <cdk/nodes/expressions/BinaryExpression.h>
#include "SemanticProcessor.h"
namespace cdk {
namespace node {
namespace expression {
/**
* Class for ... |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef set<int> si;
typedef map<string, int> msi;
typed... |
#include "Main.hpp"
#include "File_handler.hpp"
#include <stdio.h>
TFile_handler::TFile_handler()
{
first_menu=new(Tmenu);
}
void TFile_handler::change_handle()
{
char file_name[MAXLINE];
try{
std::cout<<"Please give me the name of your file: "<<std::endl;
std::cin.get(file_name,MAXLINE-2);
... |
#include <iostream>
using namespace std;
int main()
{
int num;
do
{
int sum;
cout << "Enter a number: " << endl;
cin >> num;
if(num > 0)
{
sum = sum + num;
}
}while(num > 0);
cout << "The sum of all positive numbers... |
#include "View.h"
View::View(Model* m)
{
model = m;
window.create(model->dims, "Heroes Always Die");
fps = 60;
//background pic
Bak.setTexture(manager.get_texture("assets/bak.png", sf::Color::White));
Bak.setPosition(0, 0);
/* load textures and set them to the sprites */
//loading menu and end... |
void deleteMiddle(stack<int> &s,int mid)
{
if(s.size()==mid)
{
s.pop();
return;
}
int a=s.top();
s.pop();
deleteMiddle(s,mid);
s.push(a);
return;
}
void deleteMid(stack<int>&s, int sizeOfStack)
{
delete... |
class Solution {
public:
static bool cmp(const vector<int>& a, const vector<int>& b) { // 比较,从小到大排序
return a[0] < b[0];
}
int findMinArrowShots(vector<vector<int>>& points) {
if (points.size() == 0) return 0; // 特判
sort(points.begin(), points.end(), cmp);
int result =... |
#ifndef CLIENT_H
#define CLIENT_H
#include <QString>
#include <QSqlQuery>
#include <QSqlQueryModel>
class Client
{public:
Client();
Client(int,QString,QString);
QString get_nom();
QString get_prenom();
int get_id();
bool ajouter();
QSqlQueryModel * afficher();
bool supprimer(int);
bo... |
// 3_1. ポインタを理解しよう!! (メモリとアドレス)
// ポインタを使って配列を扱おう
#include <iostream>
int main(){
int a[5]{0}; // 豆知識:=をつけなくてもC++11から配列の初期化はできます.
// sizeofは静的確保したメモリのバイト数を調べる関数です.
// sizeofを使うことで配列の要素数を知ることができます.ただし,動的確保では使えません.
std::cout << "int型のByte数は?:" << sizeof(int) << "(4 * 8bit = 32bit)" << std::endl;
f... |
/*
*
*/
#include "rocket.h"
Rocket::Rocket(Terrain *terrain)
: Object(terrain)
{
object_type_ = Object::ROCKET;
horizontal_speed() = 30; // set speed_z
collision_radius() = 0.01;
// get_acceleration() = Vector(0, 0, 0); // 加速度
md2_ = new ModelMD2();
md2_->Load((char*) "models... |
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<math.h>
#define MAXN 10005
using namespace std;
int ans[MAXN][MAXN],num[MAXN];
void Find_m_n(int N, int &m, int &n){
int sqr = (int)sqrt((double)N);
//printf("%d\n",sqr);
int a[200],b[200],cnt;
cnt = 0;
for(int i = 1; i <= sqr; i++){
... |
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
int v1,v2,t,s,l;
cin >> v1 >> v2 >>t>> s >> l;
int r=0,e=0;
int temp = 0;
int m = 0;
while(true){
m++;
e = e+v2;
if(temp==0){
r = r+v1;
if(r-e>=t)temp = s;
}else temp--;
if(r>=l||e>=l)break;
}
if(r>=l&&e>=l)cout<<"D"<<endl;... |
/* A Bison parser, made by GNU Bison 3.8.2. */
/* Skeleton implementation for Bison GLR parsers in C
Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
... |
#ifndef KALMAN_FILTER_TOOLBOX_H
#define KALMAN_FILTER_TOOLBOX_H
#include <opencv2/video/tracking.hpp>
#include "dataType.h"
using namespace std;
using namespace cv;
class KalmanFilterToolBox
{
public:
KalmanFilterToolBox(int ndim, double dt, const DETECTBOX &measurement);
~KalmanFilterToolBox();
static c... |
/*******************************************************************************
* Cristian Alexandrescu *
* 2163013577ba2bc237f22b3f4d006856 *
* 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ... |
#ifndef GRAVITY_H
#define GRAVITY_H
#include<QVector3D>
#include<rigidbody.h>
class Gravity
{
public:
Gravity(const QVector3D &m_gravity);
private:
QVector3D gravity;
public:
virtual void updateForce(RigidBody *body, float duration);
};
#endif // GRAVITY_H
|
#pragma once
#include <string>
#include <distant/scoped_handle.hpp>
namespace distant::synch
{
class event
{
public:
/// @brief Create an event object with a randomly-generated name.
/// @remark The event is constructed in an unsignaled state.
/// @exception Throws a winapi_error in the event that an API ca... |
#ifndef FlopBanks_H
#define FlopBanks_H
#pragma once
#include "..\..\AppTurnTree\Source\TreeBanks.h"
#include "..\..\..\..\Util\TemplateFileRec.h"
#include "..\..\..\..\Util\FileSwapping.h"
#include "..\..\..\..\Util\FileRec64.h"
#include "..\..\..\..\NeuroNet\NeuroNet.h"
#include "FlopTree.h"
//--------------------... |
#include "loginwindow.h"
#include "mainwindow.h"
#include "ui_loginwindow.h"
void processLoginData(QString in);
LoginWindow::LoginWindow(QWidget *parent) : QDialog(parent), ui(new Ui::LoginWindow)
{
ui->setupUi(this);
//---------------------------------------------- Window Customization
this->setWindowTi... |
#include <iostream>
using namespace std;
void Swap(int& a, int& b)
{
int temp = b;
b = a;
a = temp;
}
void Swap(int* a, int* b)
{
int temp = *b;
*b = *a;
*a = temp;
}
int* FindMax(int arr[], int num)
{
int* max = arr;
for (int i = 0; i < num; ++i)
{
if (arr[i] > *max)
{
*max = arr[i];
}
}
return m... |
#include <iostream>
#define N 10
using namespace std;
void shellSort(int* arr, int n) {
for (int gap = n / 2; gap > 0; gap /= 2) {
for (int i = gap; i < n; ++i) {
int current = arr[i];
int j = i;
while (j >= gap && arr[j - gap] > current) {
arr[j] = arr[j - gap];
j = j - gap;
}
arr[j] = curre... |
//! Bismillahi-Rahamanirahim.
/** ========================================**
** @Author: Md. Abu Farhad ( RUET, CSE'15)
** @Category:
/** ========================================**/
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define ll long long
#define scl(n) cin>... |
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// 1010LevelMeter - target: the 1010music Euroshield with the PJRC Teensy 3.2
//
// This sketch demonstrates a simple level meter using the IN 1/2 as audio inputs
// and the 4 LEDs as a bar graph.
//
// This code is in the p... |
#include <string.h>
#include "logger.h"
static const int MAX_LOG_FILE_SIZE = 1024 * 1024 * 10; // 滚动日志的最大大小
static const int MAX_LOG_FILE_COUNT = 10; // 滚动日志的最大份数
static char g_szLogBuff[512];
static char g_szLogBuffFuncionLine[1024];
Logger* Logger::m_ins = NULL;
Logger::Logger()
{
... |
// OPini.cpp: implementation of the COPini class.
#include "StdAfx.h"
#include "OPini.h"
COPini::COPini()
{
}
COPini::~COPini()
{
}
BOOL COPini::WriteString(LPCTSTR section, LPCTSTR key, char *stringtoadd, char *filename)
{
return ::WritePrivateProfileString(section,key,stringtoadd,filename);
}
DWORD COPini... |
/* Copyright (C) 2015 Willi Menapace <willi.menapace@gmail.com>, Simone Lorengo - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited
* Proprietary and confidential
* Written by Willi Menapace <willi.menapace@gmail.com>
*/
#ifndef XBEE_FRAMEABLE_PACKET_INCLUDED
#de... |
#include "Item.h"
Item::Item(ItemType type, std::string name)
{
this->type = type;
this->size_ = 1;
// Many ifs because we can't switch case with strings
switch(type)
{
case HEAL:
if(name == "civilian-medkit")
{
this->effect = 25;
this->setPixmap(QPixmap... |
/*******************************************************************************
* Cristian Alexandrescu *
* 2163013577ba2bc237f22b3f4d006856 *
* 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ... |
/***************************************************************************
Copyright (c) 2020 Philip Fortier
This program 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 Software Foundation; either version 2
of the License, or... |
/* Copyright (c) 2013 Richard Russon (FlatCap)
*
* This program 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 Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* This program... |
#include <cstdio>
#include <algorithm>
using namespace std;
struct Student
{
char id[20 + 1];
int tgrades;
bool flag;
}stu[1000];
bool cmp(Student stu1, Student stu2)
{
if (stu1.tgrades != stu2.tgrades)
return stu1.tgrades > stu2.tgrades;
else
return stu1.id < stu2.id;
}
void init... |
#include "../header/DlgSettings.h"
/////////////////////////////////////////////////////////////////////////
DlgSettings::DlgSettings(QList<List> &listButtons, QDialog* pDlg): QDialog(pDlg)
{
QTextCodec *codec = QTextCodec::codecForName("cp1251");
QTextCodec::setCodecForTr(codec);
// настройка шрифта
QFont font... |
#ifndef RESOURCELIB_TEXTUREHANDLER_TEXTUREHANDLER_H
#define RESOURCELIB_TEXTUREHANDLER_TEXTUREHANDLER_H
#include "FileLoader.h"
#include "FileHeaders.h"
#include "Texture.h"
#include "TextureLoader\DDSTextureLoader.h"
namespace Resources
{
class TextureHandler
{
private:
std::string TEXTURE_PATH = "../Assets/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.