text
stringlengths
8
6.88M
#pragma once #include <SFML/Graphics.hpp> #include "Window.h" #include "Player.h" class Background { static float dynamicBackgroundSpeed; // Prędkość poruszania się tła góra-dół static sf::Texture image; static sf::Sprite background; static sf::Texture image2; static sf::Sprite background2; public: static void...
#include <stdio.h> #include <cmath> double fib(int x) { double mult = 1/sqrt(5); double termo = pow((1+sqrt(5))/2,x) - pow((1-sqrt(5))/2,x); return mult*termo; } int main() { int qnt, x; scanf("%d",&qnt); for(int i=0; i<qnt; i++) { scanf("%d", &x); printf("Fib(%d) = %.lf\n", x, fib(x)); } return 0; ...
// // trwajacy.cpp // serialowabaza // // Created by Julia on 06.11.2018. // Copyright © 2018 Julia. All rights reserved. // #include <stdio.h> #include "trwajacy.h" #include <fstream> void trwajacy::setemission(int n, int T[]){ IloscOdcinkowTygodniowo=n; typ='T'; DniEmisji=new int[IloscOdcinkowTygodn...
#pragma once // GcTemplateListCtrl class GcTemplateListCtrl : public CListCtrl { DECLARE_DYNAMIC(GcTemplateListCtrl) protected: int mSelectedItem; CString mSelectedItemText; public: GcTemplateListCtrl(); virtual ~GcTemplateListCtrl(); inline CString& GetSelectedItemText() { return mSelectedItemText; } in...
#pragma once #include <cmath> #include <fstream> #include <iostream> #include <string> #include <vector> #include <GL/glew.h> #include <assimp/cimport.h> #include <assimp/postprocess.h> #include <assimp/scene.h> #include <FreeImage.h> struct Texture { BYTE *bits; FIBITMAP *image_ptr; int width; int height; }; class...
#include <iostream> #include <vector> #include <sstream> #include <fstream> #include <map> using namespace std; // ************************* CITY ************************ const int city_size = 36; string city_list[] = {"Atlanta", "Boston", "Calgary", "Charleston", "Chicago", "Dallas", "Denver", "Duluth", "El_Paso", "...
#include "KeyboardBehaviour.h" KeyboardBehaviour::KeyboardBehaviour() { } KeyboardBehaviour::~KeyboardBehaviour() { } vector2 KeyboardBehaviour::Update(Agent* agent, float deltaTime) { aie::Input* input = aie::Input::getInstance(); vector2 force(0, 0); //set up force var float movespeed = 20; //apply move...
/* * Project BlacBoxHomeDev * Description: * Author: * Date: */ /* * PIR sensor tester */ //Uncommnent the following line to work in offline mode //SYSTEM_MODE(MANUAL); int led = D7; // we will use D7 LED to monitor sensor activity int pir = D0; //connect the PIR output to pin D0 of the Electron ...
#include <cassert> //#include <GL/gl.h> #include <glm/mat4x4.hpp> #include "pbconfig.h" #include "core/pbutil.h" #include "shadercompiler.h" #include "instancedgeometry.h" #include "instancedobject.h" namespace pb { InstancedObject::InstancedObject(const InstancedObject& rhs) : InstancedObject() { //obj = rhs...
// ScheduleDlg.cpp : 实现文件 // #include "stdafx.h" #include "Schedule.h" #include "ScheduleDlg.h" #include "afxdialogex.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // 用于应用程序“关于”菜单项的 CAboutDlg 对话框 class CAboutDlg : public CDialogEx { public: CAboutDlg(); // 对话框数据 enum { IDD = IDD_ABOUTBOX }; protected: virtu...
// // Created by 송지원 on 2020/07/04. // #include <iostream> #include <vector> using namespace std; int main() { vector<pair<int,int>> V; int temp; int max = -1; int maxIndex; for (int i=0; i<9; i++) { cin >> temp; if (temp > max) { max = temp; maxIndex = i; ...
/* -*- 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. */ #ifndef DOM_EXTENSIONS_MENUTEM_PROXY_H #define DOM_EXTENSIONS_MENU...
#include <bits/stdc++.h> using namespace std; int main(){ int N , K; cin >> N >> K; int d; int x; //x(x <N)番目の人がお菓子をもらう set<int> S; //お菓子を持っている人の番号を入れるset for(int i = 1; i<= K; i++){ //K種類のお菓子の cin >> d; for(int j = 1; j <= d; j++){ //i種目のお菓子を持っている人 cin >> x; S....
#ifndef VIRTUALSCREEN_H #define VIRTUALSCREEN_H #include <SFML/Graphics.hpp> class VirtualScreen : public sf::RenderTexture { public: VirtualScreen(unsigned int width, unsigned int height); void worldDraw(sf::Sprite& sprite, const sf::Vector2f& position); void pixelDraw(sf::Sprite& sprite,...
//dp[i] is set to true if a valid word (word sequence) ends at i-1. class Solution { public: bool wordBreak(string s, vector<string>& wordDict) { if(wordDict.size() == 0) return false; unordered_set<string> dict; int maxLen = 0; for(string s: wordDict){ dict.insert(s); ...
unsigned int adc; void setup(){ Serial.begin(115200); Serial.setDebugOutput(true); Serial.printf("Iniciando...\n"); pinMode(2, OUTPUT); digitalWrite(2, LOW); delay(100); } void setup(){ adc=0; pinMode(2,INPUT); while(digitalRead(2) == LOW) adc++; Serial.printf("%i\n", adc); pi...
#include "csvreader.h" #include "ui_csvreader.h" CsvReader::CsvReader(QWidget *parent) : QMainWindow(parent), ui(new Ui::CsvReader) { ui->setupUi(this); ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); } CsvReader::~CsvReader() { delete ui; } void CsvReader::on_acti...
#include "freego.h" namespace logging = boost::log; namespace src = boost::log::sources; namespace sinks = boost::log::sinks; namespace keywords = boost::log::keywords; FreeGo* FreeGo::instance_ = 0; FreeGo* FreeGo::instance() { if(!instance_) { instance_ = new FreeGo; instance_->init(); } re...
#include <iostream> #include <cmath> #include "head.h" using namespace std; int main() { cout << "x = " << x << endl; calculate(); cout << round(result * 10000) / 10000 << endl; cout << "Vvod x:"; cin >> x; calculate(); cout << round(result * 10000) / 10000 << endl; system("PAUSE"); ...
#ifndef _VECTOR3_HPP_ #define _VECTOR3_HPP_ #pragma once #include <cmath> #include <string> class Vector3 { public: float x; float y; float z; Vector3(float x = 0, float y = 0, float z = 0); void normalize(); std::string ToString(); static float DotProduct(const Vector3 &a, const Vecto...
/* -*- 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. */ #ifndef GEOLOCATION_NEW_NETWORK_API_RESPONSE_PARSER_H #define GEOLOCA...
/********************************************************************************** General Eyelid Header file Has overall class definition and private and public functions Edited by Ethan Lauer on 10/9/19 *********************************************************************************/ #include...
#pragma once #include <cmath> namespace functions { double k_1_test(double x) { return 1 / 2.25; } double k_2_test(double x) { return 4; } double q_1_test(double x) { return 1; } double q_2_test(double x) { return 1; } double f_1_test(double x) { return 0; } double f_2_test(double x) {...
#include <iostream> #include <opencv2/opencv.hpp> using namespace cv; using namespace std; int main(int, char**){ Mat image; Vec3b val; Size tamanho; int p1[2], p2[2]; //Ponto 1 e ponto 2, respectivamente int altura, largura; image = imread("biel.png", CV_LOAD_IMAGE_GRAYSCALE); if(!im...
//with C's I/O and C++'s string class #include<cstdio> #include<cstring> #include<iostream> #include<string> using namespace std; class save{ public: string identity; int test_number; int seat_number; }; int main(){ //input save give_data[1005]; int quantity; scanf("%d\n",&quantity); c...
class Solution { public: int singleNumber(vector<int>& nums) { int len = nums.size(); if(len<1) return 0; sort(nums.begin(),nums.end()); int num = nums[0]; for(int i=1;i<len;i+=2){ if(num==nums[i]){ num = nums[i+1]; ...
/* XMRig * Copyright 2008-2018 Advanced Micro Devices, Inc. * Copyright 2018-2020 SChernykh <https://github.com/SChernykh> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com> * * This program is free software: you can redistribute it and/or modify...
/*Дано трехзначное число. Проверить истинность высказывания: «Все цифры данного числа различны». */ #include <iostream> using namespace std; int main() { cout << "Write down number" << endl; int a; cin >> a ; int x = a / 100, y = (a / 10) % 10 , z = a % 10; if ((x != y) && (y != z) && (z != x)){ /...
/** * @section LICENSE * * Copyright (c) 2013 @tosihisa, MIT License * * 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 u...
#include <string> #include <cmath> #include <fstream> #include <iostream> #include <sstream> #include <list> #include <algorithm> #include <set> #include <map> #include <stack> #include <queue> #include <numeric> #include <bitset> #include <deque> //#include <random> #include <string.h> #include <stdlib.h> #include <ve...
#ifndef _GREEN2_H #define _GREEN2_H #include "Enemy.h" #include "Path.h" class GREEN2 : public Enemy { private: iPoint original_pos; Path path; Animation fly; Animation forward; Animation backward; public: GREEN2(int x, int y, int type); void Move(); }; #endif
/*********************************************************************** cpp£º Lights Desc£ºdef of light interfaces and light description structure ************************************************************************/ #include "Noise3D.h" using namespace Noise3D; //--------------...
#include<iostream> #include<string> #include<algorithm> using namespace std; int main() { int i, c = 0; string s; cin >> s; sort(s.begin(), s.end()); for (i = 0; i < s.length(); i++) { if (s[i] != s[i + 1]) { c++; } } if (c % 2 == 0) { cout << "CHAT WITH HER!"; } else { ...
#ifndef MAPBOARD_H #define MAPBOARD_H #include <string> //#include "serverdaemon.cpp" struct mapboard { int rows;//8 int cols;//8 pid_t daemonID; //processid of daemon pid_t players[5]; unsigned char map[0]; //0 }; //sem_t *sem; // semaphore void create_server_daemon(); void create_client_daemon(std::stri...
#include "Pixel.h" #include <iostream> using namespace std; // Constructeur par défaut de la classe: initialise le pixel à la couleur noire Pixel::Pixel() { r = 0; g = 0; b = 0; } // Constructeur de la classe: initialise r,g,b avec les paramètres Pixel::Pixel (const unsigned char nr,const unsigned char n...
#include "../../Point2D.h" #include <iostream> #include <cmath> #include <cassert> #define test_point(pt, X, Y) assert(fabs(pt.x() - X) < 0.0001 && fabs(pt.y() - Y) < 0.0001); int main(void) { Point2D pt; test_point(pt, 0.f, 0.f); std::cout << 1 << std::endl; pt.x(1.f); pt.y(2.f); test_point...
#include <Arduino.h> #include "HBridgeMotor.h" class HBridge_Controller { private: HBridge_Motor motor0; HBridge_Motor motor1; public: HBridge_Controller(); HBridge_Controller(HBridge_Motor m0, HBridge_Motor m1); void setEnable(uint8_t enA, uint8_t enB); void stop(); void forwards(); v...
#include "processflow_app.h" #include <QDir> #include <QMessageBox> #include <algorithm> #include "qt-tools/common.hpp" #include "json.hpp" APP_REGISTER (processflow_app) using namespace std; using json = nlohmann::json; processflow_app::processflow_app(int argc, char ** argv) : application(argc, argv) { if...
// #include <boost/multiprecision/cpp_int.hpp> // using boost::multiprecision::cpp_int; #include <bits/stdc++.h> using namespace std; #define f first #define s second #define mp make_pair #define pb push_back #define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); ...
#include "getthresholdvalue.h" #include "opencv2/opencv.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <QDialog> #include <QDebug> #include <QMessageBox> #include"dialrecognition.h" using namespace cv; int threshold_value = 0; int threshold_type = 1; int const max...
#include <sstream> #include "speech.hh" SpeechTab *SpeechTab::SpeechTab_ = 0; string SpeechTab::speechText = "Not Initialized"; GtkWidget *SpeechTab::speech_edit = 0; GtkWidget *SpeechTab::button_speech = 0; string SpeechTab::speech_lang_ = "fr"; //send speech record to iSpeak_all void send_speech (history_record ...
#include <iostream> using namespace std; int main() { int N, S; cin >> N >> S; --S; int a[N], b[N]; for (int i = 0; i < N; ++i) cin >> a[i]; for (int i = 0; i < N; ++i) cin >> b[i]; if (a[0] && a[S]) { cout << "YES" << endl; return 0; } for (int k = S + 1; k < N;...
#include <iostream> #include <map> #include <unordered_map> #include <queue> #include <vector> #include <string> #include <utility> using namespace std; unordered_map<string, int> nameMap; // map<string, int> nameMap; struct BagDependency { int bagIdx, bagCount; //BagDependency(); }; struct Node { vecto...
/* Question => GIven two 2D arrays of size n1 x n2 and n2 x n3. Your task is to multiply these matrics and output the multiplied matrix. Approach 1. Make a nested loop of order 3. In the outer loop iterate over rows of first matrix and in the inner loop iterate over columns of second matrix. 2. Multiply rows of first...
#pragma once #include <iostream> #include <random> #include <string> #include <ctime> #include <algorithm> #include "UnionFind.h" #include "Maze.h" using namespace std; int main() { int width; int height; srand(time(nullptr)); cout << "width"; cin >> width; cout << "height"; cin >> height; unique_ptr<Maze> ...
#pragma once template <typename C, typename S> long BinarySearch(C &container, S searchVal, long containerSize) { long min = 0; long max = containerSize - 1; long retVal = -1; while (true) { long target = (max + min) / 2; if (min > max) { break; } else if (container[target] == searchVal) { retV...
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int maxn = 100000+100, maxm = 1000000+100, maxq = 100000+100; int n, m, q; struct edge{ int s, t, c, num; bool useless ; edge(){} edge(int _s, int _t, int _c) : s(_s), t(_t) , c(_c), useless(false) {} } E[maxm]; int t...
#ifndef __VIVADO_SYNTH__ #include <fstream> using namespace std; // Debug utility ofstream* global_debug_handle; #endif //__VIVADO_SYNTH__ #include "mp_16_opt_compute_units.h" #include "hw_classes.h" struct in_in_update_0_write0_merged_banks_2_cache { // RAM Box: {[0, 112], [0, 127], [0, 31]} // Capacity: 9 ...
#include <iostream> #include <cstdlib> #include <cstdio> #include "TFile.h" #include "TCanvas.h" #include "TH2F.h" int main(int argc, char **argv) { if (argc<=1) { printf("*** wrong # cli args ***\n"); exit(1); } std::string filename{argv[1]}; TFile f{filename.c_str()}; auto *e_cpu...
#include "UIFactory.h" #include "Button.h" #include "VisionCone.h" using namespace uth; using namespace pmath; GameObject* UIFactory::CreateButton(const Rect& area, const std::string& texture, ButtonType type, const ButtonCallback& callback) { auto go = new GameObject(); go->AddTags({ "UI", "Text" }); go->AddComp...
/* * 题目:1006. 笨阶乘 * 链接:https://leetcode-cn.com/problems/clumsy-factorial/ * 知识点:栈、数学 */ class Solution { public: int clumsy(int N) { vector<int> nums(1, N); int i = 0; while (--N) { switch(i%4) { // 符号* case 0: nums.back() *...
#pragma once #include "../../SDK/SDK.h" namespace Hooks { namespace FrameStageNotify { inline CHook Hook; using fn = void(__fastcall *)(void *, void *, ClientFrameStage_t); void __fastcall Func(void *ecx, void *edx, ClientFrameStage_t curStage); void Init(); } }
#include <iostream> #include <OpenNI.h> #include <opencv2/highgui.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/objdetect.hpp> #include "FaceOffConfig.h" const int SAMPLE_READ_WAIT_TIMEOUT = 2000; // ms const float FACE_SIZE_RATIO = 0.25f; const float EYE_SIZE_RATIO = 0.25f; const float EYE_REGION_HEIGHT_P...
#include"stdio.h" #include"conio.h" void main(void){ clrscr(); int i,b; int array[5]; int len=5; for(i=0; i<len; i++){ printf("Enter Values: "); scanf("%d",&array[i]); } for(i=0; i<len; i++) printf("%d,",array[i]); printf("\n\n\nEnter delete element: "); scanf("%d",&b); for(i...
#ifndef __POLYGON_H__ #define __POLYGON_H__ // Library Includes #include <windows.h> #include <windowsx.h> #include "shape.h" class CPolygon : public IShape { public: CPolygon(); CPolygon(EBRUSHSTYLE _iBrushStyle, int _iHatchStyle, COLORREF _FillColor, int _iPenStyle, int _iPenWidth, COLORREF _iPenColor); virtual...
#pragma once #include "Ball.h" using namespace std; class Bludger : public Ball { public: int id; Bludger(int i); ~Bludger(); void Run(); void Collide(vector<pair<Point3, Point2>>); }; #define BLUDGER_ID 6 #define BLUDGER_INTERVAL_RADIUS 60 #define BLUDGER_INIT_DISTANCE 0.4 #define BLUDGER...
#include <iostream> #include <vector> #include <cmath> const int MAX_D = 16; std::vector<std::vector<int>> link(50001); int level[50001], parent[50001][MAX_D]; void dfs(int idx, int lev) { for(auto next : link[idx]) { if(level[next] == 0) { level[next] = lev + 1; parent[n...
/* -*- 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. ** */ #ifndef _JUSTLOAD_TESTMAN_H_ #define _JUSTLOAD_TESTMAN_H_ #if...
#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 a,i; int main() { int num[10]; printf("Insira 10 numeros:\n"); for( a=0; a<10; a++) { scanf("%i", &num[a]); } pr...
/****************************************************************************** * * * Copyright 2020 Jan Henrik Weinstock * * * ...
/** @file * IPRT - C++ Resource Management. */ /* * Copyright (C) 2008-2011 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of the GNU ...
#include "msg_0x09_respawn_stc.h" namespace MC { namespace Protocol { namespace Msg { Respawn::Respawn() { _pf_packetId = static_cast<int8_t>(0x09); _pf_initialized = false; } Respawn::Respawn(int32_t _dimension, int8_t _difficulty, int8_t _gameMode, int16_t _worldHeight, const String16& _levelType) : _pf_dimensi...
#include <bits/stdc++.h> #define ll long long #define pf printf #define sfi(a) scanf("%d",&a); #define sfii(a,b) scanf("%d %d",&a,&b); #define INF 100000 //10e9 using namespace std; int ar[50005]; struct node { int rtlmax,ltrmax,ovmax,sum; node() { rtlmax = -INF; ltrmax = -INF; ovm...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2009 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ /** * @file OpenSSLSocket.h * * SSL-capable socket. * * @author A...
int resist=A1; float port, Vm, Rm; void setup() { // put your setup code here, to run once: Serial.begin (9600); } void loop() { // put your main code here, to run repeatedly: port=analogRead(resist); Vm=(port*5/1023); Rm=(10*(5-Vm)/Vm); Serial.println(Rm); }
#ifndef __MACHINE__ #define __MACHINE__ #include "Controller.h" #include "OnOffController.h" class Machine { public: // コンストラクタ explicit Machine(Controller& controller_) : controller(controller_){}; // キャリブレーション void calibration(); // 走行 void run(); // ゲッター int getBlack() { return black; } int g...
//############################################################################### // INTRODUCCION: Texture.h //------------------------------------------------------------------------------ // Este codigo nos proporciona la estructura para crear una textura a partir // de un fichero de imagen. // // PROGRESO DEL CODIGO...
#ifndef CCC_ITEM_HPP #define CCC_ITEM_HPP #include <QObject> // Include ui_view.h in source and header #include <ccc/ui_view.h> namespace ccc { class Item : public QObject { Q_OBJECT Q_SLOT void go(); }; } #endif
#include "modifierfinance.h" #include "ui_modifierfinance.h" #include <QPalette> #include <QDesktopWidget> #include <QtGui> #include"menuprincipale.h" modifierfinance::modifierfinance(QWidget *parent) : QDialog(parent), ui(new Ui::modifierfinance) { ui->setupUi(this); //QPixmap pix("C:/Users/MohamedAn...
// // Created by 송지원 on 2020-05-17. // #include <iostream> #include <stack> #include <utility> using namespace std; #define X first #define Y second int board[502][502] = {...}; bool vis[502][502]; int n=7, m=10; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; int main() { ios::sync_with_stdio(0); cin.ti...
#ifndef MODEL_H #define MODEL_H #include <vector> #include "datatypes.h" #include "batch_method_t.h" #include "model_status_t.h" #include "optimizer.h" #include "logger.h" #include "random_engine.h" class Model { private: /* Single sample variables */ float64_t inp; float64_t out; float64_t weight; float64_t bi...
/** * @file 3735.cc * @author FAN Kai (fankai@net.pku.edu.cn), Peking University * @date May 22 04:27:25 PM CST 2009 */ #include <iostream> #include <algorithm> #include <cassert> #include <vector> using namespace std; class Matrix { public: Matrix(int row, int col) { this->row = row; ...
#include <iostream> using namespace std; int main() { int res = 2; int tra; int fib1 = 1; int fib2 = 2; int temp; cout<<fib1<<"\n"<<fib2<<"\n"; while(fib2 < 4000000){ temp = fib2; fib2 = fib1 +fib2; fib1 = temp; if(fib2%2==0) res = res + fib2; cout<<fib2<<"\n"; } cout<<res<<"\n"; retu...
/* * @lc app=leetcode.cn id=110 lang=cpp * * [110] 平衡二叉树 */ // @lc code=start /** * Definition for a binary tree node. */ #include<iostream> #include<vector> #include<algorithm> using namespace std; // struct TreeNode { // int val; // TreeNode *left; // TreeNode *right; // TreeNode(int x) :...
#ifndef MODELEXCEPTION_HPP #define MODELEXCEPTION_HPP #include <stdexcept> class ModelException : public std::exception { public: const char * what() const noexcept override; }; class ModelBoxNotOpenException : public ModelException { public: const char * what() const noexcept override; }; class ModelBoxNotClos...
#include <iostream> #include <string> #include "BITMAP.h" using namespace std; enum { to8bits, to4bits, to24bits, toGray, toBlackwhite }; void loadInfo(char *name) { FILE *fp; BITMAPFILEHEADER bf; BITMAPINFOHEADER bi; if ((fp = fopen(name, "rb")) == NULL) { cout << "Open file failed." << e...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2006 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" #if defined(SVG_SUPPORT) && defined(SV...
class Solution { public: int calculate(string s) { int sum = 0, num = 0; char op = '+'; stack<int> stk; for(int i = 0; i < s.size(); ++i){ if(isdigit(s[i])){ num = num*10 + (s[i] - '0'); } if(!isdigit(s[i]) && s[i] != ' ' || i == s....
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #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 <deque> #include <map> #include <functional>...
// Mon Jan 11 16:53:20 EST 2016 // Evan S Weinberg // Header file for templated vector operations. #include <complex> #include <random> #ifndef GENERIC_VECTOR #define GENERIC_VECTOR // Zeroes a vector. template<typename T> inline void zero(T* v1, int size) { int i; for (i = 0; i < size; i++) { v1[i] =...
/* * 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...
#include <string> #include <windows.h> namespace CPP { class PrinterInfo { public: std::string getDefaultPrinterInfo() const { char szPrinterName[255]; unsigned long lPrinterNameLength; GetDefaultPrinter(szPrinterName, &lPrinterNameLength); return std::string(szPrinterName); } }; }
/* * Algorithm : Merge Sort * Time Complexity : O(n*log(n)) * Space Complexity : O(n) */ #include <bits/stdc++.h> using namespace std; void merge(int array[],int left,int mid,int right){ int subArrayLeft = mid-left+1; int subArrayRight = right-mid; int leftArray[subArrayLeft]; int rightArray[subAr...
#include "mainwindow.h" #include <QApplication> QMovie *movie; int xyz[3][100]; Node* Head; Node* Now; int begin_tag=0; int number=0; int draw_tag=0; int rand_tag=0; QString str; int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); ...
#include <stdio.h> #include <iostream> #include <math.h> #include <algorithm> #include <memory.h> #include <set> #include <map> #include <queue> #include <deque> #include <string> #include <string.h> #include <vector> typedef long long ll; typedef long double ld; typedef unsigned long long ull; const ld PI = acos(-1.)...
#include <bits/stdc++.h> using namespace std; int countOnes(bool arr[], int low, int high) { if (high >= low) { int mid = low + (high - low)/2; if ( (mid == high || arr[mid+1] == 0) && (arr[mid] == 1)) return mid+1; if (arr[mid] == 1) return countOnes(arr, (mid + 1), high); return countO...
#include <memory> #include "Hooks.h" #ifdef _WIN32 #include <Windows.h> extern "C" BOOL WINAPI _CRT_INIT(HMODULE moduleHandle, DWORD reason, LPVOID reserved); BOOL APIENTRY DllEntryPoint(HMODULE moduleHandle, DWORD reason, LPVOID reserved) { if (!_CRT_INIT(moduleHandle, reason, reserved)) return FALSE;...
#include "gtest/gtest.h" #include "wali/wfa/WFA.hpp" #include "wali/ShortestPathSemiring.hpp" #include "wali/LongestSaturatingPathSemiring.hpp" #include "wali/domains/binrel/ProgramBddContext.hpp" #include "wali/domains/binrel/BinRel.hpp" #include "fixtures.hpp" #define NUM_ELEMENTS(array) (sizeof(array)/sizeof((arr...
/* pins */ const uint8_t vref_pin = A1; const uint8_t az_pin = 2; const uint8_t x45out_pin = A2; const uint8_t z45out_pin = A3; /* values in mv */ double vref_mv; double x_mv; double z_mv; double x_val = 0; double z_val = 0; double x_cal = 0; double z_cal = 0; uint8_t az_cnt = 0; void TC8_Handler (void) { uint...
//先根据输入数据,初始化存大小的数组map //再使用Floyd法,找出各个能确定的大小情况 //再循环对每头牛,找比他大和比他小的珍珠的个数 //如果以上两个个数,和为n-1,则可该牛名次可确定, //答案+1,最后输出个数 #include<cstdio> using namespace std; bool map[105][105];//存大小情况,如map[i][j]代表i比j大 int ans=0; int main() { int n,m; scanf("%d%d",&n,&m); for(int i=1;i<=m;i++) { int x,y; scan...
#include "monitor.h" Monitor::Monitor(QObject *parent) : QObject(parent) { }
#include <Projection.h> void Projection::refresh() { this->projection = glm::perspective(this->fieldOfView, this->aspectRatio, this->near, this->far); } Projection::Projection() { this->fieldOfView = 45.0f; this->aspectRatio = 1440.0f / 900.0f; this->near = 1.0f; this->far = 1000.0f; this->refresh(); } Project...
#pragma once #include "Module/Application.h" namespace Rocket { class SimpleApp : implements Application { public: RUNTIME_MODULE_TYPE(SimpleApp); SimpleApp() = default; virtual ~SimpleApp() = default; void PreInitializeModule() final; void PostInitializeModule() fi...
#include <stdio.h> #include <math.h> int main() { int a, b, c; double delta, raiz, x1, x2; printf("Equacao de segundo grau: "); printf("\nDigite o valor de a: "); scanf("%d", &a); printf("\nDigite o valor de b: "); scanf("%d", &b); printf("\nDigite o valor de c: "); scanf("%d", &c); if (a == 0) { print...
#include <stdio.h> #include<stdlib.h> /*Estructura llamada alumno para los dato de 3 alumnos y mostrar cual tiene el mejor promedio Elaborado por: Viviana Rojas Ruiz*/ struct alumno{ char nombre[20]; int edad; float promedio; }estudiantes[3],*pestu=estudiantes,aux[3],*paux=aux; int main() { printf("...
#ifndef ACTOR_H #define ACTOR_H #include "Lib.h" namespace gnGame { class IScene; /// <summary> /// 方向(向いている方向, 移動する方向) /// </summary> enum class Direction { Up, Down, Left, Right, }; // マップとの当たり判定ようの構造体 struct IntersectPoint { static const int Size = 2; vector<Vector2> right; vector<Vector2...
#ifndef WEAPON_H #define WEAPON_H #include<iostream> #include<string> #include<sstream> using std::string; using std::stringstream; using std::endl; enum WeaponType {sword, axe, lance, bow, anima, light, dark, staff}; class Character; class Weapon { private: int *id; static int...
/*==================================================================== Copyright(c) 2018 Adam Rankin 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 limitati...
#include<iostream> #include<vector> #include<string> using namespace std; int main(){ //input vector<string> date; string temp; cin>>temp; while(temp!="."&&date.size()<15){ date.push_back(temp); cin>>temp; } //deal with and output if(date.size()>=14){ cout<<date...
//Display the help int fix_help(void) { //Display the help cout << "Cover Fix " << endl; cout << "Version: " << _VERSION << endl; cout << "Add all positions on the coverage matrix that has zero depth." << endl << endl; //Display the usage cout << "Usage: covertools fix --bed <BED_FILE> --cover <COVER_INPUT...