text stringlengths 8 6.88M |
|---|
#include<iostream>
using namespace std;
int main() {
int lado = 2;
int horizontal = 0;
int vertical = 0;
while (vertical <= lado) {
while (horizontal <= lado) {
if (vertical != 0 && vertical != lado){
if (horizontal != 0 && horizontal != lado){
... |
#ifndef Included_DVD_h
#define Included_DVD_h
#include "SaleableItem.h"
class DVD :public SaleableItem {
public:
enum DVDFormat {PAL, NTSC};
DVD(const char* pTitle,
unsigned int unitPricePence,
unsigned int runningTimeMinsp,
DVDFormat formatp);
unsigned int getNewPrice(void);
private:
unsig... |
//: C14:OperatorInheritance.cpp
// Kod zrodlowy pochodzacy z ksiazki
// "Thinking in C++. Edycja polska"
// (c) Bruce Eckel 2000
// Informacje o prawie autorskim znajduja sie w pliku Copyright.txt
// Dziedziczenie przeciazonych operatorow
#include "../C12/Byte.h"
#include <fstream>
using namespace std;
ofstrea... |
#include "methods.hpp"
#include <iostream>
#include <string>
using namespace std;
long long int methods::fact (int number) {
if (number == 1) {
return 1;
}
return number * fact (number - 1);
}
template <typename Type> Type methods::get_num() {
Type number;
cout << "Enter your number... |
#include <iostream>
#include <string>
using namespace std;
class BallAndHats
{
public:
int getHat(string hats, int numSwaps)
{
int startPoint = static_cast<int>(hats.find('o'));
if (numSwaps == 0) {
return startPoint;
}
if ((numSwaps%2!=0 && startPoint%2!=0) ||(numSwaps%2==0 && startPoint%2==0) ) {
... |
#ifndef RECORD_HH_
#define RECORD_HH_
#include <string>
// struct of an history record
struct history_record
{
std::string type;
std::string command;
std::string name;
double time;
int success;
double err;
unsigned int id;
double lastTimePlayed;
};
#endif //RECORD_HH_ |
#ifndef SHADER_H
#define SHADER_H
#include <string>
#include <fstream>
#include <sstream>
class Shader {
public:
Shader(string vs_filename, string fs_filename);
virtual ~Shader() {}
void enable() const;
void sendLight(const float *light) const {
glUniform4fv(id_light, 1, ligh... |
/* -*- 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.
*/
#include "core/pch.h"
#include "modules/util/handy.h"
#include ... |
#include<cstdio>
#include<iostream>
#include<cstring>
#define MAX_LOG 16 //最大可能的log值,注意中间运算的结果可能会超出题目数据范围,所以这个值最好设大点
#define MAX(x,y) ((x)>(y)?(x):(y))
using namespace std;
int n;
int f[MAX_LOG][MAX_LOG]; //记录2^x(X)2^y的值
//declaration
int nim_mul_normal(int x,int y);
int nim_mul_power(int x,int y);
//
int nim_mul_po... |
#include <Arduino.h>
#define btn 21
int ledStatus = LOW;
volatile bool interruptState = false;
int totalInterruptCounter=0;
hw_timer_s *timer = NULL;
portMUX_TYPE timerMux = portMUX_INITIALIZER_UNLOCKED;
void IRAM_ATTR gpioISR() {
ledStatus = !ledStatus;
digitalWrite(BUILTIN_LED,ledStatus);
}
void setup() {
// p... |
#ifndef GUILITE_CORE_INCLUDE_RECT_H
#define GUILITE_CORE_INCLUDE_RECT_H
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
class c_rect
{
public:
c_rect(){Empty();}
c_rect(int left, int top, int right, int bottom){m_left = left;m_top = top;m_right = right;m_bottom = bottom;};
void SetRect(in... |
#include "test_precomp.hpp"
CV_TEST_MAIN("highgui")
|
#include "../Solution.h"
bool Solution::isPalindrome(int x)
{
int x1 = 0;
int temp = 0;
if ((x < 0 || x % 10 == 0) && x != 0)
{
return 0;
}
while (x1 < x)
{
x1 = x1 * 10 + x % 10;
x /= 10;
}
return x1 == x || x == x1 / 10;
} |
#include<iostream>
#include<stack>
using namespace std;
int main()
{
string s;
cin>>s;
stack<char> st;
int flag=1;
for(int i=0;i<s.length();i++)
{
char c=s[i];
if(c=='{'||c=='['||c=='(')
st.push(c);
else if(!st.empty())
{
if(c==')' && st.top()=='(')
st.pop();
else if(c=='}' && st.top()=='{')... |
#ifndef LWRCONTROLLER_H
#define LWRCONTROLLER_H
#include <cstdio>
#include "ros/ros.h"
#include <actionlib/server/action_server.h>
#include <control_msgs/FollowJointTrajectoryAction.h>
#include <sensor_msgs/JointState.h>
#include <geometry_msgs/PoseStamped.h>
#include <nav_msgs/Path.h>
#include <std_msgs/Empty.h>
#incl... |
/*
==========================================
Copyright (c) 2016-2018 Dynamic_Static
Patrick Purcell
Licensed under the MIT license
http://opensource.org/licenses/MIT
==========================================
*/
#include "Dynamic_Static/Core/Threads/ThreadPool.hpp"
#include "Dynamic_Static/Core/Time.... |
#include "headers/dbconnector.h"
DBConnector::DBConnector(const QString &db_name)
{
DB_name = db_name;
db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName(DB_name);
QSqlQuery query;
db.open();
query.exec(QString("CREATE TABLE IF NOT EXISTS " + DB_tableName_country
... |
// you can use includes, for example:
// #include <algorithm>
// you can write to stdout for debugging purposes, e.g.
// cout << "this is a debug message" << endl;
int solution(int K, vector<int> &A) {
// write your code in C++14 (g++ 6.2.0)
int temp=0;
int sol=0;
for (auto a : A){
temp+=a;
... |
#include "mesh.h"
#include <iostream>
#include "../glm/gtc/matrix_transform.hpp"
Mesh::Mesh(int m, float length, int numVerts, std::vector<glm::vec3> verts) : Primitive(length, 99) {
//Extrusion
mtl = new int(m);
numVbo = new int(24 * numVerts);
bool convex = isConvex(numVerts, verts);
if (convex) {
*numVbo += ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2011 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"
#include "modules/hardcore/component/M... |
#include <iostream>
#include <vector>
#include <cstring>
#include <queue>
int main()
{
std::cin.sync_with_stdio(false);
std::cin.tie(NULL);
int t;
std::cin >> t;
while(t--)
{
int n;
std::cin >> n;
std::vector<int> city(n), link[n];
std::queue<int> q;
boo... |
/*
Anyone can't live without food , so does the snake .
There's two kind of food : animal and fruit . The fruit has fixed position on
the screen , while the animal not . The animal perhaps run when you approach it ,
and it will disappear in 3 or 4 rounds.
You can also add your favourite food , just write a ... |
#ifndef OFXACTIONLISTENERH
#define OFXACTIONLISTENERH
class ofxActionEvent;
class ofxActionListener {
public:
virtual void actionPerformed(const ofxActionEvent& rEvent) = 0;
};
#endif |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; -*-
*
* Copyright (C) 2007-2012 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#include "core/pch.h"
#ifdef POSIX_OK_ASYNC
#include "platforms/p... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 2002-2012 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
// -------------------------------------------------------------... |
#include "visitor.hpp"
using namespace visitor;
/*
* The tree of boredom.
*/
void install(Graph & g) {
g.clear();
boost::add_vertex(g);
boost::add_vertex(g);
boost::add_vertex(g);
boost::add_vertex(g);
boost::add_vertex(g);
boost::add_vertex(g);
boost::add_edge(0, 1, g);
boost::add_edge(0, 2, g)... |
/**/
#include<stdio.h>
#include<conio.h>
void Arrange(int*, int);
void Swap(int*, int, int, int);
void main(){
int size;
int a[100];
scanf_s("%d", &size);
for (int i = 0; i < size; i++)
{
int temp;
scanf_s("%d", &temp);
if (temp != 0 && temp != 1) {
printf("you have to enter 1 or 0 ! just as a remaind... |
#include "MyApp.h"
//точка входа
int CALLBACK wWinMain(HINSTANCE, HINSTANCE, PWSTR, int)
{
MyApp app;
return app.Run();
}
|
/*
* File: BinaryExpression.h
* Author: idox
*
* Created on December 17, 2018, 8:43 PM
*/
#ifndef PROJECTPART1_BINARYEXPRESSION_H
#define PROJECTPART1_BINARYEXPRESSION_H
#include "Expression.h"
/**
* Binary expressions is any type of binary operation which could hold two
* autonomous expressions, and make c... |
#include "vector.h"
Vector::Vector() {
this->x = 0;
this->y = 0;
this->z = 0;
}
Vector::Vector(Point& p1, Point& p2) {
this->x = p2.getX() - p1.getX();
this->y = p2.getY() - p1.getY();
this->z = p2.getZ() - p1.getZ();
}
Vector::Vector(double x, double y, double z) {
this->x = x;
this->y = y... |
// Homework5View.h : interface of the CHomework5View class
//
#pragma once
class CHomework5View : public CView
{
protected: // create from serialization only
CHomework5View() noexcept;
DECLARE_DYNCREATE(CHomework5View)
// Attributes
public:
CHomework5Doc* GetDocument() const;
// Operations
public:
// Override... |
/***************************************************************************
*
* Copyright (c) 2017 Baidu.com, Inc. All Rights Reserved
* B142877
*
**************************************************************************/
/**
* @file dfile_lib.cpp
* @author liuxufeng (liuxufeng@baidu.com)
* @date 2017/05/27 21:01:11
... |
#include <bhand/robot_hand.h>
#include <stdexcept>
#include <sstream>
#include <chrono>
#include <map>
#include <stack>
#include <ros/package.h>
#include <kdl_parser/kdl_parser.hpp>
namespace as64_
{
namespace bhand_
{
RobotHand::RobotHand()
{
std::string robot_description_name;
if (!node.getParam("/bhand_robo... |
/** \class RPCEfficiencySecond
* \Original author Camilo Carrillo (Uniandes)
*/
#include <DataFormats/MuonDetId/interface/RPCDetId.h>
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "DQMServices/Core/interface/MonitorElement.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Co... |
#include <iostream>
#include <cstdio>
#include <stack>
#include <math.h>
#include <cstdlib>
using namespace std;
int main(){
int q,num1;
stack<int>st;
cin >> q;
//if(1 <= q && q <= pow(10,5))
// exit(0);
while(q--){
cin >> num1;
if(num1 == 1){
if(st.empty()){
cout << "No Food"<<"\n";
}
else{
... |
//
// ByteOrder.h
//
// $Id: //poco/1.4/Foundation/include/_/ByteOrder.h#5 $
//
// Library: Foundation
// Package: Core
// Module: ByteOrder
//
// Copyright (c) 2004-2014, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Foundation_ByteOrder_INCLUD... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2012 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
*/
#ifndef I18N_H
#define I18N_H
#include "modules/locale/locale-enum.h"
/** @brief ... |
#include "CollidableModel.h"
CollidableModel :: CollidableModel() {
}
void CollidableModel::SetBoundingBox(AABoundingBox fBoundingBox)
{
boundingBox = fBoundingBox;
}
AABoundingBox CollidableModel::GetBoundingBox()
{
return boundingBox;
}
AABoundingBox CollidableModel::CalculateBoundingBox(vector<glm::vec3> vert... |
#include "Main.hpp"
#include "LoadingFunctions.hpp"
#include "controls.hpp"
using namespace std;
using namespace glm;
GLFWwindow* window;
int main()
{
if( !glfwInit() )
{
fprintf( stderr, "Failed to initialize GLFW\n" );
return -1;
}
window = glfwCreateWindow(1024, 768, "Simple exampl... |
#include <iostream>
#include <array>
#include <chrono>
#define ArrayAndSize(arr) \
arr, (sizeof(arr)/sizeof(arr[0]))
bool oppg2 = false;
void RandomizeArray(int *a, int size)
{
for(auto i= 0; i < size; i++)
{
a[i] = rand();
}
}
void PrintArray(int *a, int size)
{
for(auto i= 0; i < size; i++)
{
std::cout ... |
#include<iostream>
#include<string.h>
#include<stdlib.h>
#define max 10000
using namespace std;
int main(){
char a[max];int c[26],d[26];
int t;
cin>>t;
for(int j=0;j<t;j++){
int sum=0;int i;
for(i=0;i<26;i++)
c[i]=d[i]=0;
cin>>a;
if(strlen(a)%2!=... |
#include "rtspserver.h"
char const* dateHeader() {
static char buf[200];
#if !defined(_WIN32_WCE)
time_t tt = time(NULL);
strftime(buf, sizeof buf, "Date: %a, %b %d %Y %H:%M:%S GMT\r\n", gmtime(&tt));
#else
// WinCE apparently doesn't have "time()", "strftime()", or "gmtime()",
// so generate the "Date:" head... |
#pragma once
//#include "stdafx.h"
//#include <iostream>
using namespace std;
template< typename T >
struct element2
{
T data;
element2<T> *next, *prev ;
};
template< typename T >
struct List2W
{
element2<T> *head, *tail;
int size;
};
template< typename T >
List2W<T> CreateEmptyList2W()
{
List2W<T> temp;
te... |
#include "xr_file.h"
#include "xr_util.h"
namespace xr
{
int file_t::get_dir_file(const char *path, std::vector<std::string> &file_names)
{
DIR *dirp;
dirp = ::opendir(path);
if (NULL != dirp)
{
while (1)
{
struct dirent *direntp;
direntp = ::readdir(dirp);
if (NULL == direntp)
{
break;
}
... |
#include "addpioneer.h"
#include "ui_addpioneer.h"
#include "utilities/constants.h"
#include <QtSql>
#include <QtWidgets>
#include <QFileDialog>
#include <QMessageBox>
#include <algorithm>
AddPioneer::AddPioneer(QWidget *parent) :
QDialog(parent),
ui(new Ui::AddPioneer){
ui->setupUi(this);
// dropdow... |
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <memory.h>
#include <cmath>
#include <string>
#include <cstring>
#include <queue>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <functional>
#include <numeric>
#include <ss... |
#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
#define pi 3.1415926
int main(){
double u,t;
while(cin>>u>>t){
double a=pi*18/sqrt(2*981*9.794);
double r=sqrt((9*1.83*0.00001*2*0.001)/(2*981*9.794*t));
double b=(1.83*0.00001*2*0.001)/(t*(1+8.23*0.001/(1... |
/*
* redblacknode.h
*
* Created on: Apr 27, 2017
* Author: Benjamin Kleinberg
*/
#ifndef REDBLACKNODE_H_
#define REDBLACKNODE_H_
#include"int.h"
#include"binarytreenode.h"
#include<iostream>
using std::ostream;
class RedBlackNode : public BinaryTreeNode {
public:
int color;
RedBlackNode(Int key, int n... |
#include "Board.h"
#include<iostream>
Board::Board()
:
height(0),
width(0),
board_array(nullptr)
{
//ctor
}
Board::Board(int height_in, int width_in,sf::Vector2i& mouse_in){
init(height_in, width_in, mouse_in);
}
Board::~Board(){
if(board_array != nullptr){
for(int height_index = 0; h... |
#ifndef wN_binrel_BINREL_GUARD
#define wN_binrel_BINREL_GUARD 1
/**
* @author Nicholas Kidd
* @author Prathmesh Prabhu
*
* An implementation of binary relations.
* This class models the relations
* using BDDs, and specifically with the BuDDy
* BDD library.
*
*
*/
/* ****************************
Changelo... |
#include <iostream>
#include <cstdio>
#include <cmath>
//#define maxn 100 + 5
using namespace std;
//typedef long long LL;
int main() {
int n;
while(cin >> n) {
int a = (n + 1) * n / 2;
cout << a << " " << pow(2, n) - 1 << endl;
}
return 0;
}
|
void loop() {
String data = Serial.readStringUntil("\n");
Serial.println(data);
delay(1000);
}
int red = Serial.readInt();
int green = Serial.readInt();
void setup() {
// put your setup code here, to run once:
Serial.berin(115200);
pinMode(red, OUTPUT);
pinMode(green, OUTPUT);
}
void loop() {
// put ... |
//
// Created by 钟奇龙 on 2019-05-11.
//
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int maxUnique(string s){
if(s.size() == 0) return 0;
int pre = -1;
int res = 0;
vector<int> index_map(256,-1);
for(int i=0; i<s.size(); ++i){
pre = max(pre,index_map[s[i]]);
... |
//
// nehe12.h
// NeheGL
//
// Created by Andong Li on 9/11/13.
// Copyright (c) 2013 Andong Li. All rights reserved.
//
#ifndef __NeheGL__nehe12__
#define __NeheGL__nehe12__
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#include "utils.h"
#include "SOIL.h"
#include <iostream>
#include <... |
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
//
// Copyright (C) 2003-2006 Opera Software AS. All rights reserved.
//
// This file is part of the Opera web browser. It may not be distributed
// under any circumstances.
//
// Adam Minchinton
//
#include "core/pch.h"
#ifdef SUPPORT_SPEED_... |
#include "ReconstructionError.h"
#include <ComputerVisionLib/Common/EigenHelpers.h>
Eigen::Array2Xd Cvl::ReconstructionError::project(Eigen::Affine3d const & modelView, CameraModel const & cameraModel, Eigen::Array2Xd const & srcPoints)
{
// Since we have only 2d template points points with with z=0,
// we can skip ... |
result[0] = -c[1];
result[1] = c[0];
|
vector<int> Solution::subUnsort(vector<int> &A) {
int start = -1, end = -1;
vector<int> v(1, -1);
int n = A.size();
for (int i = 0; i < n - 1; i++)
{
if (A[i] > A[i + 1]) {
start = i;
break;
}
}
if (start == -1)
return v;
f... |
/**
Interactive Graphics
Spring '15 Assignment #2 Ping Pong 3D
Authors: Barbara and Ivana
**/
#ifndef App_h
#define App_h
#include <G3D/G3DAll.h>
class App : public GApp {
public:
App(const GApp::Settings& settings = GApp::Settings());
virtual void onInit();
virtual void onUserInput(UserInput *uinput);
... |
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
using namespace std;
int task2() {
int a, b, c;
cout << "Enter value a, b, c: " << '\n';
cout << "a = ";
cin >> a;
cout << "\nb = ";
cin >> b;
cout << "\nc = ";
cin >> c;
double x;
cout << "\nCaclutation: x = (à +... |
#include <Arduino.h>
#include <TM1638GS.h>
// I/O pins on the Arduino connected to strobe, clock, data
// (power should go to 3.3v and GND)
//TM1638GS tm(0,2,14); // D3 D4 D5 WeMos D1R23
TM1638GS LedAndKey(5,6,7); // D5 D6 D7 Leonardo
void doLEDs(uint8_t value);
char string[] = "IP = 192.168.2.71";
... |
/*
* File: main.cpp
* Author: Daniel Canales
*
* Created on July 23, 2014, 1:02 PM
*/
#include <cstdlib>
#include <iostream>
#include <cmath>
using namespace std;
/*
*
*/
//functions
void presentValue(float future, float intrest, float years);
int main(int argc, char** argv) {
//declare variables
... |
#include "CERPCategory.h"
#include "CCategoryFactory.h"
#include "CMisc.h"
#include "CClientLog.h"
#include <QFile>
CERPCategory::CERPCategory(QObject *parent)
: CCategoryBase(parent)
{
}
CERPCategory::~CERPCategory()
{
}
QString CERPCategory::Category() const
{
return QString::fromLocal8Bit("ERP");
}
//ERP类... |
#include "Executable.h"
#include "Execution.h"
using namespace std;
/*void FunctionCall::execute(Execution& ex)
{
list<shared_ptr<Value>> paramValues;
for (auto& i : params)
paramValues.push_back(i->evaluate(ex));
ex.callFunction(funIdent, paramValues, defaultReturnValue);
}
shared_ptr<Value> FunctionCall::eval... |
// Copyright (c) 1991-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 General Public License version 2.1 as published
... |
/* @author: Niamh on 13/04/2018.
* <mccallan-n2@ulster.ac.uk>
*
* @copyright Niamh McCallan 2018
*
* @license Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* https://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef DIABETES_H
#define ... |
#ifndef SRC_RETREIVE_H
#define SRC_RETRIEVE_H
/**
* Return the index-th child reference if index is valid, NULL otherwise.
*/
template<class T> TrieNode<T> *TrieNode<T>::getChildAtIndex(int index)
{
if (index < 0 || index >= children.size()) {
return NULL;
}
return children[index];
}
/**
* Upda... |
#include <iostream>
#include "Chaine.hpp"
#include "Etudiant.hpp"
#include "Enseignant.hpp"
#include "EleveVacataire.hpp"
using enseirb::Chaine;
using enseirb::Personne;
using enseirb::Etudiant;
using enseirb::Enseignant;
using enseirb::EleveVacataire;
Chaine annexe(Chaine u, Chaine t) {
return u + t... |
#include <iostream>
#include <list>
#include <ctime>
#include "simulation.hpp"
#include "rabbits.hpp"
#include "mt19937ar.hpp"
Simulation::Simulation( const unsigned long rabbitsNum, const int month, double survivalRateYoung, double survivalRateAdult )
: _month( month ), _rabbitsNum( rabbitsNum ), _survivalRateYoung(... |
#pragma once
//====================================================================
// DirectInput
//====================================================================
#ifndef _BDIRECT_INPUT
#define _BDIRECT_INPUT
#include <dinput.h>
namespace iberbar
{
#define BINPUT_LBTN 0
#define BINPUT_RBTN 1
#define BI... |
/*nom : ramon mir
*
* data: 19 - 3 - 2021
*
* el que fara aquesta problema 1 es que primer sensendra el led 1
*
*
* despres sensendran tots els led(led 1 led 2 led 3)
*
*
* estaran ensesos 1 segon i s'apagaran en 0,5 segons.
*
*
* y aixi tota la estona.
*
*
*/
const int ledPin1=4;
con... |
#include <iostream>
#include <vector>
#include <fstream>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
string s1, s2;
ifstream fin("levenshtein.in");
ofstream fout("levenshtein.out");
fin >> s1 >> s2;
int l1 = s1.size();
int l2 = s2.size();
vector<v... |
/*
==============================================================================
blueprint_GenericEditor.cpp
Created: 3 Nov 2019 4:47:39pm
==============================================================================
*/
#pragma once
namespace blueprint
{
//=======================================... |
#ifndef TREEFACE_PATH_GLYPH_H
#define TREEFACE_PATH_GLYPH_H
#include "treeface/base/Enums.h"
#include "treeface/graphics/guts/Enums.h"
#include "treeface/math/Vec2.h"
#include "treeface/scene/Geometry.h"
#include <treecore/Array.h>
namespace treeface
{
struct PathGlyphArc
{
float center_x;
float center_y;
... |
#include <QApplication>
#include <QLabel>
#include <QDialog>
#include <QTimer>
#include <QVBoxLayout>
#include "window.h"
#include "samdial.h"
#include "samclock.h"
int main( int argc, char* argv[] )
{
QApplication app(argc, argv);
QDialog *dialog = new QDialog( 0 );
QLabel* sam = new QLabel( dialog );
... |
/**
* created: 2013-4-8 14:53
* filename: FKSyncObjLock
* author: FreeKnight
* Copyright (C):
* purpose:
*/
//------------------------------------------------------------------------
#include <wchar.h>
#include "../Include/FKSyncObjLock.h"
#include "../Include/FKError.h"
#include "../Include/FKThread.h"
#inc... |
#include <iostream>
using namespace std;
void swap1(int a, int b)
{
int c;
c = a;
a = b;
b = c;
}
void swap2(int &a, int &b)
{
int c;
c = a;
a = b;
b = c;
}
void swap3(int *a, int *b)
{
int c;
c = *a;
*a = *b;
*b = c;
}
int main()
{
int a[5] = {1,2,3,4,5};
int *p = (int *)(&a + 1);
cout << *(a + 1) <... |
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <vector>
#include <cmath>
#include <deque>
using std::vector;
using std::pair;
class UF {
int *id, cnt, *sz;
public:
// Create an empty union find data structure with N isolated sets.
UF(int N) {
cnt = N;
id = new int[N];
... |
#include "SaveDataManager.h"
#include "sqlite3.h"
/************************************************************************/
/* 数据库校验 */
/************************************************************************/
//整数
int getIntFromTable(char * szItemName, int n_column, c... |
/*
** EPITECH PROJECT, 2018
** cpp_indie_studio
** File description:
** Math.cpp
*/
#include "Math.hpp"
size_t Math::roundUp(size_t numToRound, size_t multiple)
{
return ((numToRound + multiple - 1) / multiple) * multiple;
}
size_t Math::manhattanDistance(Point const & from, Point const & to)
{
int x1 = from.getX(... |
// Copyright (c) 2013 Nick Porcino, All rights reserved.
// License is MIT: http://opensource.org/licenses/MIT
#ifndef LAB_INTVAROBJ_H
#define LAB_INTVAROBJ_H
#include "LandruVM/VarObj.h"
namespace Landru
{
class IntVarObj : public Landru::VarObj
{
public:
IntVarObj(const char* name);
virtual ~IntVarObj();
... |
#ifndef _DUCK_H_
#define _DUCK_H_
#include"Animal.hpp"
#include<iostream>
using namespace std;
class Duck : public Animal //add public
{
public:
Duck();
Duck(string name, char mark, int* pattern, int size, int position);
//~Dog();
virtual void showExcitement() const;
};
#endif
|
#include "../../gl_framework.h"
using namespace glmock;
extern "C" {
#undef glUniform1fv
void CALL_CONV glUniform1fv(GLint location, GLsizei count, const GLfloat* value) {
}
DLL_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv = &glUniform1fv;
}
|
/*****************************************************************************************
* *
* owl *
* ... |
#ifndef _Stack_H
#define _Stack_H
#include <iostream>
using namespace std;
class Stack{
private:
int size;
int* data;
int top;
public:
Stack(int i=1);
void push(int value);
int pop();
void clear();
bool isEmpty();
~Stack();
};
void menu();
#endif
|
#ifndef STORAGE_BACKEND_SIMPLEDB_HH
#define STORAGE_BACKEND_SIMPLEDB_HH
#include "storage/backend.hh"
#include "net/simpledb.hh"
class SimpleDBStorageBackend : public StorageBackend
{
private:
SimpleDB client_;
public:
SimpleDBStorageBackend(SimpleDBClientConfig& config)
: client_(config)
{}
... |
//
// Copyright (c) 2002 David Gould
//
#ifndef BASICLOCATORMANIP_H
#define BASICLOCATORMANIP_H
#include <maya/MString.h>
#include <maya/MTypeId.h>
#include <maya/MPlug.h>
#include <maya/MVector.h>
#include <maya/M3dView.h>
#include <maya/MMatrix.h>
#include <maya/MDistance.h>
#include <maya/MPxManipContainer.h>
#i... |
/*
* Platform Specification Implementation
* Nana C++ Library(http://www.nanapro.org)
* Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com)
*
* 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)
*
* @file: _GUI/... |
#include <SimpleTimer.h>
#include <WiFi.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
#include <SPI.h>
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <time.h>
#include <sys/time.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <PubSubClient.h>
#include <aREST.h>
#include "soc/timer_group_... |
#include "aePlatformMath.h"
namespace aeEngineSDK
{
/*************************************************************************************************/
/* Common use math constants
/*************************************************************************************************/
const float aePlatformMath::SMALL_... |
#include <bits/stdc++.h>
using namespace std;
// Cell Class
class Cell {
private:
int x, y;
public:
Cell(const int &x, const int &y) {
this->x = x;
this->y = y;
}
void setCoordinates(const vector<int> &p) {
this->x = p[0];
this->y = p[1];
}
vector<int> getCoordinates() {
return {x, y};
}
};
// Ga... |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define show(x) {for(auto i: x){cout << i << " ";} cout<<endl;}
#define showm(m) {for(auto i: m){cout << m.x << " ";} cout<<endl;}
typedef long l... |
//
// Created on 05.03.18.
//
//
// Code translated to C++ from the original: https://github.com/eXascaleInfolab/cdrec
//
#include "CDMissingValueRecovery.h"
#include "../Stats/Correlation.h"
#include <iostream>
namespace Algorithms
{
CDMissingValueRecovery::CDMissingValueRecovery(arma::mat &src,
... |
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2007-2016 Hartmut Kaiser
// Copyright (c) 2008-2009 Chirag Dekate, Anshul Tandon
// Copyright (c) 2012-2013 Thomas Heller
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version... |
//
// Moto.cpp
// Apuntadores
//
// Created by Daniel on 22/09/14.
// Copyright (c) 2014 Gotomo. All rights reserved.
//
#include "Moto.h"
std::ostream & operator << (std::ostream & os, Moto & moto){
return os << "Soy una Moto"<<std::endl;
}
void Moto::Corre(){
std::cout<<"La moto corre\n";
} |
/* Pin toggling via interrupts
Put a button on PB2
and an LED on PB4
*/
#include "avr/interrupt.h"
#define LED PB4
void setup()
{
// set up PB2 to detect falling edges
GIMSK |= (1<<6); // INT0 bit
MCUCR |= 0b10; // falling edge
sei(); // enables interrupts
pinMode(LED, OUTPUT);
}
void loop()... |
#include <cstdio>
#define ElementType int
#define do_question(func_question) \
printf("%s:\n", #func_question); \
func_question()
#define printList(list) \
printf("%s (%d):\n", #list, list.len); \
listPrint(list)
struct ListNode
{
ElementType data;
ListNode *next;
};
stru... |
// Created on: 1993-02-19
// Created by: Remi LEQUETTE
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU ... |
#pragma once
#include <Windows.h>
#include <time.h>
#include <string>
//HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
void OnClose(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
void OnCreate(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
void OnKeyDown(HWND hWnd, UINT msg, WPARAM wParam, LPARA... |
#include "Passenger.h"
Passenger::Passenger(int _arrive, int _board, int _luggage, int _security, string _vip, string _online){
this->arrive = _arrive;
this->board = _board;
this->luggage = _luggage;
this->security = _security;
this->vip = _vip;
this->online = _online;
this->lastTime = _a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.