text
stringlengths
8
6.88M
#ifndef CVML_LINE_H #define CVML_LINE_H class CVMLLine { private: CVMLLabel *label_; CVMLData *data_; CVMLOp *op_; public: CVMLLine(CVMLLabel *label, CVMLData *data) : label_(label), data_(data), op_(NULL) { } CVMLLine(CVMLLabel *label, CVMLOp *op) : label_(label), data_(NULL), op_(op) { ...
#include "vr_system.h" #include "helpers.h" #include <gtc/type_ptr.hpp> #include <SDL.h> #include <iostream> #include "point_cloud.h" // Static member delcarations VRSystem* VRSystem::self_ = nullptr; // Constructor VRSystem::VRSystem() : vr_system_(nullptr), render_target_width_(0), render_target_height_(0), nea...
#include <iostream> using namespace std; string s; int res = 1; void nhap(){ cin >> s; } void solve(){ int i, j; for(i = 1; i < s.length()-1; i++){ j = 0; while(i - j >= 0 && i + j < s.length() && s[i-j] == s[i+j]) j++; if(i - j < 0 || i + j >= s.length() || s[i-j] != s[i+j]) j--...
/* ======================================================================== DEVise Data Visualization Software (c) Copyright 1992-1995 By the DEVise Development Group Madison, Wisconsin All Rights Reserved. ======================================================================== Under no circumstances ...
// 2017-11-25 thewinds // [题目] PAT A-1003 // 消防员经过最短的路径到达指定城市,问有多少条最短的路径 // 和(最短路径)最大召集的人数 // [考点] 图的遍历(dfs) // [心得] // 因为没有仔细审题,导致TimeOut.... // 题目中说 `Each input file contains one test case.` // 这时候最外层就不需要用while()来不断读取了. #include <cstdio> #include <cstring> #define MIN -1 #define MAX 1e9 struct Log { char id[20];...
#include <iostream> #include <cstdio> using namespace std; int main(){ int speed; cin >> speed; printf("%d minutos\n",2*speed); return 0; }
#pragma once #include<string> using namespace std; class Pralka { private: string nazwa; string typ; string cena; string ilosc; public: Pralka(string nazwa, string typ, string cena, string ilosc); string wezNazwe() const; string wezTyp() const; string wezCene() const; string wezIlosc() const; Pralka & no...
#include <SFML/Graphics.hpp> #include <iostream> #include "Enemy.h" #include "Bala.h" #include "Personaje.h" #define ventanax 640 #define ventanay 640 #define tamper 30.0 #define velperso 5 //g++ main.cpp -o test -lsfml-graphics -lsfml-window -lsfml-system Enemy.cpp Bala.cpp void Boton(sf::Keyboard X){ } int main() ...
#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; const int INF = 2e9 + 7; struct edge{ int to,dist; }; vector<edge> G[1010]; int dis[1010],ans[101...
#include<stdlib.h> #include<iostream> #include<stdio.h> #include<conio.h> using namespace std; int main() { vuongmin: char mang[100]; int phantu=0; int demsophay=0; int demsokitu=0; int money; cout<<"\n Nhap Tien:\t"; cin>>money; while(money!=0) { int digit=money%10; ...
void setup_SDcard() { Serial.print(F("Initializing SD card...")); // see if the card is present and can be initialized: if (!SD.begin(chipSelect)) { Serial.println(F("Card failed, or not present")); // don't do anything more: return; } Serial.println(F("card initialized.")); } void log_data() { ...
// // Created by Tanguy on 28/11/2017. // #include "MediatorPacket.hpp" std::ostream& operator<<(std::ostream& os, const MediatorPacket& mediatorPacket) { os << mediatorPacket.packet; return os; }
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2011 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** This file describe a class used to asynchronously export a cac...
#pragma once #include "abstractValue.h" namespace json { class NullValue : public AbstractValue { public: virtual ValueType type() const override { return null; } virtual bool equal(const IValue *other) const override; static const IValue *getNull(); }; class BoolValue : public AbstractValue { publi...
#ifndef VECTOR #define VECTOR #include "Matrix.h" class Vector : public Matrix { public: Vector(int); double& operator()(int); double operator() (int) const; int getLength() const; Vector(const Matrix&); }; #endif
#include <bits/stdc++.h> using namespace std; int main(){ ifstream fi("DEMSO.inp"); ofstream fo("DEMSO.out"); int a[10]; int n = 0; memset(a, 0, sizeof(a)); while(!fi.eof()){ int x; fi >> x; a[x]++; } for (int i = 0; i < 9; ++i) { if(a[i] == 1) n++; } fo << n; return 0; }
/************************************************************************* References - description ------------------- début : 10 nov. 2011 copyright : (C) 2011 par Robin Gicquel et Arnaud Mery de Montigny *************************************************************************/ //--...
#include <iostream> int preDecrease(int &i) { std::cout << "Enter a number:\t"; std::cin >> i; i -= 1; return i; } int postDecrease(int &i) { std::cout << "Enter a number:\t"; std::cin >> i; i -= 1; return i + 1; } int main() { int k; std::cout << "Call of PreDec:\t" << preDecrease(k) << std::e...
#include <iostream> #include <unistd.h> int main() { fork(); fork(); fork(); std::cout << "hi!\n"; return 0; }
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #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> #inc...
#include "wrapper.h" #include "facedetectcnn.h" #ifdef _WIN32 # define EXPORTED __declspec(dllexport) #else # define EXPORTED #endif #define DETECT_BUFFER_SIZE 0x20000 extern "C" { EXPORTED Wrapper* Ctor() { return new Wrapper(); } EXPORTED void Dtor(Wrapper* wrapper) { if (wrapper) ...
#include <iostream> #include <map> template <typename T> struct console_context { T & Item; }; template <typename T> console_context<T> as_console(T & item) { return {item}; } template <template <typename> typename T1, typename T2> std::ostream & operator << (std::ostream& out, T1<T2> item) { out << item.Item...
#include <cstring> #include <iostream> #include <cmath> using namespace std; class Solution { public: int titleToNumber(string s) { int result = 0; for(int index = 0; index < s.size(); index++){ result += s[index]-'A'+1; if(index == s.size()-1){ break; } result *=2...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 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/opdata/src/SegmentCollector.h...
#pragma once #include "GlutHeader.h" #include "Point3.h" class Cylinder { public: Point3 tilt; double theta; //tilt an theta is used to descripe the infomation of the cylinder's direction Point3 center; Point3 shape; //shape.axis[0] means the length, shape.axis[1] means the radius of the top, shape.axi...
// HumanModel.h: interface for the CHumanModel class. // ////////////////////////////////////////////////////////////////////// // changed //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// // by gaecha // ch...
#include <vector> #include <forward_list> template <typename Key, typename Value, typename Hash = std::hash<Key>> class HashTable { private: std::vector<std::forward_list<std::pair<Key, Value>>> vec; Hash hash_function {}; public: HashTable(const int size); void insert(const ...
#ifndef VECTOR_UTILS_H #define VECTOR_UTILS_H // Declaration of a name space in which several useful std::vector related functions are defined // R. Sheehan 7 - 12 - 2018 namespace vecut { std::vector<double> get_row(std::vector<std::vector<double>> &data, int r_num); std::vector<double> get_col(std::vector<std::ve...
// Spring 2018 // // Description: This file implements a function 'run_custom_tests' that should be able to use // the configuration information to drive tests that evaluate the correctness // and performance of the map_t object. #include <iostream> #include <ctime> #include <stdlib.h> #include <thread> #include "conf...
#include "game.h" #include "QLayout" Game::Game(QWidget* parent, int total_processes, int priority_low, int priority_high, QString username, int gamemode, int lv): QGraphicsView() { //set parameters for the game Q_UNUSED(parent) GAMEMODE = gamemode; LV = lv; user_name = username; if(G...
#pragma once #include "../../structs/Transform.h" #include "PhysicsTransform.h" #include "../CollisionShapes.h" #include "../../structs/MeshTransform.h" namespace Game { class PhysicsObject { public: // virtual void setTransform(PhysicsTransform& transform) = 0; virtual void setShape(CollisionShapes shape) = 0; ...
#include "articulocontroller.h" #include "articuloviewer.h" #include "articulodao.h" ArticuloController::ArticuloController() { //ctor } ArticuloController::~ArticuloController() { //dtor } void ArticuloController::abm() { ArticuloViewer* av = new ArticuloViewer(); bool salir = false; ...
#include "../src/graphic/window.h" #include "../src/graphic/renderer/batch2Drenderer.h" #include "../src/graphic/layers/group.h" #include "../src/graphic/layers/layer.h" #include "../src/graphic/renderable/sprite.h" #include "../src/gui/label.h" #include "../src/font/fontmanager.h" #include "../src/audio/soundmanager....
//: C03:Global.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 //{L} Global2 // Demonstracja zmiennych globalnych #include <iostream> using namespace std; int globe; void func(); int mai...
#ifndef PATHFINDRULE_JPS_PLUS_DYNAMIC_H #define PATHFINDRULE_JPS_PLUS_DYNAMIC_H namespace JPS { namespace Rule { // 길찾기 룰 (JPS+ 다이나믹 맵=변경 될수 있는 맵) // grid 의 정보가 변경될수 있을때 사용한다. // 기본적으로 4방향 직선 포인트만 전처리를 사용하고 대각선 방향을 전처리를 하지 않는다. // - 맵이 변경될 경우 너무 많은 대각선 방향의 포인트를 전처리 해야하므로 부하가 생긴다. // - 대각선 포인트 Jump 시에 직선 전처리를 사용해서 jum...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- * * Copyright (C) Opera Software ASA 2002 - 2006 * * Bytecode compiler for ECMAScript -- overview, common data and functions * * @author Jens Lindstrom */ #include "core/pch.h" #include "modules/ecmascript...
class Solution { public: vector<vector<int>> combinationSum(vector<int>& candidates, int target) { vector<vector<int> > ret; if(candidates.empty()) return ret; sort(candidates.begin(),candidates.end()); vector<int> temp; dfs(candidates,ret,target,temp,candidates.size()-1); ...
#pragma once #include<iostream> using namespace std; //extern int a; //void put(); template <typename T,int size,int e> class A { public: void print(); private: T x; }; template <typename T, int size, int e> void A< T, size , e >::print() { T a[size]; for (int i = 0; i < size; i++) { cin >> a[i]; } cout << "e:...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2010 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ /** * @file OpOCSPResponseVerifier_impl.cpp * * OpenSSL-based OCSP ...
//MilesEstimator.h class MilesEstimator { public: virtual int getMilesLeft() { return (getMilesPerGallon()*getGallonsLeft()); } virtual void setGallonsLeft(int inValue) {mGallonsLeft=inValue;} virtual int getGallonsLeft() {return mGallonsLeft;} private: int mGallonsLeft; ...
#include <iostream> #include <algorithm> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <memory.h> #include <math.h> #include <string> #include <string.h> #include <queue> #include <vector> #include <set> #include <map> typedef long long LL; typedef unsigned long long ULL; #define PI 3.141592653589...
// // Created by JACK on 11/9/2015. // #include "Institution.h" Institution::Institution(const string& size): size(size) { } Institution& Institution::operator=(const Institution& obj) { if(this == &obj) { return *this; } size = obj.size; return *this; } Institution::~Institution() { size = ""; }
#include<iostream> #include<string> #include"person.h" using namespace std; #ifndef CHILD_H #define CHILD_H class Employee; class Child : public Person { private: string favoriteToy; Employee *emp; public: Child(); Child(string pname, string pssnum, int page, string favToy); ~Child(); string getFavor...
//Copyright 2021 by Winter Solider #include "Student.hpp" #include <iomanip> #include <utility> auto get_name(const json& j) -> std::string; auto get_debt(const json& j) -> std::any; auto get_avg(const json& j) -> std::any; auto get_group(const json& j) -> std::any; Student::Student(std::string _name, std::any _grou...
// Copyright 2017 Google Inc. All rights reserved. // // 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, modify, ...
#include <iostream> #include <string> class bad_range {}; class some_other { public: explicit some_other(int x) {} }; class tiny { private: char v; void assign(int i) { if (i & ~077) throw bad_range(); v=i; } public: tiny(int i) { assign(i); } tiny& operator=(int i) { assign(i); return *this; } ...
#include <iostream> #include <set> #include <map> void test_set() { std::set<int> values; for(unsigned int i=0; i<10; i++) values.insert(i*10); auto [it, was_inserted] = values.insert(20); if (was_inserted) std::cout << "element 20 has been inserted\n"; else { std::cout << ...
// Copyright Sascha Ochsenknecht 2009. // 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) #include <pika/program_options/config.hpp> #include <pika/program_options/parsers.hpp> ...
#include <cstdio> #include <cstdlib> #include <cstring> #define NUM_MAX_LEN 20 using namespace std; bool check_init_input(int args, char ** argv){ if(args != 2){ printf("Wrong number of arguments!\n"); return false; } return true; } FILE * read_file(FILE * fp, char * file_...
#pragma once #include "imgui/imgui.h" #include "rttr/type.h" struct GLFWwindow; namespace studio { class ImGuiView { public: ImGuiView(GLFWwindow *window); virtual ~ImGuiView() = default; virtual void onInit() {} virtual void onRender() {} GLFWwindow *getWindow() const { return m_window; } private: void be...
#ifndef SHADERLOADER_H #define SHADERLOADER_H #include <string> #include <GL/glew.h> GLuint loadShader(const std::string &vertexShader, const std::string &fragmentShader); #endif // SHADERLOADER_H
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * 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. * psmaas - Patricia Aas */ #ifndef LEX_SPLAY_KEY_H #define LEX_SPLA...
#pragma once #include <string> class DResource { protected: std::string m_name; public: DResource(std::string name); virtual ~DResource(); virtual void Load(std::string file); virtual void Release(); virtual void Draw() {} }; #define SAFE_DELETE(p) { if(p) delete (p); (p) = NULL; }
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2009 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef BTStartDownloadDialog_H #define BTStartDownloadDialog_H ...
#ifndef _SYLVESTER_MATRIX_ #define _SYLVESTER_MATRIX_ #include "BivariatePolynomial.h" #include "Polynomial.h" #include "Matrix.h" #include "ChangeOfVariableCoefficients.h" class SylvesterMatrix { unsigned int RowDimension, ColDimension; unsigned int d0,d1; int hiddenDeg; Polynomial *** matrix; ch...
#include<bits/stdc++.h> using namespace std; class Solution { public: vector<int> sortArrayByParity(vector<int>& nums) { int even =0; for(int i=0; i<nums.size(); i++){ if(nums[i]%2==0){ swap(nums[i], nums[even]); even++; } } re...
#include "function.h" int makeProcess(Process_data *pArr) { int fds[2]; for (int i = 0; i < PROCESSNUM; i++) { int ret = socketpair(AF_LOCAL, SOCK_STREAM, 0, fds); ERROR_CHECK(ret, -1, "socketpair"); pid_t pid = fork(); if (pid == 0) { close(fds[0]); ...
#ifndef BOARD_H #define BOARD_H #include "board.h" #include "board_normal.h" #include "board_torus.h" #include "board_mirror.h" #endif #include<iostream> using namespace std; namespace hw2{ class game{ public: void initializeGame(); void handleUpdateBoard(); void handlePrintB...
#include<bits/stdc++.h> using namespace std; main() { char s[500]; while(cin>>s) { int i, count=0; for(i=0; s[i]!='\0'; i++) { if(s[i]=='4'||s[i]=='7') count++; } if(count==4 ||count==7) cout<<"YES"<<endl; else ...
#pragma once #include <memory> #include <utility> #include <glad\glad.h> #include "GLFW\glfw3.h" #include "glm\glm.hpp" #include "glm\gtc\matrix_transform.hpp" #include "Test.h" #include "VertexArray.h" #include "VertexBuffer.h" #include "Shader.h" #include "Texture.h" #include "CubeMap.h" #include "Camera.h" #inc...
/*********************************************************\ * Copyright (c) 2012-2018 The Unrimp Team * * 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 wit...
#ifndef SHOEMANAGERDATACENTER_HPP #define SHOEMANAGERDATACENTER_HPP #include "shoemanagermodel_global.h" //! 数据中心 class SHOEMANAGERMODELSHARED_EXPORT ShoeManagerDataCenter { public: ShoeManagerDataCenter(); }; #endif // SHOEMANAGERDATACENTER_HPP
// $Id$ // // Copyright (C) 2003-2008 Greg Landrum and Rational Discovery LLC // @@ All Rights Reserved @@ // This file is part of the RDKit. // The contents are covered by the terms of the BSD license // which is included in the file license.txt, found at the root // of the RDKit source tree. // #define NO_IMP...
#include "Stub.h" #include <Arduino.h> using namespace Codingfield::Brew::Sensors::Temperature; Stub::Stub() { } Stub::~Stub() { } float Stub::Value() const { return value; } void Stub::Update() { //value = 20.0f + (random(-200,200) / 100.0f); } void Stub::SetValue(float v) { value = v; } int32_t Stub::E...
/* * GroupSession.h * * Created on: Jun 11, 2017 * Author: root */ #ifndef NETWORK_GROUPSESSION_H_ #define NETWORK_GROUPSESSION_H_ #include "Context.h" #include <vector> #include <map> #include "../define.h" #include "../Common.h" #include "../Memory/MemAllocator.h" using namespace std; namespace CommBas...
#include <iostream> using namespace std; char matrix[3][3] = {'1', '2', '3', '4', '5', '6', '7', '8', '9'}; char symbol; bool playerDidWin = false; char symbols[2]; char winner; //function to draw the grid for tic-tac-toe void drawMatrix(); //function that prompts a user for their turn to enter a number on the grid v...
/* #pragma once #include "Engine.h" namespace engine{ Scene loadSceneFile(const char* file); } */
#include <iostream> #include <string> #include <cassert> #include <vector> #include "Side.h" #include "Board.h" #include "Player.h" #include "Game.h" using namespace std; //int main() //{ // HumanPlayer hp("Marge"); // BadPlayer bp("Homer"); // Board b(3, 2); // Game g(b, &hp, &bp); // g.play(); // ...
/*The structure of the class is class SortedStack{ public: stack<int> s; void sort(); }; */ // Sort a stack /* The below method sorts the stack s you are required to complete the below method */ void SortedStack :: sort() { //Your code here stack<int> stk; while(!s.empty()) { int x = s.top(); ...
//Static方法 class SuperStatic { public: static void beStatic() {cout<<"SuperStatic being static,yo! "<<endl;} } ; class SubStatic { public: static void beStatic() {cout<<"SubStatic keepin' it static! "<<endl;} }; //Call the Static SuperStatic.beStatic(); SubStatic...
#include <iostream> #include <algorithm> using namespace std; int n, minima, opti; string s; char combi[6][3] = {{'R', 'G', 'B'}, {'R', 'B', 'G'}, {'B', 'R', 'G'}, {'B', 'G', 'R'}, {'G', 'R', 'B'}, {'G', 'B', 'R'}}; void findMinima(int idx) { int cost = 0; for (int i = 0; i < n; i += 3) { if (s[i]...
/** * Copyright (c) 2007-2017, Timothy Stack * * 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 ...
// BEGIN CUT HERE // PROBLEM STATEMENT // The game of Errant Knights is played on an infinite // chessboard using two knights, white and black. The players // alternate turns and the white player starts the game. Each // player makes a normal chess knight's move with his knight, // but there is a restriction that e...
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- // // 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. // #ifndef SEARCHMANAGER_H #define SEARC...
#include <iostream> #include <algorithm> #include <cstdio> #include <cstdlib> #include <time.h> #include <memory.h> #include <cmath> #include <string> #include <string.h> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include <functional> #include <numeric> #include <sstream> typede...
#include <iostream> #include <fstream> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <math.h> using namespace std; /* ham doPrint dung de in nhieu ki tu lien tiep param : kitu -> kitu can in soluong -> so luong ki tu muon in */ void doPrint(char kitu,int soluong){ for (int i=0;i<soluong;i...
/* * EmailRepositoryImpl.cc * * Created on: Nov 11, 2017 * Author: cis505 */ #include "ServerToServerImpl.h" using namespace std; Status ServerToServerImpl::AskForLog(ServerContext* context, const LogRequest* request, ServerWriter<WriteCommandRequest>* writer) { int seqNum = request->sequencenum(); st...
#include <stdio.h> #define _CCRT_SECURE_NO_WARNINGS #include <iostream> using namespace std; int main() { int no, count; scanf_s("%d", &no, sizeof(no)); scanf_s("%d", &count, sizeof(count)); printf("%d\n", no + count); cin >> no; cin >> count; cout << no + count; return 0; }
#pragma GCC optimize("Ofast") #include <algorithm> #include <bitset> #include <deque> #include <iostream> #include <iterator> #include <string> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #include <unordered_map> #include <unordered_set> using namespace std; void abhisheknaiidu()...
#include"Barrier_method.h" Barrier_method::Barrier_method(string Filename) { X0.resize(2); input(Filename); } Barrier_method::Barrier_method(vector_2d X, double R, double c, double e) { X0 = X; r = R; C = c; eps = e; } void Barrier_method::input(string Filename) { ifstream input(Filename); input >> X0[0] >...
// Created on: 1997-01-24 // Created by: Robert COUBLANC // 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 <iostream> #include "Perro.h" #include "Gato.h" int main() { Animal* pet[3]; Gato g1("Silvestre",1947); Perro p("Fido",2000); Gato g2("Tom",1940); pet[0]=&g1; pet[1]=&p; pet[2]=&g2; for (int i=0;i<3;i++){ pet[i]->muestra(); pet[i]->habla(); cout<<endl; ...
/* Question: Given a 2-Dimensional character array and a string, we need to find the given string in 2-dimensional character array such that individual characters can be present left to right, right to left, top to down or down to top. */ #include <iostream> #include <vector> #include <array> #include <string> #inc...
#pragma once #include "ast.hpp" #include "lexer.hpp" #include <vector> class ASTBuilder { public: ASTBuilder(std::vector<Token> t) { tokens = t;} block parseFile(); private: statp parseStatement(); statp parseStatementAux(std::string id); statp parseIf(); statp parseWhile(); statp parseF...
#include <map> #include <vector> #include <string> #include <cstdio> #include <cstdlib> #include <fstream> #include <iostream> #include <opencv2/core.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/imgcodecs.hpp> #include "crossplatform.h" #define LONG_SIDE_WIDTH 0 #define LONG_SIDE_HIGH 1 using namespace std; u...
#pragma once #include "../../gl_command.h" namespace glmock { // // http://www.opengl.org/sdk/docs/man3/xhtml/glUseProgram.xml class GLUseProgram : public GLCommand { public: GLUseProgram(GLuint program); virtual ~GLUseProgram(); public: void Eval(GLuint program); private: GLenum mProgram; }; }
// Created on : Sat May 02 12:41:15 2020 // Created by: Irina KRYLOVA // Generator: Express (EXPRESS -> CASCADE/XSTEP Translator) V3.0 // Copyright (c) Open CASCADE 2020 // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it un...
#include <iostream> using namespace std; int main() { int a,b,n; float s; cin>>a>>b; s=a+0.1*b; n=(s/1.9)/1; cout<<n; return 0; }
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCursesColor.h" #include "cmCursesStandardIncludes.h" bool cmCursesColor::HasColors() { #ifdef HAVE_CURSES_USE_DEFAULT_COLORS return has_colors(); #else re...
bool isSafe(vector<vector<int> > &A, int i, int j, int n, int m) { if(i>=0 &&i<n && j>=0 && j<m && A[i][j]==1) return true; return false; } int find(vector<vector<int> > &A, int x, int y, int n, int m) { queue<pair<int, int> > q; q.push({x,y}); int X[]={0,0,1,-1,1,1,-1,-1}; int Y[]={1,-1,0,0,-1,1,1,-1}; int c=...
#include "notebook.h" Notebook::Notebook(const std::weak_ptr<Settings> settings) { this->settings = settings.lock(); try { loadNotes(); } catch(...) { throw; } } Notebook::~Notebook() { deleteAll(); } void Notebook::addNote(Note * const note) { notes.append(note); ...
// Copyright Low Entry. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "CoreUObject.h" #include "ELowEntryFileManagerYesNo.h" #include "LowEntryFileManagerDirectory.generated.h" class ULowEntryFileManagerDirectory; class ULowEntryFileManagerFile; UCLASS(BlueprintType) class LOWENTRYFILEMAN...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <folly/MoveWrapper.h> #include <folly/container/F14Map.h> #include <folly/futures/Future.h> #include <folly/io/async/tes...
#include<bits/stdc++.h> #define rep(i,n) for (int i =0; i <(n); i++) using namespace std; using ll = long long; int main(){ string S; cin >> S; int ans = 0; bool flag = false; int now = 0; for(int i = 0; i < (int)S.size(); i++){ if(S.at(i) == 'A' || S.at(i) == 'C' || S...
#include "game.h" #include "event.h" #include <stdio.h> Game::Game( int argc, char* args[] ) { fprintf( stderr, "Game::Game()\n" ); m_window = NULL; m_screenSurface = NULL; initialize(); loadAssets(); } Game::~Game() { fprintf( stderr, "Game::~Game()\n" ); shutdown(); } void Game::Loop() { do { handling...
#pragma once #include "component.h" class AudioComponent : public Component { public: struct AudioClip { AudioClip(Name& audio_name, Name& file_name) : audio_name_(audio_name), file_name_(file_name) {} Name audio_name_; Name file_name_; }; public: void Destroy() override; bool Load(const rapidjson...
#include "scene.h" #include <QGraphicsSceneMouseEvent> #include <QMouseEvent> #include <QKeyEvent> Scene::Scene() { } void Scene::setPlayer(Player *player) { this->player = player; addItem(player); } void Scene::keyPressEvent(QKeyEvent *event) { int key = event->key(); if (key == Qt::Key_S) { ...
#include <iostream> #include <random> #include <sstream> #include <cmath> //Where field_size is size of a square side #define easy_field_size 10 #define easy_bomb_amount 10 #define normal_field_size 15 #define normal_bomb_amount 50 #define hard_field_size 20 #define hard_bomb_amount 20 int GetInt() { int user...
#pragma once #include "CHSGameRandom.hpp" #include "CHSMazeMap.hpp" class CHSMazeGenerator { private: CHSGameRandom cRandom; int WallNumber; //壁を示す値 int AisleNumber; //通路を示す値 bool InnerGenerate ( CHSMazeMap *pMap , unsigned int x , unsigned int y ); public: CHSMazeGenerator (); ~CHSMazeGenerator (); void Set...
/******************************** Name: Saiteja Yagni Class: CSCI 689/1 TA Name: Anthony Schroeder Assignment: 11 Due Date: 04/28/2016 *********************************/ /*Header file which contains include file using statements and function prototypes*/ #ifndef N_QUEENS #define N_QUEENS #incl...