text
stringlengths
8
6.88M
#include <iostream> #include <stdio.h> #include <algorithm> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int score[8]; int sort5[8]; int *index = new int[5]; for(int i=0; i<8; i++) { cin >> score[i]; sort5[i] = score[i]; } ...
/* * SPDX-FileCopyrightText: (C) 2013-2022 Daniel Nicoletti <dantti12@gmail.com> * SPDX-License-Identifier: BSD-3-Clause */ #ifndef CUTELYSTPLUGIN_H #define CUTELYSTPLUGIN_H #include <Cutelyst/cutelyst_global.h> #include <QtCore/qhash.h> #include <QtCore/qobject.h> #include <QtCore/qstring.h> namespace Cutelyst {...
#include <boost/timer/timer.hpp> #include <seqan/index.h> #include <seqan/seq_io.h> #include <seqan/sequence.h> #include <fstream> #include <iostream> using namespace seqan; typedef StringSet< DnaString > string_set_t; typedef Index< string_set_t > index_t; typedef Iterator< index_t, TopDown<> >::Type top_down_t; ...
#ifndef __CRange #define __CRange #include <vector> using namespace std; ///////////////////////////////////////////////////////////////////// // 关于范围的描述。 class CRange { public: float fFrom; // 起始处 float fTo; // 终止处 public: CRange(float _from, float _to) { fFrom = _from; fTo = _to; } CRange() ...
#include <TimeAlarms.h> #include <TimeLib.h> #include <Time.h> #include <SPI.h> #define MY_RADIO_NRF24 #define MY_NODE_ID 251 #define R1_VALUE_ID 1 #define R2_VALUE_ID 2 #define VOLTAGE_ID 3 #define VOLTAGE_SENSE_PIN A0 #define THRESHOLD_VOLTAGE_PIN A1 #define MOSFET_DRIVER_PIN 3 #include <MyNodes.h> #include <MySen...
// // Created by sun on 19-8-1. // #ifndef EX_7_15_PERSON_H #define EX_7_15_PERSON_H class person { private: string strname; string straddress; public: person()=default; person(const string &name, const string &add) { strname=name; straddress=add; } person(std::istream &is...
#ifndef LINKED_LIST_EXAMPLE #define LINKED_LIST_EXAMPLE #include <iostream> #include <cstring> #include <exception> #include <fstream> #include <cassert> int size(const char *arr) { // if (*arr == '\0') -> return // -> 1 + size(++arr) int s = 0; if (arr == nullptr) return s; for (int i = ...
/* * Lab 3 * By: Daniel Speiser, Maria Shen, Mark Assad */ // library imports #include <Servo.h> // import servo library // global variable declarations and initializations Servo servo; // create servo object to control a servo int pwPin = 3; // declare pw pin 3 for sonar depth tracker i...
//----------------------------------------------------------------------------- // Perimeter Map Compiler // Copyright (c) 2005, Don Reba // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met:...
//Call centre program (Call class header) - Christopher Haynes - 10748982 #ifndef CALL_H //Used to clarify that this header file should only be used #define CALL_H //once when the linker is compling the program class Call //Defenition of the class Call { private: //Private variables and functions are not accessable ...
#include "settingdialog.h" #include "ui_settingdialog.h" SettingDialog::SettingDialog(QWidget *parent, int frameNum, QImage imgLeft, QImage imgRight, QSize size) : QDialog(parent), ui(new Ui::SettingDialog) { ui->setupUi(this); qApp->installEventFilter(this); this->frameNumber = frameNum; this-...
#include "Mutex.h" #include <cassert> // ThisThread::tid #include "ThisThread.h" USE_NAMESPACE Mutex::Mutex() : mutex_(), holder_(0) { pthread_mutex_init(&mutex_, nullptr); } Mutex::~Mutex() { // assert(holder_ == 0); pthread_mutex_destroy(&mutex_); } bool Mutex::isLockedByThisThread() const { retu...
// // LoadingScene.cpp // demo_ddz // // Created by 谢小凡 on 2018/2/8. // #include "LoadingScene.hpp" #include "RoomData.hpp" #include "FirstScene.hpp" using namespace cocos2d; Scene* LoadingScene::createScene() { return LoadingScene::create(); } LoadingScene::~LoadingScene() { RoomDataManager::destroyInsta...
/* tools/mkbootimg/mkbootimg.c ** ** Copyright 2007, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LIC...
#ifndef BSCHEDULER_API_HH #define BSCHEDULER_API_HH #include <bscheduler/config.hh> #include <bscheduler/ppl/basic_factory.hh> namespace bsc { typedef BSCHEDULER_KERNEL_TYPE kernel; enum Target { Local, Remote, Child }; template <Target t=Target::Local> inline void send(kernel* k) { factory.send(k); ...
/* * Copyright (C) 2007-2015 Frank Mertens. * * Use of this source is governed by a BSD-style license that can be * found in the LICENSE file. * */ #include <flux/Singleton> #include <flux/File> #include <flux/stdio> namespace flux { template<int fd> class StdIo: public Object, public Singleton< StdIo<fd> > { ...
#include <cstdio> #include <cstring> // 大数,10进制到2进制,这里还不知道大数除法所以是硬模拟写出来的,但思路是一样的 int main() { char t[32]; while (scanf("%s", t) != EOF) { int o[128] = {}; int i = 0; int cnt = 0; do { o[i++] = (t[strlen(t) - 1] - '0') % 2; for (int j = 0; j <...
#include <algorithm> #include <array> #include <cstdio> #include <iostream> #include <iterator> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <vector> #define ll long long using namespace std; typedef tuple<ll, ll, ll> tp; typedef pair<ll, ll> pr; const ll MOD = 1000000007;...
/** * Image Resource */ #ifndef FISHY_IMAGE_H #define FISHY_IMAGE_H #include <CORE/BASE/status.h> #include <CORE/MEMORY/blob.h> #include <CORE/types.h> #include <algorithm> #include <vector> namespace fsengine { namespace resources { /** * Image holder class */ class Image { public: /** * Input file form...
//using library #include<iostream> using namespace std; //using main functiobn int main(){ //declaring variables int i = 97; while (i <= 122){ char a = char (i); cout << a << endl; i++; } }
// // Created by NPCXU on 2020/11/8. // #include <stdio.h> #include <malloc.h> typedef int ElemType; typedef struct { ElemType data[50]; int length; } SqList; //建立顺序表 void CreateList(SqList *&list, ElemType elem[], int n) { list = (SqList *) malloc(sizeof(SqList)); for (int i = 0; i < n; i++) ...
#include "CShaderManager.h" #include "StringHelper.h" CShaderManager::CShaderManager(string config_path) { //parse well and map<string, string> VerShaderPaths; map<string, string> FragShaderPaths; map<string, string> PolygonData; map<string, string> ProgramData; string Line = ""; ifstream is(config_path.c_st...
/** * Created by Ken van der Eerden * Created on 22/7/2017 17:19 * Developed by * - Ken van der Eerden * - ... * * @Author Ken van der Eerden * @Version 1.0 */ #ifndef BAWS_TYPE_H #define BAWS_TYPE_H class Token { char const* _content; char const* _type; public: Token(char const* co...
#ifndef WIDGET_H #define WIDGET_H #include <QWidget> #include <QVector> #include <QDebug> #include <QFile> #include <QFileDialog> #include <QProcess> #include "region.h" #include "paintdisplay.h" namespace Ui { class Widget; } class Widget : public QWidget { Q_OBJECT public: explicit Widget(QWidget *parent...
#include "cinder/app/App.h" #include "cinder/app/RendererGl.h" #include "cinder/gl/gl.h" #include "cinder/Rand.h" #include "sp/Grid.h" #include "sp/KdTree.h" using namespace ci; using namespace ci::app; using namespace std; // Minimal verlet particle class struct Particle { void operator+=( const vec2 &position ){ ...
/** Assignment 2 1. enter a no. and find location done 2. insert element at given index done 3. delete element from an array done 4. perform binary search done 5. append one array element of integers to other 6. reverse all array element without using tempr...
#include<stdio.h> #include<stdlib.h> #include<unistd.h> #include<pthread.h> #include<string.h> #include<fcntl.h> #include<netinet/in.h> #include<arpa/inet.h> #include<netinet/tcp.h> #include<errno.h> #include"params.h" #include"miscutils.h" #include"clusterip.h" #include"clusterinfo.h" #include"pinger.h" extern CClus...
#include<bits/stdc++.h> using namespace std; int main() { map<char,int> mp; pair<char,int> p; p = make_pair('a',200); mp.insert(p); p = make_pair('b',500); mp.insert(p); for(auto x: mp) { cout<<x.first<<"->"<<x.second<<"\n"; } }
#ifndef DE_MATERIAL_H #define DE_MATERIAL_H #include "core/Program.h" #include "core/AssetDatabase.h" #include "data/Texture.h" #include <list> #include <cstdint> namespace de { namespace argv { class AShaderArg; } class DE_EXPORT Material : public ILoadableAsset { protected: static std::list<int16_t> ...
/** * Copyright (C) 2017 Alibaba Group Holding Limited. All Rights Reserved. * * * 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * ...
#ifndef MASK_HPP #define MASK_HPP class MaskFigure{ public: virtual ~MaskFigure()=0; protected: MaskFigure(); }; class MaskRound:public MaskFigure { public: MaskRound(); ~MaskRound(); }; class MaskRec:public MaskFigure { public: MaskRec(); ~MaskRec(); }; class MaskTri:public MaskFigu...
// Physics List #include "WCSimPhysicsList.hh" #include "WCSimPhysicsMessenger.hh" #include "G4ParticleDefinition.hh" #include "G4ParticleWithCuts.hh" #include "G4LeptonConstructor.hh" #include "G4MesonConstructor.hh" #include "G4BaryonConstructor.hh" #include "G4BosonConstructor.hh" #include "G4IonConstructor.hh" #i...
#include<algorithm> #include<iostream> #include<stdio.h> using namespace std; #define N 100100 int num[N]; int main() { long long m,n,t,i,sum; while(~scanf("%lld %lld",&n,&m)) { sum=0; for(i=0; i<n; i++) scanf("%d",&num[i]); for(i=0; i<n-2; i++) { t=...
#include <sstream> #include "JsonServer.h" #include <stdexcept> using std::string; using std::ostringstream; JsonServer::JsonServer() : running(true) { } string JsonServer::process(const char *str) { return process(string(str)); } string JsonServer::process(const string &str) { Json::Re...
#include "video.h" Video::Video() : Binary() { } Video::Video(const QString& id, const QString& titre, const QString &path, const QString &desc) : Binary(id,titre,path,desc) { } Note::NoteType Video::getType()const { return VIDEO; }
#ifndef COMPONENT_H_ #define COMPONENT_H_ #include "../ModelingTime.cpp" class Component{ private: static int countComponents; protected: double matrix[2][3]; int idComponent; public: Component(){ idComponent = countComponents; countComponents++; } virtual double* include(double value) = 0; int...
#include <iostream> #include "Animal.h" using std::cout; using std::endl; Animal::Animal( const int h, const int w ) { height = h; weight = w; } void Animal::print() const { cout << "This animal's height and weight are as follows\n" << "Height:" << height << "\tWeight: " << weight << endl << endl...
#pragma once #include "../pch.h" struct GameReport { std::vector<int> cards; std::vector<int> victoryPoints; std::vector<int> coins; };
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; cin>>n; vector<int>v(n); set<int>st; for(int i=0;i<n;i++){ cin>>v[i]; st.insert(v[i]); } sort(v.begin(),v.end()); if(st.size()==1) { cout<<0<<" "; cout<<(n*(n-1))/...
#include <Windows.h> #include "CubeApp.h" #include "Window.h" #include "Device.h" int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { CubeApp cube; App::Desc desc; desc.winDesc.title = "Cube App"; desc.winDesc.width = 800; desc.winDesc.he...
#pragma once #include "Types/vector3.h" class Object { public: Object(); virtual unsigned int getID() const = 0; protected: unsigned int ID; };
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QtGui> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { this->initialized = false; ui->setupUi(this); qApp->installEventFilter(this); this->ui->btnStop->setEnabled(false); ui->graphicsView-...
#include "bnb_MPI.cpp" class TSP_Problem; class TSP_Solution: public Solution{ public: int cost; vector<int> taken; // list of vertices traversed int pos; // length of the current path int get_cost(); bool is_feasible(); void print_sol(); int get_bound(); int to_str(char *buf); }; class TSP_Problem: ...
#include <memory> #include "simphys/force_generator.h" #include "simphys/vec3.h" #include "simphys/particle.h" #include "simphys/force_wind.h" namespace simphys { using std::shared_ptr; class vec3; class Particle; // Assign gravity value to force (arbitrary direction) ForceWind::ForceWind ( const vec3 _wind )...
// https://www.hackerearth.com/practice/algorithms/graphs/articulation-points-and-bridges/tutorial/ #include <cstdio> #include <vector> #include <list> #include <set> using namespace std; int n; vector<bool> vis; vector<int> tin, low; vector<list<int>> adj; set<int> articulation_points; set<pair<int, int>> bridges;...
#include <iostream> #include "requests.h" #include "import.h" using std::cout; using std::cin; using std::endl; int main(int argc, char *argv[]) { if (argc != 2) return 1; Requests requests; cin >> requests; Import import(requests); auto ret = import.import(argv[1]); if (ret) return ret; cout << requests...
#include <Segments/Visitor.hpp> #include <iscore/actions/Menu.hpp> #include <QInputDialog> #include "iscore_addon_segments.hpp" #include <iscore/actions/ActionManager.hpp> #include <iscore/actions/MenuManager.hpp> namespace Segments { struct ApplicationPlugin : public QObject, public iscore::GUIApplic...
#include <iostream> #include <string> #include <fstream> #include <iomanip> using namespace std; //function prototypes void readLines(fstream *file, int&, string, string *); void searchArray(string, string *, int); void requestUserInput(string&); //main Function int main() { //declaring all variables fstream file...
#include "grayimage.h" #include"note.h" GrayImage::GrayImage(string fileName) { this->bmpfileheader=new BITMAPFILEHEADER; this->bmpinfoheader=new BITMAPINFOHEADER; this->rgbquad=new RGBQUAD[256]; this->fileName=fileName; dialog=new QProgressDialog; //设置进度对话框采用模态方式进行,即显示进度的同时,其他窗口将不响应输入信号 di...
// // Created by Liang on 2019-07-14. // #include <string> #include <iostream> #include <cstring> using namespace std; class Solution { public: string longestPalindrome(string s) { // 计算字符串的最长子字符串 if(s.length() == 0) return ""; string new_s = ""; for(auto c: s){ ...
#ifndef FORMATINPUT_H #define FORMATINPUT_H #include <QObject> #include <QQmlComponent> /* This function formats the data input while the user is typing example ---> ( AB CD 45 73 ) */ class FormatInput : public QObject { Q_OBJECT public: explicit FormatInput(QObject *parent = 0); Q_INVOKABLE QS...
// // Created by 梁栋 on 2019-01-10. // #include <iostream> #include <vector> using namespace std; class Solution { public: string longestCommonPrefix(vector<string>& strs) { int pos = 0; string res = ""; if(strs.size() == 0){ return res; } if(strs.size() == 1){ ...
//************************************************************************************************* //************************************************************************************************* //* The MIT License (MIT) * //* Copyright (C) 2...
#include <iostream> #include <string> #include <cmath> #include <vector> using namespace std; int find_sum(int); int is_palindrome(int, int); int recursive_check(int, int); int find_lower_bound(int num, int length); int main() { string s; cin >> s; int length = s.length(); int num = 0; for (int...
/* * Copyright (C) 2007-2015 Frank Mertens. * * Use of this source is governed by a BSD-style license that can be * found in the LICENSE file. * */ #include <flux/tar/ArchiveReader> namespace flux { namespace tar { void ArchiveReader::skipData(ArchiveEntry *entry) { readData(entry); } }} // namespace flux...
// // Created by anggo on 5/17/2020. // #include "Centipede.h" Centipede::Centipede() :mushroom("Sprites/mushroom.png"),p("Sprites/blaster.png") { image_path = "Sprites/Centipede.png"; title = "Centipede"; info_path = "Information/info.txt"; load_game(); } void Centipede::start(sf::Render...
#pragma once #include "revoke.h" #include "sol2/sol.hpp" #include <map> #include <string> struct CSLua { struct CSStaticCall { sol::variadic_results operator()(const sol::variadic_args va) { printf("Called with %lu args\n", va.size()); sol::variadic_results r; ...
#pragma once #include <vector> #include <string> #include "misc.h" #include "png.h" struct GameDesc { uint32_t id; std::string name; std::string desc; std::vector<std::string> assets; }; struct Asset { Image image; std::string name; }; enum EGameErrorCode { kGa...
#include<iostream> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/opencv.hpp> using namespace cv; int main() { VideoCapture capture(0); while (1) { Mat frame; Mat edge,grayimage; capture >> frame; if (frame.empty()) break; cvtColor(frame, grayimage, CV_BGR2GRAY); blur(grayimage,edge, Size(6,...
#include <iostream> #include <string> #include <vector> using namespace std; #ifndef _command_H #define _command_H class command{ public: virtual bool run(bool prev) = 0; command(const vector<string>& arr); protected: bool internalRun(); private: ve...
#include <opencv2/opencv.hpp> #include <iostream> using namespace cv; int main() { //载入原始图 Mat srcImage = imread("D:\\18.jpg"); Mat midImage, dstImage; //canny检测边缘转化为灰度图 Canny(srcImage, midImage, 50, 200, 3); cvtColor(midImage, dstImage, CV_GRAY2BGR); //进行霍夫变换 std::vector<cv::Vec2f> lines; HoughLines(midIma...
#include "player.h" #include <iostream> #include <string> #include <array> #include <cstdio> #include <ctime> using namespace std; Player::Player(string piece){ team = 1; this->piece = "X"; if(piece == "O"){ team = -1; this->piece = "O"; } } //Converts the teams id to game piece string...
// ChildView.h : interface of the CChildView class // #pragma once #include <freewill.h> // obligatory #include <fwrender.h> // to start the renderer #include <fwaction.h> // actions class CCamera; // CChildView window class CChildView : public CWnd { // FreeWill Objects IFWDevice *m_pFWDevice; ...
#include <vector> #include <utility> // std::pair, std::make_pair #define cube_size (int)16 #define backgroundColor (uint16_t)0b0011000110000110 #define appleColor (uint16_t)0b1111100000000000 class Game { public: std::pair <int, int> UP; std::pair <int, int> DOWN; std::pair <int, int> LEFT;...
/*원본소스 //tstbtree.cc #include "btnode.h" #include "btnode.tc" #include "btree.h" #include "btree.tc" #include <iostream.h> const char * keys="CSDTAMPIBWNGURKEHOLJYQZFXV"; const int BTreeSize = 4; main (int argc, char * argv) { int result, i; BTree <char> bt (BTreeSize); result = bt.Create ("testbt.dat",ios::in|ios...
//Problem Link: https://www.codechef.com/problems/HIGHWAYC #include <bits/stdc++.h> using namespace std; main() { long int t; cin >> t; cout << fixed << showpoint; cout << setprecision(6); while (t--) { int n; double s, y; cin >> n >> s >> y; double p[n], v[n], d...
class Solution { public: vector<int> spiralOrder(vector<vector<int>>& matrix) { vector<int> res; if(matrix.empty()) return res; int m = matrix.size(); int n = matrix[0].size(); int cur = 0; while(2 * cur < m && 2 * cur < n) { for(int j ...
// AUTHOR: Sumit Prajapati #include <bits/stdc++.h> using namespace std; #define ull unsigned long long #define ll long long #define int long long #define pii pair<int, int> #define pll pair<ll, ll> #define pb push_back...
#include "vtkMetaImageReader.h" #include "vtkSmartPointer.h" #include "vtkContourFilter.h" #include "vtkSmoothPolyDataFilter.h" #include "vtkDecimatePro.h" #include "vtkPLYWriter.h" #include "vtkPolyDataWriter.h" #include "tinyxml.h" #include <sstream> #include <iostream> #include <string> #include <vector> ...
#include <Keypad.h> #include <SPI.h> #include <TimeAlarms.h> #include <TimeLib.h> #include <Time.h> #define SUMP_RELATED_NODE #define NODE_HAS_RELAY #define NODE_WITH_HIGH_LOW_FEATURE #define WATER_TANK_NODE #define KEYPAD_1R_2C #define MY_RADIO_NRF24 #define MY_NODE_ID SUMP_MOTOR_NODE_ID #define MY_PARENT_NODE_ID RE...
/*************************************************************************** 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...
/* ------------------------------------------------------------------------- // 文件名 : tinyhttp.cpp // 创建者 : magictong // 创建时间 : 2016/11/16 17:13:55 // 功能描述 : support windows of tinyhttpd, use mutilthread... // // $Id: $ // -----------------------------------------------------------------------*/ /* J. David's webser...
// // Created by Fabian Terhorst on 02.12.19. // #ifndef NATIVE_JAVAFUNCTION_H #define NATIVE_JAVAFUNCTION_H #include <jni.h> #include <jni.h> #include "Function.h" /** * A C++ Function suitable for JNI calls. */ class JavaFunction : public Function { private: JNIEnv* env; // JVM environment jobject...
// myinterpreter.cpp : Defines the initialization routines for the DLL. // #include "stdafx.h" #include "myinterpreter.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif #include<stdio.h> #include<string.h> #include<stdlib.h> #include "datastructure.h" // // Note! // /...
#include<stdio.h> #include<malloc.h> #include<stdlib.h> struct tnode{ int data; struct tnode *left; struct tnode *right; }; struct snode{ struct tnode *t; struct snode *next; }; struct tnode *newNode(int data){ struct tnode *temp=(struct tnode *)malloc(sizeof(struct tnode)); temp->data=data; ...
#define ROW_1 2 #define ROW_2 3 #define ROW_3 4 #define ROW_4 5 #define ROW_5 6 #define ROW_6 7 #define ROW_7 8 #define ROW_8 9 #define COL_1 22 #define COL_2 23 #define COL_3 24 #define COL_4 25 #define COL_5 26 #define COL_6 27 #define COL_7 28 #define COL_8 29 int button1=36; int button2=38; int control1; int con...
/* * parser.cpp * * Created on: 9 Nov 2013 * Author: leal */ #include <iostream> #include <fstream> #include <vector> #include <string> #include <map> #include <boost/lexical_cast.hpp> #include <boost/algorithm/string/erase.hpp> class ILLParser { public: ILLParser(const std::string &filename) { fin.ope...
#include<bits/stdc++.h> #define ll long long #define io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) using namespace std; #define N 100000 #define limit 10000 int main() { io; ll test_case; //cin>>test_case; test_case=1; while(test_case--) { int n,k; cin>>n; ...
/* 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...
// 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.UI.Xaml.3.h" #include "internal/Windows.Foundation.3.h" #include "internal/Windows.UI.Xaml.Controls.Primitives.3.h" #include "in...
/** <p> This unit test shapes the spirit code for the ntriples ebnf grammer. During operation this also fires small console events to indicate the event state during a commandline pipe operation. currently this is run by executing : <pre> jnorthrup@dove /c/work/sandbox/agent/release $ ./ntriple_grammar.exe < ../a...
// 使用for循环,答应10~1 #include <iostream> using namespace std; int main(){ for(int i=10;i>=0;i--) cout << i <<endl; return 0; }
/* * 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...
/* * Interface Character * @author Patricio Ferreira <3dimentionar@gmail.com> */ #ifndef HEADERS_CHARACTER_H_ #define HEADERS_CHARACTER_H_ #include <string> #include <boost/uuid/uuid.hpp> namespace game_model { typedef enum { HEROE = 1, ENEMY = 2, PASSIVE = 3, } CharacterType; c...
/* 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 "Nodo.h" Nodo::Nodo(string ciudad) { this->ciudad = ciudad; //ctor } Nodo::~Nodo() { //dtor }
// // Created by 王润基 on 2017/4/19. // #include <cmath> #include "SpotLight.h" SpotLight::SpotLight(Color const &color, const Ray &ray, float angle, float edgeAngle) : ray(ray), angle(angle), edgeAngle(edgeAngle) { this->color = color; } Light SpotLight::illuminate(Vector3f const &point) const { Color...
int Solution::searchMatrix(vector<vector<int> > &arr, int k) { int n=arr.size(),m=arr[0].size(); for(int i=0;i<n;i++){ if(arr[i][0]>k) break; if(arr[i][m-1]<k) continue; if(binary_search(arr[i].begin(),arr[i].end(),k)) return 1; } return 0; }
/********************************************************************* Matt Marchant 2014 - 2016 http://trederia.blogspot.com xygine - Zlib license. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this soft...
#include "multi_pipeline.hh" #include "config.hh" template <class T> bsc::Multi_pipeline<T>::Multi_pipeline(unsigned npipelines): _pipelines(npipelines) { unsigned num = 0; for (base_pipeline& ppl : this->_pipelines) { ppl.set_number(num); ++num; } } template <class T> void bsc::Multi_pipeline<T>::set_name(con...
class Solution { public: bool canFinish(int numCourses, vector<vector<int>>& prerequisites) { // 本题是BFS,也可以认为是拓扑排序。这些基本原理见代码后面的附录。 // 为了描述方便,称0入度的课为初级课,需要入度的是高级课。 vector<vector<int>> edges(numCourses); // edges用来存初级课下面的高级课,就像是一个node连着几门大课,有几门课就有几条edge vector<int> inDegree(numCourses); /...
/* * Copyright 2016-2017 Flatiron Institute, Simons Foundation * * 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required ...
// This file has been generated by Py++. #ifndef FrameWindow_hpp__pyplusplus_wrapper #define FrameWindow_hpp__pyplusplus_wrapper void register_FrameWindow_class(); #endif//FrameWindow_hpp__pyplusplus_wrapper
#ifndef _DATACONFIGREADER_H_ #define _DATACONFIGREADER_H_ #include <QString> //#include "moduleBase/IOBase.h" #include <QFile> #include "DataProperty/modelTreeItemType.h" class QDomElement; class QDomDocument; namespace ConfigOption { class DataConfig; class PostConfig; class DataConfigReader //: public Module...
#pragma once #include "Set.h" #include <set> namespace TestSet { void TestAll(); #if PRINT_INT_TREE void TestPrintSet(); #endif } // SET OUTPUT template<class K> std::ostream &operator<<(std::ostream &os, std::set<K> const &m) { os << "{"; bool first = true; for (auto const &v : m) { if (!first) { os...
/* * CstyleIndex.h * * Created on: Oct 8, 2013 * Author: vbonnici */ #ifndef CSTYLEINDEX_H_ #define CSTYLEINDEX_H_ #include <stdio.h> #include <string.h> #include <vector> #include <bitset> #include "data_ts.h" #include "sais.h" #include "DNA5Alphabet.h" namespace dolierlib{ /* * print the suffix (of...
#ifndef ___DISPLAY__HPP #define ___DISPLAY__HPP #include "Catalog.hpp" #include <string> #include <iostream> #include <cctype> using namespace std; class Display { public: virtual ~Display() = default; virtual void display(vector<Book*> books,ostream& out) = 0; bool iequals(const string& a, const string& b) ...
// Question Name :- P 302 - A Smaller Team // /*The coach from the previous problem has now changed his mind. He only wants to take n-k people into the team. He asks the first person in the line to go find the shortest person and switch places with him. He then asks the second person in line to go find the second shor...
/* On a plane there are n points with integer coordinates points[i] = [xi, yi]. Your task is to find the minimum time in seconds to visit all points. You can move according to the next rules: In one second always you can either move vertically, horizontally by one unit or diagonally (it means to move one unit vertic...
#include <limits.h> #include <iostream> #include <ctime> #include <cfenv> #include <cmath> #include <memory> #include <string> #include "data_region_a.h" #include "data_region_base.h" #include "data_region_bare_base.h" using namespace std; const int kColCount = 16*16; const int kRepetition = 10; const int kReqUnits =...