text
stringlengths
8
6.88M
#include <iostream> #include<cmath> using namespace std; int main() { // your code goes here string str; cin>>str; unsigned int l=str.length(); unsigned int col=ceil(sqrt(l)); for(int i=0;i<col;i++) { string t=""; for(int j=i;j<l;j+=col) { t+=str[j]; } cout<<t<<" "; } return 0; }
#include <memory> #include <string> #include <gtest/gtest.h> #include <Expected.h> #include <Errors.h> #include "Common.h" TEST(ErrorSuccessHandling, cantFail) { int result = llvm::cantFail(Expected_AlwaysSuccess()); EXPECT_EQ(0, result); } TEST(ErrorSuccessHandling, consumeError) { auto expected = Expected_...
//23. Write a program in C++ that converts kilometers per hour to miles per hour. #include <iostream> using namespace std; int main() { float kmph, miph; cout << " Input the distance in kilometer : "; cin >> kmph; miph = (kmph * 0.6213712); cout << " The distance in miles per hour:"<<miph<...
#include <bits/stdc++.h> #define ll long long using namespace std; typedef tuple<ll, ll, ll> tp; typedef pair<ll, ll> pr; const ll MOD = 1000000007; const ll INF = 1e18; template <typename T> void print(const T &t) { std::copy(t.cbegin(), t.cend(), std::ostream_iterator<typename T::value_type>(std::co...
#include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <iostream> #include "opencv2/core/core.hpp" using namespace cv; using namespace std; int isValid(Mat img, int x, int y) { if (x < 0 || y < 0 || x >= img.rows || y >= img.cols) return 0; else return 1; } void ero...
// LoggerTest.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" CLogger logger; int _tmain(int argc, _TCHAR* argv[]) { logger.SetFileName(SERVER_LOG_FILE_NAME(TEXT("斗地主-全民场"), 0)); std::wstring str; for (int i = 0; i < 10000; ++i) { str += TEXT("你"); } logger.LOG_INFO(str.c_str()); return 0; ...
// // Receipt.h // ReserveSystem // // Created by HeeCheol Kim on 21/11/2018. // Copyright © 2018 HeeCheol Kim. All rights reserved. // #pragma once #include "POS.h" using namespace std; class Receipt : public POS { public: virtual void purchase(ofstream *out, vector <OrderGroup> group); inline void set...
#pragma once #include "tensor.h" #include <thrust/device_vector.h> #include <thrust/transform.h> #include <thrust/functional.h> #include <thrust/copy.h> #include "thrust_helpers.h" #define FLOAT16ALT transprecision_floating_point::tensor_precision{ 8, 7 } #define FLOAT32 transprecision_floating_point::tensor_precision{...
#include <iostream> #include <sstream> #include <fstream> #include <vector> #include <map> #include <queue> #include <stack> #include <assert.h> #include <time.h> using namespace std; ///////////////////////////////////////////////////////// // constructors ///////////////////////////////////////////////////////// /...
#include "../Include/Factory_Drager.h" #include "../Include/Botton.h" Factory_Drager::Factory_Drager() { id = 5; } Botton * Factory_Drager::generateBotton() { Botton* tmp = new Botton; tmp->setSize(100, 80); tmp->setPos(1130, 730); tmp->loadTexture("Textures/Drager.bmp"); tmp->setValue(1, 0); tmp->setId(id); ...
/* Project: C++ Class File: lesson0.cpp Notes: Remember ; after each code statement (but not after {} or () If you get errors, check the line and the lines above where the computer says the error is Escape characters for inside quotes \n newline \\ print backslash character \' \" print quote mark http...
#ifndef FISHY_VFS_FILESYSTEM_INL #define FISHY_VFS_FILESYSTEM_INL #include <CORE/UTIL/comparisonchain.h> namespace vfs { /** * */ inline bool DirectoryNode::operator==(const DirectoryNode &other) const { return core::util::ComparisonChain() .andOne(m_path.str(), other.m_path.str()) .andOne(m_mountId,...
#include <iostream> using namespace std; int main() { char grade; cout << "Enter your letter grade: " << endl; cin >> grade; if (grade == 'A') { cout << "Grade " << grade << " corresponds to number 4" << endl; } else if (grade == 'B') { cout << "Grade "...
#include <iostream> #include <iomanip> using namespace std; int main(){ int peca_1, peca_2, qtd_peca_1, qtd_peca_2; double valor_peca_1, valor_peca_2, VALOR; cin >> peca_1 >> qtd_peca_1 >> valor_peca_1; cin >> peca_2 >> qtd_peca_2 >> valor_peca_2; VALOR = (qtd_peca_1*valor_peca_1)+(qtd_peca_2*valor_peca_2); cout ...
#ifndef FOGTEMPLATEDNAME_HXX #define FOGTEMPLATEDNAME_HXX class FogTemplatedName : public FogDecoratedName { NEEDS_A_FRIEND_FOR_GNUC typedef FogDecoratedName Super; typedef FogTemplatedName This; TYPEDECL_SINGLE(This, Super) FOGTOKEN_MEMBER_DECLS FOGTOKEN_LEAF_DECLS private: ...
#ifndef LODOM_H #define LODOM_H #include <iostream> #include <Eigen/Core> #include <Eigen/Geometry> #include <vector> #include <csm/csm_all.h> // csm defines min and max, but Eigen complains #undef min #undef max class LODOM { public: LODOM(double ldist, double adist); ~LODOM(); Eigen::Vector3d lodomP...
/* * 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 ...
/************************************************************************* > File Name: echo.h > Author: Jason > Mail: jie-email@jie-trancender.org > Created Time: 2017年03月28日 星期二 17时15分41秒 ************************************************************************/ #include <muduo/net/TcpServer.h> class EchoServer...
#ifndef _GLOBALS_H #define _GLOBALS_H #include <stdio.h> #include <stdlib.h> #include <iostream> // cout, cin, cerr #include <fstream> #include <cfloat> // FLT_MAX #include <cmath> // fabs, log #include <ctime> #include <string> // strtok #include <iterator> #include <set> #include <map> #include <ve...
#include <iostream> #include "List.h" // Test Driver int main() { my::List<int> list; list.push_back( 1 ); list.push_back( 2 ); list.push_back( 3 ); list.push_back( 4 ); my::List<int>::iterator itr = list.begin(); for( itr ; itr != list.end() ; itr ++ ) { std::cout << *itr << st...
#include <SoftwareSerial.h> #include <Servo.h> Servo servo1,servo2; int posicion; SoftwareSerial BT(10,11); //10 RX, 11 TX. int sala=4; int cocina=5; int room=6; char cadena[255]; //Creamos un array de caracteres de 256 cposiciones int i=0; //Tamaño actual del array void setup() { servo1.attach(2); servo...
#include <iostream> #include <string> using namespace std; #ifndef struct_list_header #include "./list.hpp" #endif #ifndef struct_node_header #include "../struct_node/node.hpp" #endif #include "gtest/gtest.h" class struct_test : public testing::Test { protected: list<string> *slist = new list<s...
#pragma once #include <tchar.h> #include <sys/timeb.h> /* Seconds to wait for a selection before booting the default option */ #define TIMEOUT_SECONDS 60 /* Constants for limitations on how long INI file pieces can be */ #define MAX_GAME_NAME_LENGTH 63 #define MAX_GAME_LOCATION_LENGTH 511 /* Number of games t...
// ------------------------------------------------------------------------------------------------ #include "Common.hpp" #include "JValue.hpp" #include "JArray.hpp" #include "JObject.hpp" // ------------------------------------------------------------------------------------------------ namespace SqMod { // --------...
#ifndef __LayerGameMain_H__ #define __LayerGameMain_H__ #include "cocos2d.h" #include "LayerBullet.h" #include "LayerEnemy.h" #include "LayerControl.h" #include "LayerFood.h" USING_NS_CC; //! 击毁敌机获得得分数 const int SMALL_SCORE = 1000; const int MID_SCORE = 6000; const int BIG_SCORE = 30000; const i...
#include<bits/stdc++.h> using namespace std; class node { public: int data; node* lchild; node* rchild; node(int val) { data=val; lchild=NULL; rchild=NULL; } }; int heightOfTree(node* root) { if(root==NULL) { return ...
#include <bits/stdc++.h> using namespace std; const int MAX_INT = std::numeric_limits<int>::max(); const int MIN_INT = std::numeric_limits<int>::min(); const int INF = 1000000000; const int NEG_INF = -1000000000; #define max(a,b)(a>b?a:b) #define min(a,b)(a<b?a:b) #define MEM(arr,val)memset(arr,val, sizeof arr) #defi...
#include<iostream> #include<cstring> using namespace std; int main() { long long int l,m,h,i,j,coun = 0; char k; string s; cin>>l>>m; cin>>s; for(j = 1;j <= m;++j) { cin>>h>>k; s[h-1] = k; for(i = 0;i < l;++i) { if(s[i] == '.' && s[i+1] == '.') ...
/*********************************************************************** created: Sun Jan 11 2009 authors: Paul D Turner <paul@cegui.org.uk> Lukas E Meindl *************************************************************************/ /**********************************************************...
#include<iostream> using namespace std; class Node{ public: Node* next; int data; Node(int d){ next=NULL; data=d; } }; class LinkedList{ public: Node* head; Node* tail; LinkedList(){ head=tail=NULL; } void MakeLL(int x){ Node* temp = new Node(x); if(...
bool valid(int i,int j,int n,int m,vector<vector<bool>>& vis,vector<string> &a) { if(i>=0 and i<n and j>=0 and j<m and !vis[i][j] and a[i][j]=='X') return true; return false; } int dx[]={-1,0,1,0}; int dy[]={0,1,0,-1}; void search(int i,int j,int n,int m,vector<vecto...
#include "UserManager.h" void UserManager::registerUser() { User user = insertNewUserData(); users.push_back(user); fileWithUsers.addUserToFile(user); cout << endl << "Konto zalozono pomyslnie" << endl << endl; cout << "Nacisnij dowolny przycisk, aby kontynuowac." << endl; getch(); } User Us...
#ifndef LEVEL_FACTORY_H #define LEVEL_FACTORY_H #include "../engine/include/game_object.hpp" #include "../engine/include/audio.hpp" #include "../engine/include/image.hpp" #include "../engine/include/text.hpp" #include "../engine/include/level.hpp" #include "../engine/include/game.hpp" #include "background.hpp" #includ...
/* 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...
// implementation of MESH class #include "mesh.h" #include "utility.h" #define PI 3.14159265 void generateChordAndNormals(int size); // input is NOT chord but all vertice on the Bezier curve // generate normals for vertices in input // size is the length of the control point vector void rotate(int cut); // the func...
#include "Field.h" #include <algorithm> #include <memory> Field::Iterator::Iterator(const Field& i_field, int i_index) : d_field(i_field), d_index(i_index) {} const Cell& Field::Iterator::operator*() const { return d_field.d_cells[d_index]; } Field::Iterator& Field::Iterator::operator++() { ++d_index; ret...
/************************************************************* * > File Name : c1070_0.cpp * > Author : Tony * > Created Time : 2019/09/28 14:52:57 * > Algorithm : dfs **************************************************************/ #include <bits/stdc++.h> using namespace std; inli...
#include<bits/stdc++.h> using namespace std; long long dp[1000005]; int main() { int n; while(~scanf("%d",&n)) { memset(dp,0,sizeof(dp)); dp[0] = 1; int coins[4] = {1,2,5,10}; for(int i = 0; i <4; i++) { for (int j = coins[i]; j <= n; j++) { dp[j] = ...
#include "WinchHomingBehavior.h" #include <iostream> WinchHomingBehavior :: WinchHomingBehavior ( LinearSlide * Winch, LinearSlide * Ballast ): Winch ( Winch ), Ballast ( Ballast ), Homed ( false ), Controller ( NULL ), AppliedID ( NULL ) { }; WinchHomingBehavior :: ~WinchHomingBehavior () { }; void WinchHomin...
/* * ===================================================================================== * * Filename: a.cpp * * Description: * * Version: 1.0 * Created: 09/12/2013 11:02:21 PM * Revision: none * Compiler: gcc * * Author: YOUR NAME (), * Organization:...
#ifndef STATUSBAR_E3FB4A02_7439_4620_A1D2_59F3DB1A835F #define STATUSBAR_E3FB4A02_7439_4620_A1D2_59F3DB1A835F ////////////////////////////////////////////////////////////////////////// /* // Получаем указатель на главное окно. CMainFrame *pFrame = dynamic_cast<CMainFrame *>(AfxGetMainWnd()); // Находим объект строки ...
/*************************************************** * This is an example for the DFRobot WiDo - Wifi Integrated IoT lite sensor and control node * * Designed specifically to work with the DFRobot WiDo products: * * * The main library is forked from Adafruit * * Written by Lauren * BSD license, all text a...
#include<conio.h> #include<iostream> #include<string.h> //string header file using namespace std; class man { public: void monday() { cout<<"\t\tChest day"<<endl; cout<<"\t\tFirst of all Stretch your body"<<endl; cout<<"\t\t1. Barbell Bench Press"<<endl; cout<<"\t\t\t * 3-4 sets of 6-8 reps or 10-12 reps"<<endl; ...
#include <iostream> #include <gtest/gtest.h> #include "hs_math/random/normal_random_var.hpp" #include "hs_sfm/synthetic/flight_generator.hpp" #include "hs_sfm/synthetic/multiple_camera_keyset_generator.hpp" #include "hs_sfm/projective/single_camera_params_maximum_likelihood_estimator.hpp" namespace { ...
#include <iostream> using namespace std; int main() { int n; int a = 0, b = 0, c = 0; cin >> n; a = n / 3600; b = n % 3600 / 60; c = n % 3600 % 60; cout << a << ":" << b << ":" << c; return 0; }
#include<bits/stdc++.h> using namespace std; string do_the_process(string s, int till_here){ string begining; for(int i = 0; i < till_here; i ++){ begining.push_back(s[i] == '0'?'1':'0'); } reverse(begining.begin(), begining.end()); for(int i = till_here; i < s.size(); i ++){ beginin...
#include <iostream> #include <cassert> using namespace std; using ll = long long; const ll EMP = 224224224; const ll inf = 1e14; struct node { node* l = nullptr; node* r = nullptr; ll sz = 1; ll prior; int rev = 0; ll val; ll equ = EMP; ll add = 0; ll sum; ll minn; ll max...
class Solution { public: Solution(vector<int>& nums) { original = nums; } vector<int> reset() { return original; } vector<int> shuffle() { vector<int> res = original; int n = res.size(); for (int i = 0; i < n; i++) { // int idx = rand() %...
#pragma once namespace mylib { enum class API_RETURN { SUCCESS, FAILURE }; API_RETURN function() noexcept; }
/********************************* This is the CPP file of FFTW solver Author : Chao Yan Date : May 21st, 2016 **********************************/ #include "FFTW_solver.h" FFTW_solver::FFTW_solver() { /*===================================== Initializing arrays in real space ===========================...
#include <iostream> using namespace std; struct SingleCount{ char val; int count; SingleCount(char x) : val(x), count(1) {} }; string countAndSay(int n) { if ( n == 1 ) return "1"; string res ; string res_last = countAndSay( n-1 ); SingleCount *node = NULL; for( string::iterator it = res_last.begin(); it !=...
// // SMImageEditorFilterScene.h // iPet // // Created by KimSteve on 2017. 5. 24.. // Copyright © 2017년 KimSteve. All rights reserved. // #ifndef SMImageEditorFilterScene_h #define SMImageEditorFilterScene_h #include "../../SMFrameWork/Base/SMScene.h" #include "../../SMFrameWork/SpriteFilter/SpriteFilter.h" cla...
#include <stdio.h> #include <string.h> #pragma warning (disable:4996) char str[1000001]; int main(){ fgets(str, sizeof(str), stdin); // '\0', '\n' int len = strlen(str); int sum = 0, check = 0; for (int i = 0; i<len; i++){ if (str[i] >= 'a' && str[i] <= 'z' || str[i] >= 'A' && str[i] <= 'Z'){ // ...
#pragma once #include "ofMain.h" #include "ofxiPhone.h" #include "ofxiPhoneExtras.h" #include "Berry.h" #include "LadyBug.h" #define numBerries 10 #define numLadyBugs 4 class testApp : public ofxiPhoneApp { public: void setup(); void update(); void draw(); void exit(); void touchDown(ofTouchEventArgs &tou...
#pragma once /** * Many cryptographic primitives and schemes have different security levels. * For example, an encryption scheme can be CPA-secure (secure against chosen-plaintext attacks) * or CCA-secure (secure against chosen-ciphertext attacks). * The security level of a cryptographic entity is specified by making ...
#include "Log.h" #include <fstream> using namespace std; IMPLEMENT_SINGLETON(CLog); void CLog::_Tick() { if(_SwapQueue() == false){ return; } ofstream file(m_logPath.data(), fstream::out | fstream::app); if(!file.is_open()){ return; } for( string log : *m_lstLogCurrent ){ ...
../../Lib/FaceDatabase.cpp
#ifndef _MESSAGE_H_ #define _MESSAGE_H_ #include <cstdint> #include <string> #include <memory> #include <sstream> #include "MakeUnique.hh" namespace hermes { typedef std::uint16_t id_type; typedef std::uint32_t size_type; constexpr size_type max_message_size = UINT32_MAX; union network_header { struct p...
#ifndef FUZZYCORE_INPUTVARIABLE_H #define FUZZYCORE_INPUTVARIABLE_H #include <string> #include <utility> #include "../../DAO/DAOUtils/DAOUtils.h" class InputVariable { private: unsigned long id; unsigned long space_id; std::string name; std::string description; double range_start; double rang...
/* 프로그램 설명 : closeHandle 함수 이해 */ #include <stdio.h> #include <tchar.h> #include <Windows.h> int _tmain(int argc, TCHAR* argvp[]) { STARTUPINFO si = { 0, }; PROCESS_INFORMATION pi; si.cb = sizeof(si); TCHAR command[] = _T("KernelObjProb2.exe"); CreateProcess( NULL, command, NULL, NULL, TRUE, 0, NULL, NUL...
#include <iostream> #include <string> #include <set> #include <map> #include <stack> #include <queue> #include <vector> #include <utility> #include <iomanip> #include <sstream> #include <bitset> #include <cstdlib> #include <iterator> #include <algorithm> #include <functional> #include <cstdio> #include <cctype> #includ...
// -*- C++ -*- // // Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory, // Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC // // This file is part of FreePOOMA. // // FreePOOMA is free software; you can redistribute it and/or modify it // under the terms of the Expat license. // // This progr...
#include <windows.h> #include <Inventor/SoDB.h> #include "SoXipLoadBMP.h" #include "SoXipNeheStar.h" #include "SoXipNeheStarGenerator.h" #include "SoXipBitmapFont.h" #include "SoXipText3.h" #include "SoXipNeheText3.h" #include "SoXipNeheSkull.h" #include "SoXipNeheFlagGenerator.h" #include "SoXipNeheBox.h" #include "S...
#include <bits/stdc++.h> using namespace std; int main(){ int x, y = 5,z = 0; while(y--) { cin >> x; if(x % 2 == 0) { z++; } } cout << z << " valores pares" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long int; void solve(){ ll n, x; cin >> n >> x; if(n <= 2) { cout << "1\n"; return; } cout << 1 + ( n - 2 + x - 1) / x << '\n'; } int main(){ ios::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while(t--){ ...
#include "pch.h" #include <windows.h> #include <Dbghelp.h> #include <sstream> #pragma comment(lib, "Dbghelp") typedef BOOL* (WINAPI* OriginalBeep)(DWORD dwFreq, DWORD dwDuration); OriginalBeep originalBeep; void WINAPI MyBeep(DWORD dwFreq, DWORD dwDuration) { MessageBox(NULL, TEXT("Hooked Beep!!!"), TEXT("succ...
/* * OpenScore Arduino Hardware Interface */ #include <avr/wdt.h> String inputString = ""; boolean stringComplete = false; char EOL_CHAR = '\n'; boolean debug = false; boolean do_restart = false; /* * Set up serial port and reserve memory space * * Also set up watchdog timer */ void setup() { // Initialize s...
#include<iostream> #include<cstring> #include<deque> using namespace std; int TestCases; char command[100000]; int strlen_command; int n; // 수의 개수 deque<int> dq; char input_char; int input_number; int R_flag; int error_flag; void menu(char MENU); bool error_check(char MENU); void print(); int main() { cin >> TestC...
// check_callback() // Gets latest time to see if // callback should be called and // calls callback() if necessary void check_callback() { time = micros(); if (time - prev_time > rate) { prev_time = time; callback(); } }
#pragma once class Point { int m_x, m_y; public: Point(int x = 0, int y = 0); ~Point(); int GetX() const; int GetY() const; void operator=(Point & p); Point & operator+=(Point & other); // вернуть по ссылке void operator+=(int d); Point operator+(const Point & p) const; Point operator+(int d) const; ...
#include<bits/stdc++.h> using namespace std; //贪心 int cutRope1(int number) { if(number == 2) return 1; if(number == 3) return 2; int a = number % 3; //计算余数 int b = number / 3; //计算有多个3 if(a == 0) //余数为0时,所有3乘积即是结果; 例如9: 3*3*3 return pow(3,b); else if(a ==...
float temp; int tempPin = 7; int fan =2; int tempMin = 25; int fanSpeed = 0; int fanspeed = 0; void setup() { Serial.begin(9600); pinMode(2, OUTPUT); pinMode(3, INPUT); //digitalWrite(2, LOW); } void loop() { temp = analogRead(tempPin); fanSpeed=pulseIn(3,HIGH); temp = temp * 0.48828125; Serial.print("TEMPER...
#pragma once #define _CRT_SECURE_NO_WARNINGS #define _WIN32_WINNT 0x0601 #define ASIO_STANDALONE #include <asio.hpp> #include <array> #include <string> #include <chrono> #include <memory> #include <iostream> #include <fstream> #include <algorithm> #include <random> #include <vector> #include <utility> #include <list...
#include "funcoes.h" int main(int argc, char const *argv[]){ int ILC=0; //Instruction Location Counter (to usando pra saber até que posição a memória é usada) vector<bitset<8> > memoria(256, 0); //Lista de 256 binarios de 8 bits iniciados com 0 vector<Label> lista_labels; //Lista do tipo Label que guarda o...
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int n; cin >> n; vector<int> A(n); for(int i=0;i<n;i++){ cin >> A[i]; } int m;...
/************************************************************************* > File Name: test_decltype.cpp > Author: Jason > Mail: jie-email@jie-trancender.org > Created Time: 2017年06月15日 星期四 08时50分30秒 ************************************************************************/ #include <iostream> using namespace st...
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netinet/tcp.h> #include <map> #include <unordered_set> #include <vector> #include <string> #include <queue> #include <iostream> #define ...
#pragma once class linkelement { public: int ox, oy, nx, ny, player; linkelement* next; linkelement(); ~linkelement(); linkelement* get_next_element(); void set_next_element(linkelement *el); void set_values(int orx, int ory, int nex, int ney, int player); void printlist(linkelement *first_element); };
#ifndef CLIENT_HPP #define CLIENT_HPP #include <iostream> #include <SFML/Graphics.hpp> #include <SFML/Network.hpp> #include <fstream> #include "buttonImplementations.hpp" #include "gui.hpp" #include "stringdataparser.hpp" #include <thread> #include <mutex> //mainly for constants like PORT_NUMBER and DATA_STRING_BUFFE...
#include "stdafx.h" #include "Cine.h" Cine::Cine() { } Cine::~Cine() { } bool Cine::empty(Persona*first) { return(first == NULL) ? true : false; } void Cine::insertar(Persona *&first, Persona *&last, int asiento, string pelicula, int hora, int sala) { Persona *newPersona = new Persona(); new...
/*! * * \file TestForm.cpp * \author GoZone * \date 2011-1-28 * \brief 用于做内部功能测试 * * \ref CopyRight */ #include "TestForm.h" #include "TDownload.h" #include "KaiXinAPICommon.h" TestForm::TestForm(TApplication * pApp):TWindow(pApp) { Create(APP_KA_ID_TestForm); } Boolean TestForm::EventHandler( TApplicati...
#include "LifeSimulator.hpp" #include <cstdint> #include <iostream> LifeSimulator::LifeSimulator(std::uint8_t sizeX, std::uint8_t sizeY) { x = sizeX; y = sizeY; for (int i = 0; i < y; ++i) { grid.push_back(std::vector<char>(x)); } } void LifeSimulator::insertPattern(const Pattern& pattern...
#include<bits/stdc++.h> using namespace std; typedef long long ll; void solve(){ ll n;cin>>n; vector<ll>a(n); for(ll i=0;i<n;i++) cin>>a[i]; ll s=0; for(ll i=0;i<n;i++) s+=a[i]; if(s==n) cout<<0<<"\n"; else if(s>n) cout<<s-n<<"\n"; else cout<<1<<"\n"; } int main() { #ifndef ONLINE_JUDGE freopen("inpu...
#ifndef RECIEVEFRAMES_H #define RECIEVEFRAMES_H #include <QObject> #include<QCanBusDevice> #include<QCanBusFrame> class recieveFrames : public QObject { Q_OBJECT public: explicit recieveFrames(QObject *parent = nullptr); void parseMessage(QCanBusFrame); void parseRPM(QByteArray); void parseKPH(QBy...
#ifndef COLLISIONINFO2D_H #define COLLISIONINFO2D_H #include "vector2.h" class CollisionInfo2D { public: CollisionInfo2D(); // Partial assignment void CopyInParametersFrom( const CollisionInfo2D& OtherInfo ); void CopyOutParametersFrom( const CollisionInfo2D& OtherInfo ); enum EHitNormal { EHN_None, EHN_L...
#include "processstep.h" ProcessStep::ProcessStep(QString name, int number, QString group, QColor color, QObject *parent) : QObject(parent) { _name = name; _stepNumber = number; _group = group; _color = color; } QString ProcessStep::name() { return _name; } QString ProcessStep:...
#include "jeu.h" #include <QDebug> Jeu::Jeu() { jeu_id=0; nbr_enf=0; nbr_tick=0; type_jeu=""; } Jeu::Jeu(int jeu_id,QString type_jeu,int nbr_tick,int nbr_enf) { this->jeu_id=jeu_id; this->type_jeu=type_jeu; this->nbr_tick=nbr_tick; this->nbr_enf=nbr_enf; } bool Jeu::ajouter() { QSqlQuery query; QString res= QSt...
// // Created by wqy on 19-12-12. // #ifndef VERIFIER_METHODTERM_H #define VERIFIER_METHODTERM_H #include "Term.h" #include "../../Process/Method.h" namespace esc { class MethodTerm : public Term { private: list<Term*> args; Method* method; public: // TODO add method to_string ...
// // Created by Ivan Shynkarenka on 28.02.2017 // #define CATCH_CONFIG_MAIN #include "test.h"
/* * Copyright (C) 2012 Jolla Ltd * Contact: Andrew den Exter <andrew.den.exter@jollamobile.com> * * You may use this file under the terms of the BSD license as follows: * * "Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions ar...
#include <bits/stdc++.h> using namespace std; int main(){ double A, B; double media; scanf("%lf %lf",&A,&B); media = (A*3.5+B*7.5)/11; printf("MEDIA = %.5lf\n",media); return 0; }
#include <SDL_events.h> #include "Directx12Renderer.h" #include "MaterialDX12.h" #include "VertexBufferDX12.h" #include "Texture2DDX12.h" #include "RenderStateDX12.h" #include "TechniqueDX12.h" #include "MeshDX12.h" #include "d3dUtil.h" #include "pch.h" #include "Sampler2DDX12.h" #include "IA.h" DirectX12...
/** * $Source: /backup/cvsroot/project/pnids/zdk/zls/zvm/CVirtualMachine.cpp,v $ * * $Date: 2001/11/14 18:29:37 $ * * $Revision: 1.3 $ * * $Name: $ * * $Author: zls $ * * Copyright(C) since 1998 by Albert Zheng - 郑立松, All Rights Reserved. * * lisong.zheng@gmail.com * * $State: Exp $ */ #include <zls/...
#include <bits/stdc++.h> using namespace std; int main() { long int dp[101]; dp[0] = 0; dp[1] = 1; for(int i=2; i<101; i++) dp[i] = dp[i-1]+i*i; while(1) { int n; cin>>n; if(!n) break; cout<<dp[n]<<endl; } }
#if 0 #include<stack> using namespace std; template<class T> class MyStack { public: MyStack() {} void Push(T data) { stackDate.push(data); if (stackMin.empty()) stackMin.push(data); else { if (data > stackMin.top()) stackMin.push(stackMin.top()); else stackMin.push(data); } } void Pop(...
#include <bits/stdc++.h> using namespace std; const int N = 100100; int n, dis[N], par[N]; vector<int> edges[N]; vector<int> edges[N]; void bfs(int u) { queue<int> q; q.push(u); memset(par, -1, sizeof(par)); memset(dis, -1, sizeof(dis)); dis[u] = 0; while (!q.empty()) { u = q.front();...
#pragma once #include "CIL/defs.h" #include "CIL/mat/buffer_pool.h" namespace cil { struct UMatData; enum UMatUsageFlags { USAGE_DEFAULT = 0, // buffer allocation policy is platform and usage specific USAGE_ALLOCATE_HOST_MEMORY = 1 << 0, USAGE_ALLOCATE_DEVICE_MEMORY = 1 << 1, USAGE_ALLOCATE_SHARED_MEMORY...
#include "Graphics.h" Sphere::Sphere(Vector3f center, float radius) { this->center = center; this->radius = radius; } bool Sphere::Contains(Vector3f position) { float distance = (center - position).norm(); return radius > distance; } void Sphere::Draw() { glPushMatrix(); glTranslatef(center[0], center[1], cent...
#include<iostream> using namespace std; int main() { int test; cin >> test; int d[11]; d[0]=0, d[1] = 1, d[2] = 2, d[3]=4; for (int i = 4; i < 11; i++) { d[i] = d[i - 1] + d[i - 2] + d[i - 3]; } while (test--) { int num; cin >> num; cout << d[num] << endl; } return 0; }
// // IExceptions.h // RNN // // Created by Daniel Solovich on 1/3/18. // Copyright © 2018 Daniel Solovich. All rights reserved. // #ifndef IExceptions_h #define IExceptions_h #include "stacktrace.h" class IExcpetions { public: std::string backtrace = Backtrace(1); virtual std::string getError() = 0; }...