text stringlengths 8 6.88M |
|---|
#include <iostream>
using namespace std;
int main(){
int t;
int n1, n2, n3;
cin >> t;
for(int i = 1; i <= t; i++){
cout << "Case " << i << ": ";
cin >> n1 >> n2 >> n3;
if(n1 > 20 || n2 > 20 || n3 > 20){
cout << "bad" << endl;
}else{
cout << "... |
#include<conio.h>
#include<iostream.h>
void main (){
int num[]={1,20,3,2,1};
int search;
int b=1;
clrscr();
for(int i=0; i<=4;i++){
cout<<"Num["<<i<<"]="<<num[i]<<endl;
}//end loop
cout<<"Enter Element For Search Loction:";
cin>>search;
for( i=0; i<=4;i++){
if(num[i... |
// Connection Manager Functions
//
// Copyright (C) 2008
// Center for Perceptual Systems
// University of Texas at Austin
//
// jsp Thu Jul 10 10:24:37 CDT 2008
#ifndef CONNECTION_MANAGER_H
#define CONNECTION_MANAGER_H
#include "connection.h"
#include <QIcon>
//#include <QMap>
#include <QHash>
#include <QObject>
#in... |
// Copyright (c) 2021 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 ... |
//
// Task.h
// Lab1Progr
//
// Created by Дмитрий Богомолов on 12.09.14.
// Copyright (c) 2014 Дмитрий Богомолов. All rights reserved.
//
#ifndef Lab1Progr_Task_h
#define Lab1Progr_Task_h
#include <iostream>
#include <time.h>
#include <xlocale.h>
#include <ctime>
#include <stdio.h>
#include <ctype.h>
using names... |
//: C10:Initializer.h
// Kod zrodlowy pochodzacy z ksiazki
// "Thinking in C++. Edycja polska"
// (c) Bruce Eckel 2000
// Informacje o prawie autorskim znajduja sie w pliku Copyright.txt
// Technika inicjalizacji obiektow statycznych
#ifndef INITIALIZER_H
#define INITIALIZER_H
#include <iostream>
extern int x;... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-1999 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef _JS11_SCREEN_
#define _JS11_SCREEN_
#include "modules... |
#ifndef MODELS_H
#define MODELS_H
#include "data.hpp"
#include "interp.hpp"
#include "integrate.hpp"
#include <vector>
#include <cmath>
#include <sstream>
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
class SingletDM_RD
{
private:
Data data;
public:
SingletDM_RD (){} // defu... |
#ifndef COMMON_SRC_PATHAPPENDER_H
#define COMMON_SRC_PATHAPPENDER_H
#include <QString>
namespace common
{
namespace util
{
/*!
* \brief The PathAppender class is a helper utility to concatenate path strings.
*/
class PathAppender
{
public:
/*!
* \brief Combines two path string to generate a valid path str... |
#include <iostream>
#include "common.hh"
#include "server_metrics.hh"
#include "server_utils.hh"
#include "DIET_server.h"
#include "scheduler/est_internal.hh"
#include <fstream>
#include <cmath>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <istream>
#include <cstdlib>
#include <string>
#include "s... |
#include "SDL.h"
#include "SDL_image.h"
#include "SDL_ttf.h"
#include "Window.h"
SDL_Window * WINDOW_WINDOW = nullptr;
SDL_Renderer * WINDOW_RENDERER = nullptr;
SDL_Texture * Render::createTextureFromSurface(SDL_Surface * surface)
{
SDL_Texture * t = SDL_CreateTextureFromSurface(WINDOW_RENDERER, surface);
... |
#include <iostream>
#include <sstream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <list>
#include <map>
#include <set>
#include <ctime>
#include <cmath>
#include <string>
#include <cctype>
#include <cstring>
#include <algorithm>
#include<climits>
u... |
int aPin = 5; //DT Pin
int bPin = 6; //CLK Pin
int buttonPin = 7; //SW Pin
int temp;
int temprotation = 100;
int rotation;
void setup() {
pinMode(aPin, INPUT);
pinMode(bPin, INPUT);
pinMode(buttonPin, INPUT);
Serial.begin(9600);
}
void loop(){
int change = getEncoderTurn();
if(change!=temp){
... |
#include "AudioMarkupNavigatorDialog.h"
#include "ui_AudioMarkupNavigatorDialog.h"
#include <QShowEvent>
AudioMarkupNavigatorDialog::AudioMarkupNavigatorDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::AudioMarkupNavigatorDialog)
{
ui->setupUi(this);
}
AudioMarkupNavigatorDialog::~AudioMarkupNavigato... |
#include <SPI.h>
#define NTAB 32
volatile uint16_t sine_table[NTAB];
#define DAC_CS 2
SPISettings dac_spi_settings(100000, MSBFIRST, SPI_MODE0);
auto& ser= Serial;
void init_timer2(unsigned int f)
{
static const unsigned int scales[] = {1, 8, 32, 64, 128, 256, 1024};
cli();//stop interrupts
TCCR2A = 0;
TC... |
//
// Created by Brady Bodily on 4/19/17.
//
#ifndef ITAK_CONFIG_HPP
#define ITAK_CONFIG_HPP
#include "UserIPList.hpp"
#include "KeyValue.hpp"
#include <string>
#include <vector>
#include <iostream>
using namespace std;
class Config {
public:
string GetType();
int GetValue();
Config(string type, int valu... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2010 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#ifndef OP_UNDOABLE_OPERATION_H
#define OP_UNDOABLE_OPERATION_H
... |
// Created on: 1995-03-02
// Created by: Jean-Louis Frenkel
// Copyright (c) 1995-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... |
#include <time.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/file.h>
#include <netinet/in.h>
#include "netdb.h"
#include "stdio.h"
#include "stdlib.h"
#include "sys/socket.h"
#include "unistd.h"
#include ... |
#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 table[10];
string str;
while( getline(cin,str) ){
stringstream ss(str);
int idx = 8;
... |
#include "RateControl.h"
/**
* \brief 获取VRLS_param中的Tile mapping方式等信息,创建rateControl线程,线程suspend
* \param rateControl 线程NULL指针
* \param VRLS_param 编码配置信息
* \param pfvlist 输入帧链表
* \param pmlist 输出码控信息到链表
* \param privateSpace 线程私有空间
* \return int -1失败 0成功
*/
int init_rateControl( HANDLE *rateControl, VRLSParam *... |
#pragma once
#include <API/Code/Graphics/Framebuffer/Framebuffer.h>
#include <API/Code/Graphics/Framebuffer/FramebufferSprite.h>
#include <API/Code/Graphics/Material/Material.h>
#include <API/Code/Graphics/Texture/Texture2D.h>
#include <API/Code/Graphics/Shader/Shader.h>
/// <summary>Process the jump flooding algorit... |
#include <iostream>
#include <set>
using namespace std;
using ll = long long;
ll calc(ll n, ll k) {
ll m = n / k;
return m + m * (m - 1) / 2 * k;
}
int main() {
ll N;
cin >> N;
set<ll> ans;
for (ll i = 1; i * i <= N; ++i) {
if (N % i > 0) continue;
ans.insert(calc(N, i));
... |
/*
replay
Software Library
Copyright (c) 2010-2019 Marius Elvert
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, mod... |
/*
* ulcd_component.cpp
*
*
*
*/
#include "ulcd_component.h"
/*
* private defines
*
*/
/*
* private variables
*
*/
/*
* constructor
*
*/
ulcd_component::ulcd_component() : rect()
{
}
ulcd_component::~ulcd_component()
{
}
/*
* private functions
*
*/
/*
* public functions
*
*/
|
/* Class intent: We want to be able to measure an arbitrary metric, and then adjust an
arbitrary output variable to attempt to find a maximal resultant input. This is
is probably over-generic, and shouldn't be, but let's find out what happens.
Input
*/
#include <deque>
#include "Accelerometer.h"
Acceler... |
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef pair<int, int> pii;
typedef long double ld;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
const int maxn = 400005;
const int INF = 0x3f3f3f3f;
const double pi = acos(-1.0);
const double eps = 1e-9;
... |
// Created on: 2016-07-07
// Copyright (c) 2016 OPEN CASCADE SAS
// Created by: Oleg AGASHIN
//
// 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 publi... |
#ifndef __LINKEDLIST_H__
#define __LINKEDLIST_H__
#include "Node.h"
class LinkedList {
private:
Node *head;
Node *tail;
int length;
public:
LinkedList();
~LinkedList();
void Insert(std::string name, int id);
bool Remove(std::string name, int id);
int Hashfunction(std::string name);
bool Find(std::st... |
#include <iostream>
#include <vector>
using namespace std;
bool char_to_bool(char c) {
return (c != '0');
}
bool bool_and(bool left, bool right) {
return left & right;
}
bool bool_or(bool left, bool right) {
return left | right;
}
bool bool_xor(bool left, bool right) {
return left ^ right;
}
vect... |
#include <iostream>
#include <deque>
#include <string>
typedef long long ll;
std::string str;
std::deque<ll> opd;
std::deque<char> opt;
void parse()
{
int str_len = (int)str.length();
int idx = 0;
while(idx < str_len)
{
ll number = 0;
bool MINUS = false;
if(str[idx] == '-')
... |
/*
limit.h
Represents a single limit price
*/
#ifndef limit_h
#define limit_h
#include <assert.h>
#include "order.h"
#include "book.h"
//forward declaration
class Order;
class Book;
class Limit
{
public:
Limit( Order * order, Book * book );
void Insert(Order * order);
Limit * Re... |
#include "RenderTexture.h"
#include "Debug.h"
#include "Util.h"
#include "Graphics.h"
#include <vector>
using namespace NoHope;
RenderTexture::RenderTexture():
_bound(false)
{
init();
}
RenderTexture::~RenderTexture()
{
glDeleteFramebuffers(1, &_frameBufferId);
glDeleteRenderbuffers(1, &_depthBufferId);
}
void... |
#ifndef SUDOKU_HPP
#define SUDOKU_HPP
#include <iostream>
#include <list>
#include <iterator>
#include <stdexcept>
#include <cmath>
//#define DEBUGGING
/**
@file Sudoku.hpp
@brief Sudoku template class declaration
*/
/**
@brief out_of_range_input.
Custom exception class that derives from st... |
#ifndef CAPP_TESTS_H
#define CAPP_TESTS_H
#include <iostream>
using namespace std;
class Datas {
private:
int data;
int datas[];//int datas[2][3]; must size for 2D array int* datas;
public:
Datas(){} //dup to Datas():data(1){} ?Datas():datas{1,2}{} works with size int datas[2];
Datas(int a)... |
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
void floodfill4(int x,int y,int fillcolor,int oldcolor)
{
if(getpixel(x,y) == oldcolor)
{
setcolor(fillcolor);
putpixel(x,y,fillcolor);
delay(5);
floodfill4(x+1,y,fillcolor,oldcolor);
floodfill4(x-1,y,... |
/*******************************************************************************
gaussianVolume.cpp - Shape-it
Copyright 2012-2021 by Silicos-it, a division of Imacosi BVBA, Hans De Winter,
and the Shape-it contributors
This file is part of Shape-it.
Permission is hereby granted, free of charge, to any person obtain... |
#pragma once
#ifndef IMAGIO_GL_PROGRAM_H
#define IMAGIO_GL_PROGRAM_H
#include <GL/gl3w.h>
#include <GL/gl.h>
#include <stddef.h>
#include <string>
#include <vector>
namespace wimgui
{
namespace gl_program
{
class gl_program
{
private:
GLuint vertex_shader_id;
std::string vertex_shader;
GLuint fragment_shader... |
#include <map>
#include <string>
#include <cstdio>
#include "ErrorMsg.h"
#include "IniFile.h"
static ErrorMsg* instance = NULL;
static std::map<int, std::string> err_code_msg ;
static const char* no_err_msg_find="error msg";
ErrorMsg::ErrorMsg()
{
}
ErrorMsg::~ErrorMsg()
{
}
ErrorMsg* ErrorMsg::getInstance()
{... |
#include "EnemyTank.h"
#include "cocostudio/CocoStudio.h"
#include "GameManager.h"
using namespace cocos2d;
EnemyTank* EnemyTank::create()
{
EnemyTank* myNode = new EnemyTank();
if (myNode->init())
{
myNode->autorelease();
return myNode;
}
else
{
CC_SAFE_DELETE(myNode);
return nullptr;
}
return myNode... |
/* XMRig
* Copyright (c) 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* 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
* ... |
#include<bits/stdc++.h>
using namespace std;
int main(){
int candies[5]={2,3,5,1,3};
int extra =3;
int max =0;
for(int i=0;i<5;i++){
if(candies[i]>max)
max=candies[i];
}
for(int j=0;j<5;j++){
if((candies[j]+extra)>=max){
co... |
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#define fe(e,x) for(__typeof(x.begin()) e=x.begin(); e!=x.end(); e++)
using namespace std;
const int maxn=111111, inf=~0U>>1;
vector<int> E[maxn];
int n, l, f[maxn][2], fa[maxn], now_alpha, own[maxn][26], leaf[maxn];
void dfs(int x) {fe(e,E[x]) ... |
/* 这部分内存池实现来自于https://github.com/cacay/MemoryPool/blob/master/C-11/MemoryPool.h
* 此处是拿来分析
*/
#ifndef __SRC_UTILS_MEMPOLL_H__
#define __SRC_UTILS_MEMPOLL_H__
#include <climits>
#include <cstddef>
template <typename T, size_t BlockSize = 4096>
class MemoryPool {
public:
/* Member types */
typedef T value_... |
#pragma once
#include "view.hpp"
#include <vector>
using std::vector;
struct ViewStack : View {
virtual void render(Graphics& g, render_box const& pos) override;
virtual void handle_keypress(KeyboardKey ks) override;
void push(View*);
void pop();
void reset();
vector<View*> vstack;
};
|
#include<bits/stdc++.h>
#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
bitset<16>used;
int n;
vector<int>output;
int isprime(int i)
{
int j;
int s=sqrt(i);
for(j=2;j<=s;j++)
if(i%j==0)break;
if(j==s+1)return 1;
else return 0;
}
void backtrack (int i)
{
if((use... |
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* sortedArrayToBST(vector<int>& nums) {
if(nums.empty()) return NULL;
r... |
#ifndef ASSETMANAGER_H
#define ASSETMANAGER_H
#include <android/asset_manager.h>
namespace gg
{
class AssetManager
{
public:
static AAssetManager* manager;
};
}
#endif |
#include <iostream>
#include <cstdlib>
#include <cstring>
#include "player.hpp"
using namespace std;
int main(int argc, char *argv[]) {
// Read in side the player is on.
if (argc != 2) {
cerr << "usage: " << argv[0] << " side" << endl;
exit(-1);
}
Side side = (!strcmp(argv[1], "Bl... |
// Copyright (c) 2019, tlblanc <tlblanc1490 at gmail dot com>
#include "aio.h"
#include <errno.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <signal.h>
#include <stdio.h>
#ifdef __APPLE__
#include... |
/*
Copyright (c) 2015, Vlad Mesco
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the follo... |
#ifndef ADDSECHEDULE_H
#define ADDSECHEDULE_H
#include <QDialog>
#include "login.h"
namespace Ui {
class addsechedule;
}
class addsechedule : public QDialog
{
Q_OBJECT
public:
explicit addsechedule(QWidget *parent = 0);
~addsechedule();
void AddNewSechedule();
bool connOpen... |
/*
* File: Cara.cpp
* Author: furia
*
* Created on 3 de diciembre de 2013, 18:05
*/
#include "Cara.h"
#include "Malla.h"
Cara::Cara() {
}
Cara::Cara(int numVertices) {
_numVertices = numVertices;
_arrayVN = new VerticeNormal*[_numVertices];
/* Posible error*/
}
Cara::Cara(int numVertices, Verti... |
//
// Created by manout on 17-3-29.
//
#include "common_use.h"
/*
* Given two words(start and ends), and a dictionary, find the length of shortest transformation
* sequence from start to end
* 分析:
* 使用广度优先搜索
*/
//定义节点类,表示当前的字符串信息和到start 的步数
struct state_t
{
int level;
string word;
... |
#include <iostream>
using namespace std;
typedef long long LL;
LL a, b, mod;
LL O1quick_mul(LL a, LL b, LL mod) {
LL tmp = LL (a * (long double) b / mod);
return ((a * b - tmp * mod) + mod) % mod;
}
int main() {
while(1) {
cin >> a >> b >> mod;
cout << O1quick_mul(a, b, mod) << endl;
}
return 0;
}
|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** Copyright (C) 2002-2005 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Morten Stenshorne
*/
#ifndef X11_CO... |
// Created on: 1995-04-20
// Created by: Tony GEORGIADES
// Copyright (c) 1995-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... |
#include <bits/stdc++.h>
using namespace std;
int main() {
// only gravity will pull me down
// Check if an array is sorted
int t, n;
cin >> t;
while (t--) {
cin >> n;
vector<int> c(n);
cin >> c[0];
int flg = 0;
for(int i=1; i<n; i++) {
cin >> c[i];
if (c[i] < c[i-1])... |
#include <contextual/Monad.hpp>
int
main(int, char**){
return 0;
}
|
#ifndef _LIGHT_AERO_H_
#define _LIGHT_AERO_H_
#include "../../Toolbox/Toolbox.h"
#include "../../Maths/Transform/Transform.h"
#include "../Color/Color.h"
#include "../../World/WorldObject/WorldObject.h"
namespace ae
{
/// \ingroup graphics
/// <summary>
/// Basic class for lights.
/// </summary>
/// <seealso cre... |
#ifndef ENDMENU_H
#define ENDMENU_H
#include <QGraphicsView>
#include <QWidget>
#include <QGraphicsScene>
#include<QPushButton>
#include<QObject>
#include"score.h"
class Endmenu: public QObject{
Q_OBJECT
public:
Endmenu(QObject *parent2=0);
QGraphicsView *Eview = new QGraphicsView();
Sc... |
#ifndef AOC_6_H
#define AOC_6_H
#include <map>
#include <string>
#include <vector>
#include <tuple>
namespace AoC_6 {
std::map<std::string, std::string> MakeOrbitMap(std::vector<std::tuple<std::string, std::string>> orbits) {
std::map<std::string, std::string> orbitMap = {};
for (auto& orbit : orb... |
#pragma once
#include <vector>
#include <QString>
#include <boost/utility/string_view.hpp>
#include "PticaGovorunCore.h"
#include <boost/filesystem.hpp>
namespace PticaGovorun
{
PG_EXPORTS void appendTimeStampNow(std::string& strBuf);
PG_EXPORTS void appendTimeStampNow(std::stringstream& str);
PG_EXPORTS boost::ws... |
//
// main.cpp
// 1193
//
// Created by Pedro Neves Alvarez on 7/9/17.
// Copyright © 2017 Pedro Neves Alvarez. All rights reserved.
//
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdlib>
#include <string>
using namespace std;
char digit_hex (long x) {
if (x >= 0 && x < 10)
ret... |
#pragma once
#include "piece.h"
#include <iostream>
using namespace std;
class Pawn : public Piece
{
public :
Pawn(int x, int y, bool pieceInfo);
bool Move(int i, int j, Location** board);
}; |
#pragma once
#include <string>
namespace ngn {
void printHello(const std::string& name);
} // namespace ngn
|
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2004, Industrial Light & Magic, a division of Lucas
// Digital Ltd. LLC
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the fol... |
#ifndef MOVE_H
#define MOVE_H
#include <QObject>
#include <QString>
class Monster;
class Move : public QObject
{
Q_OBJECT
public:
explicit Move(QObject *parent = 0);
int id;
QString name;
QString type;
QString category;
int power;
int accuracy;
int pp;
int ppTot;
QString ... |
/*
===========================================================================
Copyright (C) 2017 waYne (CAM)
===========================================================================
*/
#pragma once
#ifndef ELYSIUM_DATA_QUERYING_JOINEXPRESSION
#define ELYSIUM_DATA_QUERYING_JOINEXPRESSION
#ifndef ELYS... |
#include "loading.h"
#include "index.h"
#include "HelloWorldScene.h"
#define COCOS_DEBUG_1
USING_NS_CC;
using namespace cocos2d;
Scene* loading::createScene()
{
auto scene = Scene::create();
auto layer = new (std::nothrow) loading();
scene->addChild(layer);
return scene;
}
loading::loading(... |
// AutoGetAwsFileDlg.cpp : 实现文件
//
#include "stdafx.h"
#include "AutoGetAwsFile.h"
#include "AutoGetAwsFileDlg.h"
#include <atlbase.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CAutoGetAwsFileDlg 对话框
#define WM_SHOWTASK (WM_USER + 1000)
CAutoGetAwsFileDlg::CAutoGetAwsFileDlg(CWnd* pParent /... |
#ifndef ORDEREDLINK_H
#define ORDEREDLINK_H
#include <iostream>
#include <stdlib.h>
#include "Link.h"
using namespace std;
template <typename _Type,bool AllowMultiply>
class OrderedLink
{
public:
Link<_Type> Data;
OrderedLink()
{
}
~OrderedLink()
{
}
Node<_Type>* GetHead()
{
re... |
#include <iostream>
#include <vector>
using namespace std;
void swapInt(int *a, int *b)
{
int temp = *a;
*a = *b; *b = temp;
return;
}
int runningTime(vector<int> &arr) {
int shift = 0;
for(int i = 1; i < arr.size(); i++)
{
for(int j = i; j > 0; j--)
{
if ... |
#include <iostream>
using namespace std;
int c;
void Soma()
{ int a, b;
a = 5;
b = 7;
c = a + b;
}
int main()
{ c = 15;
Soma();
cout<<(c);
}
|
#include "edlines.h"
#include "utils.h"
#include <ctime>
#include "triangle.h"
#include "RandomSeeds.h"
#include "ColorLab.h"
//// The following struct represents a unsigned int precision 2D point.
////struct Pixel {
//// unsigned int x;//X coordinate
//// unsigned int y;//Y coordinate
////};
//typedef vector<Pixel> E... |
#include <iostream>
#include <vector>
#include <queue>
#define MAX 32001
using namespace std;
struct Problem{
int idx, indegree = 0;
vector<int> next;
};
Problem problem[MAX];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin >> n >> m;
for(int i = 1; i <= n; i++){
... |
#include<iostream>
using namespace std;
int max(int a,int b){
return a>b?a:b;
}
int roofTop(int arr[],int n){
int temp=0,res=0;
for(int i=1;i<n;i++){
if(arr[i]>arr[i-1]){
temp++;
}
else{
temp=0;
}
res=max(res,temp);
}
return re... |
#include <iostream>
#include <fstream>
#include <vector>
#include <regex>
using namespace std;
struct Cs {
int id;
string name;
int quantity;
int quantityInWork;
float efficiency;
void Launch() {
if (quantityInWork < quantity)
quantityInWork++;
else
cout << "Все цехи включены" << endl;
}
void Stop(... |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
int a[1001000];
long long gcd(long long a,long long b)
{
while (b)
{
long long t = a;a = b;b =... |
/****************************************************************
File Name: hierarchy.C
Author: Tian Zhang, CS Dept., Univ. of Wisconsin-Madison, 1995
Copyright(c) 1995 by Tian Zhang
All Rights Reserved
Permission to use, copy and modify this software must be granted
by the autho... |
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <list>
#include <algorithm>
#include <sstream>
#include <set>
#include <cmath>
#include <map>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <bits... |
/*
filename: mos_ruleset.h
author: Sherri Harms
last modified: 7/23/01
description: Class mos_ruleset interface file for serial MINEPI REAR rules
Values of this type are vectors of s_rules, where a mos_rule is a composite of
an antecedent episode, and a consequent episode, with a confidence;
*********************... |
#ifndef FUNCTION_H
#define FUNCTION_H
#include <vector>
#include <string>
#include "../Term.h"
#define NATIVE_FUNCTION 1
#define USER_FUNCTION 2
class Env;
class Store;
class Instr;
class GenericFunction {
public :
virtual int getType() = 0;
};
namespace function {
class Function : public GenericFunction {
... |
#ifndef BALL_H
#define BALL_H
#include <vector>
class Ball {
public:
Ball(float x, float y, float distance, float angle, double dt);
void updateVisible(float x, float y, float distance, float angle, double dt);
void updateInvisible(double dt);
void markForRemoval(double afterSecond... |
#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>
using namespace std;
int main()
{
int salary;
cout<<"please enter the salary : ";
cin>>salary;
if(salary<=600)
cout<<"tax is equal to : "<<salary*0<<endl<<"and the net pay is : "<<salary;
else
if (salary<=1650)
cout<<"tax is equal to : "<<salary*0.1-60<<endl<<endl<<"and the net pay is : "<<s... |
#ifndef OPTIONS_H
#define OPTIONS_H
#include <time.h>
#include <unistd.h>
#include "Typedef.h"
#include <string>
class Options
{
public:
static Options* instance() {
static Options * options = NULL;
if(options==NULL)
options = new Options();
return options;
}
int parse_args(int argc, char *argv[]);
... |
#ifndef image_h
#define image_h
#include <tr1/array>
#include "Color.h"
#include "Constants.h"
typedef std::tr1::array<std::tr1::array<Color,WIDTH>,HEIGHT> Image;
typedef std::tr1::shared_ptr<Image> ImagePtr;
#endif
|
#include "Material.hh"
#include "G4UnitsTable.hh"
#include "G4SystemOfUnits.hh"
#include "G4PhysicalConstants.hh"
using namespace CLHEP;
Material* Material::instance = 0;
Material::Material(void)
{
G4ElementName.push_back("Null");
G4ElementName.push_back("G4_H") ;
G4ElementName.push_back("G4_He") ;
G4Elemen... |
//
// Created by manout on 17-8-8.
//
#include <string>
#include <sstream>
#include <vector>
using std::string;
using std::stringstream;
string reverse_string(const string& sentence)
{
string buffer;
stringstream string_split;
std::vector<string> string_list;
string ret;
// stringstream 会使用空格和换行... |
// seperate odd and even lists, then append the even list to the odd list.
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* oddEvenList(ListNode* head) {
if (!head... |
#ifndef RAND_H
#define RAND_H
class Rand{
public:
Rand();
//����һ��x��y֮��������
int randNum(int x,int y);
};
#endif
|
#include "src/Math/Vector2.h"
#include "src/Math/Math.h"
namespace Math {
Vector2::Vector2() {}
Vector2::Vector2(int ax, int ay) :
x(static_cast<float>(ax)),
y(static_cast<float>(ay)) {}
Vector2::Vector2(float ax, float ay) :
x(ax),
y(ay) {}
Vector2::Vector2(const Vector2& a) :
x(a.x),
y(a.y) {}
Vec... |
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <windows.h>
#include <string.h>
#define StrSize 10
typedef struct {
int v... |
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QListWidget>
#include <QListWidgetItem>
#include "editwindow.h"
#include "library.h"
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget ... |
#ifndef H_CUSTOMERTYPE
#define H_CUSTOMERTYPE
//************************************************************
// Author: D.S. Malik
//
// class personType
// This class specifies the members to implement a name.
//************************************************************
#include <string>
#include <list>
#include ... |
//
// main.cpp
// divide-two-integers
//
// Created by xiedeping01 on 15/11/11.
// Copyright (c) 2015年 xiedeping01. All rights reserved.
//
#include <iostream>
#include <limits>
#include <vector>
using namespace std;
class Solution {
public:
int divide(int dividend, int divisor) {
// 基本思路:用减法模拟除法
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2009 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 GADGET_SUPPORT
#include "modules/... |
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/videoio.hpp"
#include <iostream>
using namespace cv;
using namespace std;
int s=0;
int le[3][3];
int r[3][3];
Mat img1;
Mat img2;
void matrixl(int i,int j)
{ int x=0;
int y=0;
for(int k=i;k<i+3;k++)
... |
// Copyright (c) 2019 The Circle Foundation
// Copyright (c) 2019 fireice-uk
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include "soft_aes.hpp"
#include "coin_algos.hpp"
#if defined(_WIN32) || defined(_WIN... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.