text
stringlengths
8
6.88M
#include<iostream> #include<string> #include<stdlib.h> #include<stdio.h> using namespace std; //ham kiem tra loi bool kiemtraloi(string chuoi) { //lay so ki tu chuoi int length=chuoi.length(); int dem=0; for(int i=0;i<length;i++) { /*day co su khac biet: trong chuoi so cung la 1 ki tu nhung no cung hie...
#include "binject.h" #include <stdio.h> #include <string.h> #include <errno.h> #include "unistd.h" // Size of the data for the INTERNAL ARRAY mechanism. It should be // a positive integer #ifndef BINJECT_ARRAY_SIZE #define BINJECT_ARRAY_SIZE (9216) #endif // BINJECT_ARRAY_SIZE static void error_report(int internal_e...
#include <iostream> #include <string> #include <fstream> //for getLine(), creating ifstream inputs #include <sstream> using namespace std; //taken from hw3 description //modification:deleted the constructor with parameter since it is not needed struct lectureNode{ string lectureName; lectureNode *next; lectureNode...
#include "CNHeatEqMethod.hpp" template<typename X> CNHeatEqMethod<X>::CNHeatEqMethod(Option<X> *__option, X _S_min, X _S_max, int _N, int _M) : FDHeatMethod<X>(__option, _S_min, _S_max, _N, _M) { this->K_1 = new std::vector<X>(this->M + 1); this->K_2 = new std::vector<X>(this->M + 1); for (int i = ...
//<<<<<< INCLUDES >>>>>> #include "Geometry/HcalAlgo/plugins/DDHCalAngular.h" #include "Geometry/HcalAlgo/plugins/DDHCalBarrelAlgo.h" #include "Geometry/HcalAlgo/plugins/DDHCalEndcapAlgo.h" #include "Geometry/HcalAlgo/plugins/DDHCalEndcapModuleAlgo.h" #include "Geo...
#include "gast_manager.h" #include <core/Godot.hpp> #include <core/NodePath.hpp> #include <core/Vector2.hpp> #include <core/Vector3.hpp> #include <gen/Engine.hpp> #include <gen/Input.hpp> #include <gen/InputEventAction.hpp> #include <gen/MainLoop.hpp> #include <gen/SceneTree.hpp> #include <gen/Object.hpp> #include <ge...
#include "stdafx.h" #include "CppUnitTest.h" #ifndef ELYSIUM_DATA_FILTERING_QUERYEXPRESSION #include "../../../Extended/01-Shared/Elysium.Data/QueryExpression.hpp" #endif #include <string> using namespace Elysium::Data::Querying; using namespace Microsoft::VisualStudio::CppUnitTestFramework; namespace U...
#ifndef CONNECT_MODE_HPP #define CONNECT_MODE_HPP #include <boost/asio/io_service.hpp> #include "settings.hpp" #include "scoped_descriptor.hpp" #include "exception.hpp" namespace sp { class connect_mode { public: typedef sp::exception<connect_mode> exception; connect_mode(boost::asio::io_service& ios, const set...
#include <conio.h> #include <stdlib.h> #include <stdio.h> #include <time.h> #include <string.h> #include <math.h> #include <locale.h> #include <ctype.h> int ladoa,ladob,ladoc; int x=0; int main() { printf(" \n Digite a primeira medida:\n"); scanf("%d",&ladoa); printf(" \n Digite a segunda...
#include "LytWString.h" LytWString::LytWString() { Length=0; String=new wchar_t[Length+1]; wcscpy(String,L""); } LytWString::LytWString(const wchar_t& Temp) { Length=1; String=new wchar_t[Length+1]; String[0]=Temp; String[1]=0; } LytWString::LytWString(const wchar_t* Temp) { Length=(int)wc...
// Problem => Pascal Triangle #include<iostream> using namespace std; int main(){ int row, col, space, n, no; cout<<"Please enter number of rows: "; cin>>no; for(row = 0; row<no; row++){ // Loop to print space for(space=0; space< (no - row); space++){ cout<<" ";...
#include <iostream> using namespace std; int f(int n) { int a[10000]; if(n==1)return 0; return f(n-1); } int main() { int n; cin>>n; f(n); return 0; //52 }
// Fill out your copyright notice in the Description page of Project Settings. #include "Hypoxia.h" #include "TestGlowItem.h" ATestGlowItem::ATestGlowItem() { Light = CreateDefaultSubobject<UPointLightComponent>(TEXT("Glow")); Light->SetIntensity(0.0f); Light->SetupAttachment(Item); } void ATestGlowItem::Tick(flo...
#include <iostream> class Queue { private: int size; int count; int *arr; public: Queue(int a = 5) { size = a; count = 0; arr = new int [size]; for(int i = 0; i < size; ++i) { arr[i] = -1; } } ~Queue() { delete[] arr; } Queue (Queue& obj) { t...
/**************************************************************************** * * * Author : lukasz.iwaszkiewicz@gmail.com * * ~~~~~~~~ * * Lice...
class ItemCrowbar : ItemCore { scope = 2; model = "\dayz_equip\models\crowbar.p3d"; picture = "\z\addons\dayz_communityassets\pictures\equip_crowbar_CA.paa"; displayName = $STR_EQUIP_NAME_CROWBAR; descriptionShort = $STR_EQUIP_DESC_CROWBAR; class ItemActions { class Toolbelt { text = $STR_ACTIONS_RFROM...
// // NamedEvent.cpp // // $Id: //poco/1.4/Foundation/src/NamedEvent.cpp#2 $ // // Library: Foundation // Package: Processes // Module: NamedEvent // // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. // and Contributors. // // SPDX-License-Identifier: BSL-1.0 // #include "_/NamedEvent.h" #...
#include<stdio.h> #include<conio.h> void swap(char *a,char *b) { int t=*a; *a=*b; *b=t; } void permute(char a[],int start,int end) { if(start == end) printf("%s\n",a); for(int j=start;j<=end;j++) { swap((a+start) , (a+j)); permute(a...
#include "GnMeshPCH.h" #include "GnGamePCH.h" #include "GUserCtlrManager.h" #include "GUserController.h" #include "GnIButton.h" #include "GInterfaceLayer.h" #include "GCollectComponentHeader.h" #include "GInfoBasic.h" #include "GActionAttackCheck.h" #include "GFarAttack.h" #include "GBoltAttack.h" GUserCtl...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- * * Copyright (C) Opera Software ASA 2012 * * ECMAScript source formatter. */ #include "core/pch.h" #include "modules/ecmascript/carakan/src/es_pch.h" #include "modules/ecmascript/carakan/src/compiler/es_compi...
/* -*- Mode: c++; tab-width: 4; 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. * * Allowed #if-ery: SYSTEM_* defines, lea_malloc config. */ #ifndef POSIX_SYS_DECLARE_...
//////////////////////////////////////////////////////// // Система поиска документов по словам //////////////////////////////////////////////////////// //У вас есть множество документов. И есть стоп-слова. //Приходит запрос некоторый. //Найдите все документы, где есть хотя бы одно слово из запроса. //Учтите стоп-сло...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2012-2012 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_SERVER_NAME_H__ #define __OP_SERVER_NAME_H__ #incl...
/* * Copyright 2021 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
#include"parentMode.h" #include"Timeset.h" #pragma execution_character_set("utf-8") USING_NS_CC; #define H_PI 1.570796327f //#include"FlowWord.h" #include "DropDownList.h" #include"ScrollViewScene.h" #include"HelloWorldScene.h" #include"parentstudy.h" #include"introduction.h" #define database UserDefault::getI...
#pragma once #include <string> #include "Model.h" namespace engine{ Model loadModelFile(std::string file, bool &error); }
// Created on: 2005-10-14 // Created by: Mikhail KLOKOV // Copyright (c) 2005-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 a...
#include "BrushStone.h" #include "omp.h" #include "Misc.h" BrushStone::BrushStone() { setFuzzy( 10.0f ); setRadius( 40.0f ); setSize( 60 ); transparency = 255; borderTransparency = 255; brushStokeCount = 50; brushStrokeSizeMin = 20; brushStrokeSizeMax = 80; brushStrokeAlpha = 240; saturation =...
#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; struct point { ...
//Copyright 2011-2016 Tyler Gilbert; All Rights Reserved #include "hal/Uart.hpp" using namespace hal; Uart::Uart(port_t port) : Periph(CORE_PERIPH_UART, port) {} int Uart::get_attr(uart_attr_t & attr){ return ioctl(I_UART_GETATTR, &attr); } int Uart::set_attr(const uart_attr_t & attr){ return ioctl(I_UART_SETATT...
// Created on: 1995-11-15 // Created by: Jean-Louis Frenkel <rmi@pernox> // 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...
#include <iostream> #include <queue> #include <algorithm> int main() { std::cin.sync_with_stdio(false); std::cin.tie(NULL); int n, mid = 10001; std::priority_queue<int> l; std::priority_queue<int, std::vector<int>, std::greater<int>> r; std::cin >> n; for(int i = 0; i < n; i++) { ...
// Created on: 1997-11-20 // Created by: Philippe MANGIN // Copyright (c) 1997-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> #include "lc.h" using namespace std; extern int yylex(); extern char* yytext; int table[5][6]={{1,0,0, 0, 0}, {0, 2, 0 ,0 ,3, 3,}, {4 ,0 ,0 ,4 ,0, 0}, {0 ,6 ,5, 0, 6 ,6}, {8 ,0 ,0 ,7 ,0 ,0}}; map <int,string> prod; map <char,int> r,c; int parse(string s) { //cout<<s<<" "; stack <char> st; ...
/**************************************************************************** * * * Author : lukasz.iwaszkiewicz@gmail.com * * ~~~~~~~~ * * Lice...
/** * @file scene.hpp * * Scene class include file. */ #ifndef BETELGEUSE_SCENE_HPP #define BETELGEUSE_SCENE_HPP namespace betelgeuse { class object; class light; /** * The scene class is used for rendering. It combines all object types and * all instances and renders them onto the screen....
class MinStack { private: stack<int> numStk; stack<int> minStk; public: /** initialize your data structure here. */ MinStack() { } void push(int x) { numStk.push(x); if(minStk.empty() || minStk.top() >= x) minStk.push(x); } void pop() { if(minStk.top() =...
#include <vector> #include <queue> #include "UF.hpp" #include "WeightGraph.h" #include "PQ.hpp" #ifndef KRUSKAL_HPP #define KRUSKAL_HPP class Kruskal { private: std::queue<Edge> mst; WeightQuickUnion uf; PQ<Edge> pq; double weight; public: Kruskal(WeightGraph &G) : uf(G.getV()), pq(G.getE()), wei...
// // Containers.h // // The MIT License (MIT) // // Copyright (c) 2015 Bradley Wilson // // 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...
#include<iostream> #include "CFBoard.hpp" /************************************************************************** makeMove Function *This function is to make piece move by passing column and x coordinate after each left or right move, then record its total distance. If the argument is greater and equal to 0, tot...
#ifndef __SKILLCAT__HPP__ #define __SKILLCAT__HPP__ #include "Skill.hpp" class UniqueSkill: public Skill{ private: // Species of the Unique Skill string Species; public: // Default Constructor UniqueSkill(); // User-Defined Constructor UniqueSkill(string name, in...
#include "BugStateMachine.h" #include <cmath> bool BugStateMachine::checkWall(const std::vector<lidar::LidarData>& data) const { int cnt = 0; for (const auto& d : data) { if (std::abs(d.angle) < 30 && d.dist < 500) { ++cnt; } } if (cnt > 5) { return true; } return false; } void BugStateMachine::to_Ta...
#pragma once #include <SFML\Graphics.hpp> #include <vector> #include <random> class CellGrid { public: CellGrid(); CellGrid(int numberCellsX, int numberCellsY, int cellWidth, int cellHeight, int FPS); ~CellGrid(); void draw(sf::RenderWindow& window); int getIndexVertex(int i, int j); int getIndex(int i, int j);...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- * * Copyright (C) 1995-2008 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 VEGA_SUPP...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> using namespace std; const int inf = 1e9 + 7; int f[100100]; struct Edge { int from,to,dist; }; ...
// Example 4.2 : Inheritance, overriding, polymorphism, virtual methods // Created by Oleksiy Grechnyev 2017 #include <iostream> #include <memory> #include "./Monster.h" #include "./Vampire.h" int main(){ using namespace std; { cout << "\nMonster demo : \n\n"; Monster g("Grshnak", "Gobli...
#include "node_robot_2.h" Robot_2::Robot_2() { robot_id = 2; robot_state = "ready"; work_task_id = 0; robot_2_info_client = m_handle.serviceClient<node_robot_msgs::robot_info_report>("robot_info"); agent_task_2_server = m_handle.advertiseService("agent_task_2",&Robot_2::server_deal,this); run(); } Robot_2::~R...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> using namespace std; bool vis[1010]; int main() { int n,m,k; scanf("%d",&n); scanf("%d",...
#include "cmdline.h" #include "io_data.h" int main(int argc, char* argv[]) { //set parameters cmdline::parser cmd; cmd.add<double>("eta", '\0', "noise strength", true); cmd.add<double>("eps", '\0', "disorder strength", false, 0); cmd.add<double>("Lx", 'L', "system length in x direction", true); cmd.add<dou...
#pragma once #ifndef _VECTOR_H #define _VECTOR_H #include "init.h" #include "math.h" class Vector { public: Vector(); Vector(float x, float y, float z); Vector(const Vector& vec); //void set(float x, float y, float z); //void set(Vector& vec); void normalize(); float dot(Vector b); float length(); float dis...
/* * Copyright 2016 Freeman Zhang <zhanggyb@gmail.com> * * 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 by applic...
// CommandLineOptions.h #ifndef SIMPLE_COMMAND_LINE_OPTIONS_H #define SIMPLE_COMMAND_LINE_OPTIONS_H #include <string> #include <map> #include <set> #include <vector> #include <stdexcept> namespace simple { class CommandLineOptions { public : class ParseException; public : explicit Comma...
// Copyright (c) 2007-2017 Hartmut Kaiser // Copyright (c) 2013 Agustin Berge // // SPDX-License-Identifier: BSL-1.0 // 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) #pragma once #include <pika/config.hpp> #in...
#include "2-1.h" int main() { int no, count; cin >> no; cin >> count; class Sum A(no, count); cout << A.result(); return 0; } /* #include <iostream> using namespace std; class Sum { private: int a, b; public: Sum(int no, int count) { a = no; b = count; } int result() { return a + b; } }; int s...
/* TouchKeys: multi-touch musical keyboard control software Copyright (c) 2013 Andrew McPherson 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 3 of the License, or (at you...
// Copyright (c) 2022 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 ...
#ifndef math_util_h #define math_util_h #include "util.hpp" #include "linalg_util.hpp" #include <algorithm> namespace avl { inline float to_radians(float degrees) { return degrees * float(ANVIL_PI) / 180.0f; } inline float to_degrees(float radians) { return radians * 180.0f / float(ANVIL_PI); } temp...
#include "condmentdecorator.h" CondmentDecorator::CondmentDecorator(Beverage *b) { this->beverage = b; }
#include <memory> #include <vector> #include <rend/rend.h> #include <string> class Shader; class MaterialAttribute; class Texture; //! The Material class. The class that controlls what your Mesh looks like. /*! This class is used to set the look of your 3D objects. This class uses a Shader and a Texture to calculate...
#include "afficherclient.h". #include "ui_afficherfinance.h" #include <QPalette> #include <QDesktopWidget> #include <QtGui> #include"menuprincipale.h" #include"menuprincipale.h" afficherclient::afficherclient(QWidget *parent) : QDialog(parent), ui(new Ui::afficherfinance) { ui->setupUi(this); QPalette ...
#pragma once #include "DAOImpl.h" // fa::MySQLPersonDAO #include "GlobalHeader.h" // fa::String #include <utility> // std::move #include <mylibs/detail/meta_functions.hpp> // pl::value_type namespace fa { //! delegates to a concrete PersonDAO such as MySQLPersonDAO template <class TargetPersonDAO> ...
// stdafx.cpp : source file that includes just the standard includes // JPEGView.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" #if (_ATL_VER < 0x0700) #include <atlimpl.cpp> #endif //(_ATL_VER < 0x0700) #if defined(_MSC_VER) && (_MSC_VE...
// Copyright (c) 2019, tlblanc <tlblanc1490 at gmail dot com> #ifndef IO_FLUSHERWRITER_H_ #define IO_FLUSHERWRITER_H_ #include <stddef.h> #include "writer.hpp" #include "flusher.hpp" class FlusherWriter : public Writer, public Flusher { public: FlusherWriter() = default; virtual ~FlusherWriter() = default; }; ...
#include "aeGOFactory.h" namespace aeEngineSDK { aeGOFactory::aeGOFactory() { } aeGOFactory::~aeGOFactory() { } aeGOFactory::aeGOFactory(const aeGOFactory &) { } aeGOFactory & aeGOFactory::operator=(const aeGOFactory &) { return *this; } void aeGOFactory::OnStartUp() { } void aeGOFactory::OnShut...
// // Created by 钟奇龙 on 2019-05-16. // #include <iostream> #include <vector> #include <map> using namespace std; int getMaxLength(vector<int> arr,int target){ if(arr.size() == 0){ return 0; } int sum = 0; map<int,int> m; m[0] = -1; int maxLength = 0; for(int i=0; i<arr.size(); ++i)...
#include <iostream> #include <algorithm> using namespace std; int main(void) { ios::sync_with_stdio(false); cout.tie(NULL); cin.tie(NULL); int n, start, end, count = 0; int series[2001]; cin >> n; for (int i = 0; i < n; i++) cin >> series[i]; sort(series, series + n); for (int i = 0; i < ...
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- // // Copyright (C) Opera Software AS. All rights reserved. // // This file is part of the Opera web browser. It may not be distributed // under any circumstances. #ifndef WEBFEEDUTIL_H_ #define WEBFEEDUTIL_H_ #ifdef WEBFEEDS_BACKEND_SUPPO...
#include<iostream> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; int min=a; if(b<min) min=b; if(c<min) min=c; cout<<min; }
#include<stdio.h> #define MAX 100 #define COUNTBY 3 int main() { int i; for(i=0;i<MAX;i++) { if(!(i%COUNTBY)) { printf("%d\n",i); } } return 0; }
#define DayZVersion "DayZ Epoch 1.0.7"
#include "Scene.h" #include "Debug.h" #include "Util.h" using namespace gg; Scene::Scene() { _shader = new Shader(Util::resourcePath + "Shaders/basic.vert", Util::resourcePath + "Shaders/basic.frag"); } Scene::~Scene() { delete _shader; }
#ifndef GRAPHWIDGET_H #define GRAPHWIDGET_H #include <QGraphicsView> #include "../../framework/Configuration.hpp" #include "../framework/GUIEventDispatcher.hpp" namespace uipf{ namespace gui{ class Node; //A Class that displays the uipf::Configuration as a directed graph. //layout is generated automatically with fr...
#pragma once namespace Poco { class File; } namespace BeeeOn { class FileLoader { public: virtual ~FileLoader(); virtual void load(const Poco::File &file) = 0; virtual void finished() = 0; }; }
#ifndef SPRING_GRAV_OBJ #define SPRING_GRAV_OBJ #include "SelectGravityObject.h" #include <map> class SpringObject : public SelectGravityObject { public: SpringObject(); SpringObject(int weight, Vector* position = new Vector(), Vector* speed = new Vector(), Vector* acceleration = new Vector(), std...
// Given two sorted arrays a,b and integer x determine // whether b can rearrange so that a[i] + b[j] < x #include <iostream> using namespace std; int main() { int t; cout<<"Enter t "; cin>>t; while(t--) { int n,x; cout<<"\nEnter n,x "; cin>>n>>x; in...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2004-2011 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. ** It may not be distributed under any circumstances. */ #ifndef OPBUFFEREDLOWLEVELFILE_H #define OPBUFFEREDLOWLEVELFILE_H...
#include <iostream> #include <string> #include "Board.h" //#include "Player.h" using namespace std; int main(){ Player player1('X'); Player player2('O'); string pName; cout << "player 1 enter your name: "; cin >> pName; player1.setName(pName); cout << "player 2 enter your name: "; cin >> pName; player2.setNa...
// Copyright 2015 Stef Pletinck // License: view LICENSE file // SFML includes #include <SFML/Graphics.hpp> // Thor includes #include <Thor/Resources.hpp> // C++ includes #include <iostream> #include <string> // My includes #include "../headers/epengine.h" EpEngine::EpEngine() { } EpEngine::~EpEngine() { delete...
#include <bits/stdc++.h> using namespace std; class Solution { public: // T(n) = O(max{n, m}); // S(n) = O(m); vector<int> intersect(vector<int>& nums1, vector<int>& nums2) { unordered_map<int, int> memo; int n = nums1.size(); int m = nums2.size(); if (n == 0 || m == 0) retu...
#include <iostream> #include <cassert> // Provides assert function #include "sequence1.h" // With value_type defined as double using namespace std; namespace main_savitch_3 { // MOD MEMBER FUNCTIONS // constructor for sequence sequence::sequence() { used = 0; } //sets the index at 0 void sequence::start(...
#include <iostream> using namespace std; int square_area(int A) { return A*A; } int rectangle_area(int A, int B) { return A*B; } //exceptions for if one or more number is negative void exceptions(int A, int B){ if(A <= 0 || B <= 0){ //throws an error throw string(" The area can't be negati...
/* * Copyright [2017] <Bonn-Rhein-Sieg University> * * Author: Torsten Jandt * */ #pragma once #include <mir_planner_executor/actions/stage/base_stage_action.h> class MockupStageAction : public BaseStageAction { protected: virtual bool run(std::string& robot, std::string& platform, std::string...
// Copyright 2021 The XLS Authors // // 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 by applicable law or agreed t...
/* XMRig * Copyright 2010 Jeff Garzik <jgarzik@pobox.com> * Copyright 2012-2014 pooler <pooler@litecoinpool.org> * Copyright 2014 Lucas Jones <https://github.com/lucasjones> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2016 Jay D Dee <jayddee246@gmail.com> * C...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2011 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" #include "platforms/unix/base/x11/x11_c...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int n, m; cin >> n >> m; vector<int> x; for(int i = 0; i < m; i++) { int tmp; cin >> tmp; x.push_back(tmp); } if (n >= m){ cout << "0" << endl; return 0; ...
#include <SFML/Graphics.hpp> #include <iostream> #include <sstream> #include "Game.hpp" #include "Map.hpp" #define MAP_WIDTH 28 #define MAP_HEIGHT 20 #define SCREEN_WIDTH 600 #define SCREEN_HEIGHT 450 int main(int argc, char *argv[]) { sf::RenderWindow win(sf::VideoMode(SCREEN_WIDTH, SCREEN_HEIGHT), "Ray Caster"); ...
#include <sfwdraw.h> #include <stdio.h> #include <time.h> #include "Defines.h" #include "GameState.h" int main() { WINDOW(400, 400, "Ghost Puncher") INITIALIZE while (RUNNING) PLAY EXIT }
/** * @author Nicholas Kidd * @version $Id: AHval.cpp 465 2008-11-05 20:39:17Z kidd $ */ #define BDDBIGMEM 0 #if BDDBIGMEM // For large memory machines (i.e., >= 2GB) allocs ~1500 MB //#define BDDMEMSIZE 75000000 // 25000000 ~~ 500 MB, change the multiple to get what you need. #define FIVE_CENT_MB 25000000 #define...
/* https://www.acmicpc.net/problem/1316 */ #include <iostream> #include <cstring> using namespace std; int main(void) { int testCase; scanf("%d", &testCase); int cnt = 0; char** str = new char*[testCase]; for (int i = 0; i < testCase; i++) { str[i] = new char[100]{ 0, }; scanf("%s", str[i]); char tmp[...
#ifndef TREEFACE_GRAPHICS_UTILS_H #define TREEFACE_GRAPHICS_UTILS_H #include "treeface/base/Enums.h" #include "treeface/math/Vec2.h" namespace treeface { struct StrokeVertex { Vec2f position; Vec2f tangent_unorm; float trip; float side; }; struct StrokeStyle { LineCap cap; LineJoin join; ...
#include "fun.h" float toRadian(float degree) { return (3.14 / 180) * degree; } float dCos(float degree) { return cos(toRadian(degree)); } float dSin(float degree) { return sin(toRadian(degree)); } sf::Vector2f check(sf::Vertex wall[], sf::Vertex ray[]) { float x1 = wall[0].position.x; float x2 = wall[1].posit...
////////////////////////////////////////////////////////////////////////////// // // Copyright (c) Triad National Security, LLC. This file is part of the // Tusas code (LA-CC-17-001) and is subject to the revised BSD license terms // in the LICENSE file found in the top-level directory of this distribution. // ////...
//Copyright 2011-2016 Tyler Gilbert; All Rights Reserved #include <stdint.h> #include <cstdlib> #include <cstring> #include <cstdio> #include <mcu/types.h> #if !defined __link #include <reent.h> #endif #include "var/Data.hpp" using namespace var; const int Data::m_zero_value = 0; #define MIN_CHUNK_SIZE 56 size_t...
/******************************************************************************** ** Form generated from reading UI file 'loginscreen.ui' ** ** Created by: Qt User Interface Compiler version 5.13.2 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************...
#include <fstream> #include "sum_float_opt.h" int main() { ofstream in_pix("input_pixels_regression_result_sum_float_opt.txt"); ofstream fout("regression_result_sum_float_opt.txt"); HWStream<hw_uint<32> > f_update_0_read; HWStream<hw_uint<32> > u_update_0_read; HWStream<hw_uint<32> > sum_float_update_0_write...
// // Created by Cristian Marastoni on 23/04/15. // #ifndef NETWORK_DEBUG_H #define NETWORK_DEBUG_H class Debug { public: static void Log(const char *ctx, const char *fmt, ...); static void Error(const char *ctx, const char *fmt, ...); }; #endif //NETWORK_DEBUG_H
#include "SoftwareSerial.h" SoftwareSerial serial_connection(13, 12);//Create a serial connection with TX and RX on these pins #define BUFFER_SIZE 64//This will prevent buffer overruns. char inData[BUFFER_SIZE];//This is a character buffer where the data sent by the python script will go. char inChar=-1;//Initialie the...
#include "SIdict.h" #include <stdio.h> #include <iostream> int main(){ Dict* d = new Dict(); printf("%i\n", d -> addOrUpdate("a", 5)); printf("%i\n", d -> addOrUpdate("b", 7)); printf("%i\n", d -> addOrUpdate("c", 70)); printf("%i\n", d -> remKey("c")); printf("%i\n", d -> addOrUpdate("d", 7000))...
#include <iostream> int main() { // Задание 6 int threeDigitNum = 0; std::cout << "Enter three-digit number: " << std::endl; std::cin >> threeDigitNum; int doubleDigitNum = threeDigitNum % 10; int newThreeDigitNum = threeDigitNum / 10; std::cout << "New number is: " <<doubleDigitNum << newThr...