text stringlengths 8 6.88M |
|---|
#include <iostream>
class Marks {
private:
int rollNo;
std::string name;
public:
double mark;
void getDetails(int i) {
std::cout << "Name of student " << i + 1 << ": " << std::endl;
std::cin >> name;
rollNo = i + 1;
}
void calAvg(double p, double c, do... |
#include <iostream>
#include "CORETimer.h"
using namespace CORE;
using namespace std::chrono;
double CORETimer::Get() {
if(m_started && !m_stopped) {
return GetTime() - m_startTime;
} else if(m_started && m_stopped) {
return m_stopTime - m_startTime;
}
//TODO: Log -> Error, m_timer has... |
#ifndef KEYWORD_SUGGESTION_SERVER_INCLUDE_ONLINE_TCP_SERVER_H_
#define KEYWORD_SUGGESTION_SERVER_INCLUDE_ONLINE_TCP_SERVER_H_
#include "acceptor.h"
#include "event_loop.h"
#include "tcp.h"
namespace keyword_suggestion {
class TcpServer {
public:
TcpServer(int port, const std::string &ip = "0.0.0.0");
void Star... |
#include "Window.h"
using namespace Win32Application;
Window::Window(WNDPROC mainWindowProc) :
m_fullscreen(true),
m_clientWidth(1000),
m_clientHeight(600)
{
if (!Initialize(mainWindowProc))
throw std::exception("Failed to create window.");
}
Window::~Window()
{
Shutdown();
}
HINSTANCE Window::GetHInstance() ... |
#include "stdafx.h"
#include "Camera.h"
#include "Player.h"
#include "Weapon.h"
CCamera::CCamera()
{
m_xmf3Position = XMFLOAT3(0.0f, 0.0f, 0.0f);
m_xmf3Right = XMFLOAT3(1.0f, 0.0f, 0.0f);
m_xmf3Up = XMFLOAT3(0.0f, 1.0f, 0.0f);
m_xmf3Look = XMFLOAT3(0.0f, 0.0f, 1.0f);
m_fPitch = 0.0f;
m_fRoll = 0.0f;
m_fYaw = 0... |
#include "CppUnitTest.h"
#include "../Shape/gameObject.h"
#include "../Shape/point.h"
#include "../Shape/ball.h"
#include "../AnimationRender/WindowRender.h"
#include "../AnimationRender/WindowEvent.h"
#include "FakeWindowAPI.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
using namespace GameObjects... |
/*
* SPDX-FileCopyrightText: (C) 2014 Daniel Nicoletti <dantti12@gmail.com>
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "embeddedapp.h"
#include "root.h"
#include <Cutelyst/Plugins/Session/Session>
#include <QCoreApplication>
#include <QDebug>
EmbeddedApp::EmbeddedApp(QObject *parent)
: Cutelyst::App... |
//
// Created by abrdej on 10.01.18.
//
#ifndef PIGEONWAR_ANIMATIONS_HANDLERS_H
#define PIGEONWAR_ANIMATIONS_HANDLERS_H
#include <iostream>
#include "animations_service.h"
#include "gui/board_panel.h"
#include "oxygine-framework.h"
#include "res.h"
#include "sprites/sprites_manager.h"
template <typename... DataTypes... |
#ifndef MAPPOINT_H
#define MAPPOINT_H
#include <opencv2/core/core.hpp>
#include "keyframe.h"
class MapPoint
{
public:
long int id;
cv::Mat world_pose;
// Keyframes observing the point
std::vector<KeyFrame*> observations;
std::map<KeyFrame*, size_t> mObs;
};
#endif |
#include <iostream>
#include <mpi.h>
#include <map>
#include <string>
#include <vector>
#include <set>
#include <iomanip>
using namespace std;
#define ROOT 0
void master(vector<vector<int>>& matrix, int block_size, int blocks_count, int lines_per_slave){
vector<int> initialLine(matrix.size());
for (int i = 0... |
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
#include "stdafx.h"
#include "D3DBase.h"
#include "SettingsManager.h"
using namespace Common;
using namespace GraphicsEngine;
using namespace Microsoft::WRL;
using namespace std;
D3DBase::D3DBase(HWND outputWindow, uint32_t clientWidth, uint32_t clientHeight, bool fullscreen) :
m_outputWindow(outputWindow),
m_clie... |
class Particule {
public:
Particule(sf::Texture const& texture, std::vector<sf::IntRect> const& rectText, sf::Vector2f pos, float const& tempsEntreSprite = 0.10)
: tempsEntreSprite_(tempsEntreSprite), actuel_(0), rectText_(rectText), sprite_(texture, rectText_[0]) {
sprite_.setOrigin({ sprite_.getLocalBound... |
//
// Copyright Jason Rice 2015
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#include <mpdef/append_if.hpp>
#include <boost/hana.hpp>
namespace hana = boost::hana;
int main()
{
{
constexpr auto xs... |
#ifndef __DUI_FONT_H__
#define __DUI_FONT_H__
#include "DUIBase.h"
#include "DUIColor.h"
DUI_BGN_NAMESPCE
class DUILIB_API CFontObject: public CDUIObject
{
public:
CFontObject();
~CFontObject();
BOOL CreateFont();
BOOL IsNull() const;
HFONT GetFont() const;
VOID SetHeight(INT nHeight);
VOID SetWeight(INT ... |
#ifndef POLYGON_H
#define POLYGON_H
#include <iostream>
#include <vector>
#include "../Point/point.h"
#include "../Line/line.h"
#include "../Triangle/triangle.h"
#include "../Vector/vector.h"
#include "../Shape/shape.h"
class Polygon : public Shape
{
private:
std::vector<Point*> vertices;
std::vector<Triangle... |
#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 set<int> si;
typedef map<string, int> msi;
typedef long long ll;
const ll INF = 1e18L + 1;
bool ... |
#pragma once
#include "layer.h"
#include "shared_workspace_memory.h"
namespace transprecision_floating_point
{
template<typename T>
struct conv2d_layer : layer
{
template<typename WeightsInitializer, typename BiasInitializer>
static conv2d_layer make_conv2d_layer(
size_t in_channels, size_t out_channels,
... |
#include <sstream>
#include <algorithm>
#include <iostream>
#include "Commands.h"
#include "GlobalVariables.h"
using namespace std;
MkdirCommand::MkdirCommand(string args) :BaseCommand(args) {}
void MkdirCommand::execute(FileSystem & fs){
if (verbose==2||verbose==3)
cout<<toString()+" "+getArgs()<<endl;... |
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define ll long long
int main()
{
ll i,n,pow2[35],ans=0;
cin>>n;
while(n)
{
if(n&1)ans+=1;
n/=2;
}
cout<<ans<<endl;
return 0;
}
|
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
typedef long long ll;
const int maxn = 50005;
int n, m;
vector<int> G[maxn];
int dTime[maxn], lowlink[maxn];
int dfsClock = 0, scc[maxn], sccNo = 0;
stack<int> s;
vector<int> vec, ans;
... |
/*******************************************************************************
* Cristian Alexandrescu *
* 2163013577ba2bc237f22b3f4d006856 *
* 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ... |
#pragma once
#include "BasicControl.h"
namespace Controller {
class Velocity final : public BasicControl {
public:
using BasicControl::BasicControl;
void stop() override final;
bool update() override;
};
} // namespace Controller
|
#include<bits/stdc++.h>
using namespace std;
int solve(string input,int k)
{
int n = input.size();
if(k > n)
{
return -1;
}
unordered_map<string,int> hash;
for(int i=0;i<=n-k;i++)
{
string cur = input.substr(i,k);
hash[cur]+=1;
}
for(int i=0;i<=n-k;i++)
{
string cur = input.substr(i,k);
if(hash[... |
//--------------------------------------------------------------
//--------------------------------------------------------------
//
// AngraSimulation Sensitive Detector implementation file
//
// Authors: P.Chimenti
//
// 3-08-2009, v0.01
//
//--------------------------------------------------------------
//-----... |
//
// test_document.cpp
// TextRetrieval
//
// Created by Joseph Canero on 11/15/15.
// Copyright © 2015 jcanero. All rights reserved.
//
#include "catch.hpp"
#include "document.h"
#include "config.h"
TEST_CASE("Document Class", "[doc]") {
Document d(TEST_PATH);
SECTION("Can get a path from the docum... |
#include <iostream>
#include "Factory.h"
std::shared_ptr<IDrink> Factory::create(const DrinkType &type)
{
if (type == DrinkType::Water)
{
std::cout << "[Factory] Get Water Drink" << std::endl;
return std::make_shared<Water>();
}
else if (type == DrinkType::Cola)
{
std::cout... |
#include "utils.h"
double *generateRandomDoubuleNumber(int num, double start, double gap) {
using namespace std;
vector<double> temp;
for (int i = 0; i < num; ++i) {
temp.push_back(start + i * gap);
}
random_shuffle(temp.begin(), temp.end());
double *arr = new double[temp.size()];
... |
/*************************************************************
* > File Name : c1074_1.cpp
* > Author : Tony
* > Created Time : 2019/10/12 16:00:02
* > Algorithm :
**************************************************************/
#include <bits/stdc++.h>
using namespace std;
inline ... |
#include <jni.h>
#include <string>
extern "C"
JNIEXPORT jstring JNICALL
Java_qukakac_net_qqq_MainActivity_stringFromJNI(
JNIEnv* env,
jobject /* this */) {
std::string hello = "Hello from C++";
return env->NewStringUTF(hello.c_str());
}
extern "C"{
extern int main(int argc,char * argv[]);
... |
#include "mainwindow.h"
#include "ui_mainwindow.h"
int cont = 0;
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(ui -> btn1, SIGNAL(clicked()), this, SLOT(clickButton()));
connect(ui -> btn2, SIGNAL(clicked()), this, SLOT(clickBut... |
#pragma once
#include <landstalker-lib/patches/game_patch.hpp>
#include <landstalker-lib/model/entity_type.hpp>
#include "../../randomizer_options.hpp"
/**
* Apply all of the difficulty factor settings on the enemy internal values.
* This must be done as a patch and not as a function inside "apply_randomizer_option... |
#include "Trapezoid.h"
Trapezoid::Trapezoid(float L, float r, float u, float d ,float h ) :Quad(L, r, u, d)
{
height = h;
}
void Trapezoid::SetHeight(float h)
{
height = h;
}
float Trapezoid::GetHeight()const
{
return height;
}
float Trapezoid::Area()
{
float a;
a = height;
a *= GetUp() +... |
/*
* Copyright (c) 2009-2012 Andr� Tupinamb� (andrelrt@gmail.com)
*
* 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... |
//
// Created by wojtekreg on 15.01.18.
//
#include "Lokata.h"
Lokata::Lokata(std::string opis, double wartosc, double oprocentowanie, int czasTrwania) : Aktywa(opis, wartosc){
setOprocentowanie(oprocentowanie);
setCzasTrwania(czasTrwania);
}
void Lokata::setOprocentowanie(double oprocentowanie) {
if(opr... |
//
// open.h
// game2
//
// Created by MBA on 11/26/14.
// Copyright (c) 2014 MBA. All rights reserved.
//
#ifndef game2_open_h
#define game2_open_h
#include "global.h"
#include <stdbool.h>
//The button states in the sprite sheet
const int CLIP_MOUSEOVER = 0;
const int CLIP_MOUSEOUT = 1;
const int CLIP_MOUSEDOWN ... |
#include "mvApp.h"
#include "mvCore.h"
#include "mvLogger.h"
#include "AppItems/mvAppItems.h"
namespace Marvel {
mvApp* mvApp::s_instance = nullptr;
static void SetStyle(ImGuiStyle& style, mvStyle& mvstyle)
{
style.Alpha = mvstyle[ImGuiStyleVar_Alpha].x;
style.WindowPadding = { mvstyle[ImGuiStyleVar_WindowPad... |
class Solution {
public:
string longestPalindrome(string s) {
const int n = s.size();
// &: Lambdas modify local variables through **capture-by-reference*
auto getLen = [&] (int left, int right) {
while (left >= 0 && right < n && s[left] == s[right]) {
--left; ++r... |
/*
characters to deal with: + - * / ^ ( )
doesn't handle negative numbers (unary operators)
when * comes after / or vice versa, we add them to stack (they're commutative) 2*3/4 => 234/*
left associative (when happen in the stack, we empty the stack - or pop the elements after the parenthesis):
"-" then "+"
"*" then... |
#ifndef NEW_STRATEGY_1_VECTOR2_HPP
#define NEW_STRATEGY_1_VECTOR2_HPP
#include <SFML/Graphics.hpp>
template <typename T>
class Vector2 {
public:
Vector2();
Vector2(T X, T Y);
sf::Vector2<T> to_sf_Vector();
Vector2<T>& operator =(const sf::Vector2<T>& rhs);
template <typename U>
explicit Vect... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "base.h"
WINRT_WARNING_PUSH
#include "internal/Windows.Storage.Streams.3.h"
#include "internal/Windows.ApplicationModel.Search.3.h"
#include "internal/Windows.Foundation.Collections.3... |
#include "Scene.h"
Scene::Scene(Tracer * tracer, string scenedescr, int scenenumb)
{
myTracer = tracer;
SceneDescription = scenedescr;
SceneNumber = scenenumb;
}
Scene::~Scene()
{
}
bool Scene::onCreate()
{
createBVH();
//IOR Water = 1.3, Glass = 1.5, air = 1.f
//coords: X = [-1.77777779 , 1.77777779], Y = [-... |
/*
SamEntryGet.h
Author: Izaak Coleman
*/
#include "SamEntry.h"
template <typename T>
T get(int, SamEntry const *){
// Dummy function. This function will (and should correctly) cause
// compile time error if instantiated. Functions purpose is to
// enable template specialization by return type of get()
const... |
#ifndef TENSOR_PRINT_H
#define TENSOR_PRINT_H
#include "tensor/Tensor.h"
namespace Fastor {
template<typename T>
FASTOR_HINT_INLINE std::ostream& operator<<(std::ostream &os, const Tensor<T> &a) {
os.precision(9);
os << *a.data();
return os;
}
template<typename T, size_t M>
FASTOR_HINT_INLINE std::ostre... |
#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... |
/*
Problem: Given an array find two unique elements present in that array rest all elements are present in pair.
Description:There is an array containing elements in which there are exactly two element which appears only once and rest all
appears two times. Find that unique element.
Solution: On XORing the whole arr... |
#ifndef QCOMMLISTENTHREAD_H
#define QCOMMLISTENTHREAD_H
#include <QThread>
#include "qserialcomm.h"
#include <QMutex>
#include <QWaitCondition>
class QCommListenThread: public QThread
{
Q_OBJECT
public:
explicit QCommListenThread( QObject * parent = 0 );
virtual ~QCommListenThread();
/... |
#include "Player.h"
#include "Card.h"
#include "Errors.h"
unsigned int Player::next_player {1};
// simple constructor
Player::Player() {
player_number = next_player++;
}
// free memory block that the pointers stored in vector are pointing to
template<typename T>
void cleanup(vector<T*>& vec)
// the stored pointers... |
#include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
while(t--){
int n,m;
cin>>n>>m;
vector<int>arr(n);
vector<pair<int,int> >p(m);
for(int i=0; i<n; i++){
cin>>arr[i];
}
int x,y;
for(int i=0; i<m; i++){
cin>>x>>y;
x--... |
//This is the header file listtools.h. This contains type definitions and
//function declarations for manipulating a linked list to store data of any type T.
//The linked list is given as a pointer of type Node<T>* which points to the
//head (first) node of the list. The implementation of the functions are given
/... |
// compare two wav files
// - check header similarity
// - cross correlation between two signals
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cstdint>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
// allowed percent difference in sample lengths
const double MAX_LENGTH... |
#include <atomic>
#include <bits/stdc++.h>
#include <cassert>
#include <chrono>
#include <cstring>
#include <fstream>
#include <iostream>
#include <pthread.h>
#include <string>
#include "../src/log.hpp"
#include "../utils/macros.hpp"
namespace mcsLog {
mcsLog::Logger *log[NUM_THREADS];
std::atomic<int> assignLog... |
#include "stdafx.h"
#include "ExpBSplineAprx.h"
#include "Properties.h"
#include "GeoXOutput.h"
#include "GLGeometryViewer.h"
#include "Random.h"
#include <fstream>
#include <cmath>
#include "BSplineApproximator.h"
IMPLEMENT_GEOX_CLASS( ExpBSplineAprx, 0 )
{
BEGIN_CLASS_INIT( ExpBSplineAprx );
ADD_STRING_PROP( f... |
/*
This file is part of remove_sky.
copyright£ºZhu Baohua
2016.6
*/
#include <iostream>
#include <fstream>
#include <vector>
#include <math.h>
#include<highgui.h>
#include<opencv.hpp>
#include <Eigen/Dense>
#include <Eigen/LU>
using namespace cv;
using namespace Eigen;
void myKMeans(Mat inputdata,Mat &o... |
// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2015 Intel Corporation. All Rights Reserved.
#include "context-libusb.h"
#include "../types.h"
namespace librealsense
{
namespace platform
{
usb_context::usb_context() : _ctx(NULL), _list(NULL), _count(0)
{
... |
#ifndef TYCOERROR_H_
#define TYCOERROR_H_
///////////////////////////////////////////////////////////////////////////////
/// @file tycoerror.hpp
/// @brief Error messages for Tyco
/// @~
/// @author Harry Oh (harry.oh@udptechnology.com)
/// @copyright UDP Technology
////////////////////////////////////... |
#ifndef _SNARKLIB_AUTOTEST_PPZK_HPP_
#define _SNARKLIB_AUTOTEST_PPZK_HPP_
#include <cstdint>
#include <vector>
#ifdef USE_OLD_LIBSNARK
#include /*libsnark*/ "common/types.hpp"
#include /*libsnark*/ "r1cs_ppzksnark/r1cs_ppzksnark.hpp"
#else
#include /*libsnark*/ "algebra/curves/public_params.hpp"
#include /*libsnark*/... |
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#include<getopt.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/types.h>
#include <unistd.h>
#include<signal.h>
//#include"miscutils.h"
//CMiscUtils *CMiscUtils::pInstance = NULL;
void sigHandler(int sig);
const char *version="2.0.0";
char socket_... |
#include "json_login_protocol_v0.h"
#include <common/dwiz_assert.h>
#include <common/log/logger.h>
#include <common/network/network_connector_interface.h>
#include <common/string_utils.h>
#include <exception>
#include <tuple>
DWIZ_DEFINE_LOGGER("common.protocols.json_login_protocol_v0");
namespace dwiz
{
std::future<... |
#ifndef ACCELEROMETER_H_
#define ACCELEROMETER_H_
extern "C" {
#include <inttypes.h>
}
#include "RegisterDevice.h"
#include "I2CController.h"
#define ACCEL_ADDR_HIGH 0x1D
#define ACCEL_ADDR_LOW 0x53
#define ACCEL_REG_DEVID 0x00
#define ACCEL_REG_THRESH_TAP 0x1D
#define ACCEL_REG_OFSX 0x1E
#define AC... |
#include<bits/stdc++.h>
using namespace std;
int main() {
int n,bt[20],wt[20],tat[20],avwt=0,avtat=0,i,j;
cout<<"Enter total number of processes:";
cin>>n;
cout<<"\nEnter Process Burst Time:\n";
for (i=0;i<n;i++) {
cout<<"P["<<i+1<<"]:";
cin>>bt[i];
}
wt[0]=0;
for (i=1;i<n;i++) {
wt[i]=0;
... |
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
const int N = 20003;
int first[N],next_[N*2],to[N*2],v[N*2],eg;
inline void addedge(int x,int y,int d) {
next_[++eg] = first[x];
first[x] = eg;
to[eg] = y;
v[eg] = d;
}
inline void add(int x,int y,int d) ... |
#include <iostream>
using namespace std;
int main()
{
double x,y,x1,y1,x2,y2,p,s,a,b,c;
cout<<"x1="<<endl; cin>>x;
cout<<"y1="<<endl; cin>>y;
cout<<"x2="<<endl; cin>>x1;
cout<<"y2="<<endl; cin>>y1;
cout<<"x3="<<endl; cin>>x2;
cout<<"y3="<<endl; cin>>y2;
a=sqrt((x1-x)*(x1-x)+(y1-y)*(y1-y));
b=sqrt((x2-x... |
#include <cstring>
#include <sys/epoll.h>
#include <iostream>
#include <strings.h>
#include <unistd.h>
#include <vector>
#include <netinet/in.h>
#include <netinet/tcp.h>
using namespace std;
int main() {
auto listener = socket(AF_INET, SOCK_STREAM, 0);
cout << "listener = " << listener << endl;
sockaddr_... |
#include "impdlg.h"
#include "ui_impdlg.h"
ImpDlg::ImpDlg(QWidget *parent) :
QDialog(parent),
packgePath(""),
ui(new Ui::ImpDlg)
{
ui->setupUi(this);
connect(this,SIGNAL(sendPackgePath(QString)),parent,SLOT(setImpPath(QString)));
}
ImpDlg::~ImpDlg()
{
delete ui;
}
void ImpDlg::on_pushButton_c... |
#include "logic.hpp"
using namespace std;
int main(int argc, char ** argv){
Logic jose;
jose.aplicacao();
}
|
#pragma once
#ifndef WOTPP_LOGGING
#define WOTPP_LOGGING
#include <structures/environment.hpp>
#include <frontend/char.hpp>
#include <frontend/view.hpp>
#include <misc/dbg.hpp>
#include <misc/colours.hpp>
namespace wpp {
template <typename... Ts>
inline std::string cat(Ts&&... args) {
const auto tostr = [] (cons... |
#include "MutexLock.hpp"
MutexLock::MutexLock()
{
sem_init(&g_semaphore, 0, 1);
this->locktime = 0;
this->islock = true;
i=0 ;
}
MutexLock::~MutexLock()
{
sem_destroy(&g_semaphore);
}
bool MutexLock::trylock(long locktime)
{
bool returnBool = false;
if(sem_trywait(&g_semaphore) == 0)
{
if(!this->i... |
#ifndef _GoodsEquipment_H_
#define _GoodsEquipment_H_
#include <iostream>
#include "ScriptResources.h"
#include "BaseGoods.h"
class Player;
/**
* 01冠类,02衣类,03鞋类,04护甲类,05护腕类
*/
class GoodsEquipment: public BaseGoods
{
public:
GoodsEquipment();
virtual ~GoodsEquipment(){}
virtual void setOtherData(char ... |
#include "Light.hpp"
Light::Light() : isPositionDirty(true),
lightColor(Cvec3f(1, 1, 1)),
specularLightColor(Cvec3f(1, 1, 1))
{
}
Light::~Light()
{
}
void Light::setPosition(double x, double y, double z) {
position[0] = x;
position[1] = y;
position[2] = z;
isPositi... |
#include <Input_Task.hpp>
#include <Kernel.hpp>
#include <SDL.h>
namespace engine
{
const Uint8 * Input_Task::keystate = SDL_GetKeyboardState(NULL);
bool Input_Task::KeyDown[] = {false};
bool Input_Task::KeyUp [] = {false};
Input_Task::Input_Task(int priority, Window & win) : Task(priority)
... |
#include <cstdio>
#include <vector>
using namespace std;
int main() {
int n;
scanf("%d", &n);
vector<int> v(n);
for (int i = 0; i < n; ++i) {
scanf("%d", &v[i]);
}
int res = n;
for (int i = n - 1; i >= 0; --i) {
if (v[i] == res) {
res--;
}
}
... |
# include <iostream>
# include <string>
using namespace std;
inline int abs(int a) { return a >= 0 ? a : a * (-1); }
inline int map(int a) { return a == 0 ? 0 : a / abs(a); }
class SegTree {
public:
int *tree, n;
SegTree(int *arr, int n) : n(n) {
tree = new int[n * 2];
for (int i = 0; i < n;... |
#include <bits/stdc++.h>
#define ll long long
const int MAX_N = 2e6 + 10 , mod = 998244353 , G = 3 ;
int n , a , b , p , jc[MAX_N] , inv[MAX_N] , f[MAX_N] , g[MAX_N] , rev[MAX_N] ;
int qpow(int a , int t) {
int s = 1 ;
for (; t ; t >>= 1 , a = (ll)a * a % mod)
if (t & 1) s = (ll)s * a % mod ;
return s ;
}
vo... |
//================================================================
// PROGRAMMER : 陳佳佑
// DATE : 2015-10-7
// FILENAME : HW02C036.CPP
// DESCRIPTION : This is a program to calculate the BMR for a person and how many chocolate bar.
//========================================================... |
#include "GLTools.h"
#include "GLMatrixStack.h"
#include "GLFrame.h"
#include "GLFrustum.h"
#include "GLGeometryTransform.h"
#include "glew.h"
#include <math.h>
#ifdef __APPLE__
#include <glut/glut.h>
#else
#define FREEGLUT_STATIC
#include <GL/glut.h>
#endif
#pragma mark - 变量部分
/* public */
GLfloat vRed[] = {1.f,0.... |
#ifndef CONTACT_HPP
# define CONTACT_HPP
# include "main.hpp"
class Contact
{
public:
Contact();
int input_infomation(int idx);
void view_contact_list();
void view_contact_detail(int idx);
private:
int _idx;
std::string _contact_infomation[11];
std::string _contact_fields[11];
};
#endif |
/////////////////////////////////////////////////////////////////////////////////////////////
// Copyright 2017 Intel Corporation
//
// 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
//
/... |
// - LINE.CPP -
//
// Implementation of class "CLine" - which defines the geometric concept
// "Directional Straight Line".
//
// Author: Zhang Lei
// Date: 2000. 4. 24
//
#include "stdafx.h"
#include <math.h>
#include <float.h>
#include "Tools.h"
#include "Geometry.h"
#include "Scrn... |
#include <stdio.h>
long long expomod(long long n,long long pow,long long mod)
{
long long res=1;
while(pow>0)
{
if(pow&1)
res=((res%mod)*(n%mod))%mod;
pow=pow>>1;
n=(((n)%mod)*(n%mod))%mod;
}
return res;
}
int main()
{
// printf("Hello World!\n");
long long t,n,mod=1000000007,ans;
scanf("%lld",&t... |
// -*- C++ -*-
//
// Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory,
// Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC
//
// This file is part of FreePOOMA.
//
// FreePOOMA is free software; you can redistribute it and/or modify it
// under the terms of the Expat license.
//
// This progr... |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
// #define DEBUG
const int maxn = 25;
int m, n, k;
int earth[maxn][maxn];
struct Peanut {
int num, x, y;
Peanut(int _num, int _x, int _y)
: num(_num)
, x(_x)
, y(_y) {}
};
... |
//**************************************************************************
//**
//** See jlquake.txt for copyright info.
//**
//** 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 ... |
#include <iostream>
#include <fstream>
using namespace std;
int m, n;
int times = 1;
int curNum = -1;
int main()
{
// fstream cin("a.txt");
cin>>m>>n;
for(int i = 0; i < m; i++)
{
for(int j = 0; j < n; j++)
{
int tmp;
scanf("%d", &tmp);
if(i == 0 && j == 0)
curNum = tmp;
if(times == 0)
{
... |
#include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
{
char a[20],b[20];
int i,j;
gets(a);
gets(b);
j=strcmp(a,b);
if(j>0){
printf("1st string is bigger");}
else if(j<0){
printf("2nd string is bigger");
}
getch();
}
|
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "SCyLandEditor.h"
#include "Framework/MultiBox/MultiBoxDefs.h"
#include "Framework/MultiBox/MultiBoxBuilder.h"
#include "Widgets/Layout/SBorder.h"
#include "Modules/ModuleManager.h"
#include "SlateOptMacros.h"
#include "Widgets/Layout/SBox.h"
#inclu... |
#include <iostream>
using namespace std;
void switchPtr (int *p,int *q)
{
int *temp = p;
p = q;
q = temp;
}
//---------------
int acceptPtr(int *p, int *q)
{
*p = *q + 5;
*q = *q + 10;
p = q;
*p = 5 + *q;
*q = *p + 1;
return *p+1;
}
//--------------
int dontComplicate(int *p,int *q,int &... |
#ifndef _DIALOGABOUT_H_
#define _DIALOGABOUT_H_
#include <QDialog>
namespace Ui
{
class AboutDialog;
}
namespace GUI
{
class AboutDialog :public QDialog
{
Q_OBJECT
public:
AboutDialog();
~AboutDialog();
private:
void init();
private:
Ui::AboutDialog* _ui{};
};
}
#endif |
#include<iostream>
#include<fstream.h>
using namespace std;
int main() {
ifstream fin;
char ch;
fin.open("demo.txt");
cout<<"\nData in file...";
while(!fin.eof()) {
fin.get(ch);
cout<<ch;
}
fin.close();
return 0;
} |
/* NO WARRANTY
*
* BECAUSE THE PROGRAM IS IN THE PUBLIC DOMAIN, THERE IS NO
* WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
* LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE AUTHORS
* AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
* WARRANTY OF ANY KIND, EITHER E... |
#include "vehicle.h"
example::Vehicle::Vehicle(const glm::vec3& size) : bounding_box_{size}
{
set_size(size);
}
void example::Vehicle::load_model(std::string_view filename)
{
model_.load(filename);
bounding_box_.set_line_width(2.0f);
}
void example::Vehicle::load_texture(std::string_view filename)
{
text... |
#include <Adafruit_NeoPixel.h>
#include <Arduino.h>
#include <ArduinoJson.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <WebSocketsClient.h>
#include <Hash.h>
#include <FastLED.h>
// Data-out PIN on the Arduino
#define DATA_PIN 14
// Default brightness
#define BRIGHTNESS 150
// Amount of LEDs
#de... |
#include "api.h"
struct Context
{
uint32_t* buffer;
float prevTime;
uint32_t prevTouchX[kTouchScreenMaxTouches];
uint32_t prevTouchY[kTouchScreenMaxTouches];
Context()
{}
bool Update(API* api);
};
inline void* operator new(size_t, void* __p) { return __p; }
void* GameInit(API* api, u... |
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<utility>
#include<queue>
#define NMAX 100
#define INFTY 10101010101
using namespace std;
typedef long long nat;
typedef pair<int, int> pii;
typedef pair<nat, int> pni;
typedef pair<nat, pair<int, int> > pnii;
class Fujishige{
// 最... |
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// WirelessErrorType
//
//
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define ERROR_INTERNAL
... |
/*
* Estudiante.h
*
* Created on: Feb 20, 2013
* Author: j2deme
*/
#include <iostream>
using namespace std;
#ifndef ESTUDIANTE_H_
#define ESTUDIANTE_H_
class Estudiante {
public:
Estudiante();
Estudiante(string, string, string, int, double);
virtual ~Estudiante();
void imprimirDatos();
void estudiar()... |
// github.com/andy489
// https://www.hackerrank.com/contests/practice-7-sda/challenges/autocomplete-19-1
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
auto inp(int n) {
vector<string> v;
while (n--) {
string t;
cin >> t;
v.push_back(move(t));
}
... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "XSphareSpace.h"
AXSphareSpace::AXSphareSpace()
{
// Uzywaj kuli do reprezentacji kolizji
SphareCollisionComponent = CreateDefaultSubobject<USphereComponent>(TEXT("SphereComponent"));
SphareCollisionComponent->BodyInstance.SetC... |
#ifndef MATERIAL_H
#define MATERIAL_H
#include "GL/glew.h"
#include "typedefs.h"
#include "modifiers/Modifier.h"
class Material{
public:
void bind();
void unbind();
bool isPersistent();
void setPersistent(bool persistent);
bool getTransparent();
protected:
Material(const Strin... |
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
using namespace std;
#define USERNUM 10
#define FILESAVE 10
struct File{
string fileName;
int protectCode[3];//3位读写执行
int length;//为0是目录
string content;
vector<File *> subFile;
};
struct UFD{
map<string, File *> ufd;
}u[USER... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.