text stringlengths 8 6.88M |
|---|
// Последовательность Фибоначчи определяется так:
// F(0) = 0, F(1) = 1, …, F(n) = F(n−1) + F(n−2).
// Дано натуральное число A. Определите, каким по счету числом Фибоначчи оно является,
// то есть выведите такое число N, что F(N) = A. Если А не является числом Фибоначчи, выведите число -1.
// Формат входных данны... |
#ifndef F3LIB_IO_FILESYSTEM_H_
#define F3LIB_IO_FILESYSTEM_H_
#include <istream>
namespace f3 {
namespace io {
class FileHandle
{
public:
~FileHandle();
std::istream& getStream();
protected:
explicit FileHandle();
};
class FileSystem
{
public:
/** Creates a new file system at t... |
#include <iostream>
#include <stdlib.h>
#include <unistd.h>
#include <fstream>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <string.h>
using namespace std;
#define PORT 8001
#define SERVERADD "127.0.0.1"
void die(char *s)
{
perror(s);
exit(1);
}
int main()
{
struct sockaddr_in sadd;
int s... |
#include "DDSLoad.h"
#include "../__trash.h"
GLuint loadDDS(const char * imagepath)
{
DDS_HEADER header;
FILE *fp;
printf("%s could not be\n", imagepath);
/* try to open the file */
fp = fopen(imagepath, "rb");
if (fp == NULL){
printf("%s could not be opened. Are you in the right directory ? Don't forget ... |
//
// Created by 周华 on 2021/5/1.
//
#ifndef RAYTRACING_TRANSFORMCOMPONENT_H
#define RAYTRACING_TRANSFORMCOMPONENT_H
#include "Component.h"
class TransformComponent : public Component {
public:
~TransformComponent() {}
};
#endif //RAYTRACING_TRANSFORMCOMPONENT_H
|
#include <iostream>
#include <string>
#include <ctime>
#include <fstream>
using namespace std;
char randomLetterGen(){
static string charset = "cdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
return charset[rand() % charset.length()];
}
string randomStrGen(int length) {
string result;
result.res... |
#include <bits/stdc++.h>
#include <SDL.h>
#include "SDL_setup.h"
#include "Snake.h"
int main(int argc, char* argv[])
{
srand(time(nullptr));
if(!initSDL(window,renderer))
{
return -1;
}
bool play= true, Can_move;
int time_to_minus= 1000;
int ret_menu_type= 0;
int wallSize= 20;
... |
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
string grid[150];
long long dp[150][2][2][150][150];
long long rightSum[2][2][150][150];
long long leftSum[2][2][150][150];
int main()
{
int n;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> grid[i];
}
long lon... |
#include<iostream>
using namespace std;
int countSub(char str[])
{
int flag,count;
flag=count=0;
for (int i=0;str[i]!='\0';i++)
{
if (str[i]=='1')
{ count++;
for(int j=i+1;str[j]!='\0';j++)
if (str[j] == '1')
flag++;
}
}
return flag+cou... |
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... |
#include<iostream>
#include<math.h>
using namespace std;
class shape {
public:
int *y;
int *x;
};
// shapees 2d shape udamshih
class shape2d:public shape {
// a ni taliin urt
public:
int a;
float area();
// premetr
int pr();
};
int shape2d::pr(){
return 0;
}
float shape2d::area()... |
#include <chuffed/mdd/mdd_to_lgraph.h>
#include <algorithm>
// Convert a MDD into a edge-valued layer graph according to an array of costs.
EVLayerGraph::NodeID mdd_to_layergraph(EVLayerGraph& graph, MDD& r, vec<int>& costs) {
MDDTable& t(*r.table);
MDDNodeInt root = r.val;
root = t.expand(0, root);
const std::v... |
// Created on: 1992-04-06
// Created by: Christian CAILLET
// Copyright (c) 1992-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 ... |
#include "compiler/function_manager.hpp"
#include <boost/test/unit_test.hpp>
using namespace perseus::detail;
typedef function_manager::function_pointer iterator;
BOOST_AUTO_TEST_SUITE( compiler )
BOOST_AUTO_TEST_SUITE( function_manager_tests )
using namespace std::string_literals;
BOOST_AUTO_TEST_CASE( register... |
//Standard input/output library
#include <iostream>
int main(){
double tempf;
double tempc;
std::cout << "Input your city temperature(f): ";
std::cin >> tempf;
//store celcius value in tempc
tempc = (tempf - 32)/1.8;
std::cout << "Your city temperature is " << tempc << " degrees Celcius.";... |
#include <iostream>
#include <cstring>
#include <vector>
const int MAX = 1001;
int n, m, k, d[MAX];
bool check[MAX];
std::vector<int> list[MAX];
bool dfs(int worker)
{
for(auto x : list[worker])
{
if(check[x])
{
continue;
}
check[x] = 1;
if(d[x] == 0 || dfs(d... |
#include<iostream>
using namespace std;
class node{
public:
int data;
node* next;
//Constructor
node(int d){
data = d;
next = NULL;
}
};
void insert(node*& head,int data)
{
if(head==NULL)
{
head=new node(data);
return;
}
node *tail=head;
while(tail->next!=NULL)
{
tai... |
#include <iostream>
#include <iomanip>
#include <ctime>
using namespace std;
double solve(int);
int main() {
clock_t start = clock();
double result = solve(32);
clock_t end = clock();
cout << setprecision(11);
cout << result << ' ' << static_cast<double>(end - start) / CLOCKS_PER_SEC << endl;
system("PAUSE")... |
//---------------------------------------------------------------------------
#pragma hdrstop
#include "ISourceGenType.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
int ContainStr(String from, String to)
{
String fromLowerCase = from.LowerCase();
... |
//
// main.cpp
// Tarea3Ejercicio1
//
// Created by Daniel on 07/10/14.
// Copyright (c) 2014 Gotomo. All rights reserved.
//
#include <iostream>
#include "ListaEnlazada.h"
#define N 100
int main(int argc, const char * argv[]) {
srand((int) time(NULL));
int num;
ListaEnlazada<int> * lista = new L... |
// New Connection Dialog
//
// Copyright (C) 2008
// Center for Perceptual Systems
// University of Texas at Austin
//
// jsp Wed Jul 2 16:16:51 CDT 2008
#ifndef NEW_CONNECTION_DIALOG_H
#define NEW_CONNECTION_DIALOG_H
#include "persistent_dialog.h"
#include "ui_new_connection_dialog.h"
namespace flying_dragon
{
cl... |
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012, 2013 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby ... |
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define pb push_back
#define mp make_pair
typedef long long ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
while(t--) {
string s;
ll n;
cin>>s>>n;
int m=s.size();
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; 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.
*/
#include <core/pch.h>
#ifdef DOM_EXTENSIONS_TAB_API_SUPPORT
#inc... |
#ifndef UI_ACTION_INTERVALACTIONS_MOVE_H_
#define UI_ACTION_INTERVALACTIONS_MOVE_H_
#pragma once
namespace ui
{
class UILIB_API MoveBy : public IntervalAction
{
public:
static MoveBy* Create(float duration, const CPoint& deltaPosition);
virtual MoveBy* Clone() const override;
virtual MoveBy* Reverse() const ... |
#pragma once
#include <Tanker/Trustchain/GroupId.hpp>
#include <Tanker/Trustchain/UserId.hpp>
#include <tconcurrent/future.hpp>
#include <vector>
namespace Tanker
{
class ITrustchainPuller
{
public:
virtual tc::shared_future<void> scheduleCatchUp(
std::vector<Trustchain::UserId> const& = {},
std::vect... |
#include <iostream>
#include <sstream>
#include <vector>
#if defined(_MSC_VER) && defined(_M_X64)
# include <boost/test/included/unit_test.hpp>
#else
# include <boost/test/unit_test.hpp>
#endif
#include "opennwa/Nwa.hpp"
#include "arbitrary.hpp"
using boost::unit_test_framework::test_suite;
using b... |
#include<bits/stdc++.h>
using namespace std;
int main(){
int n=0;
string c;
cout<<"Enter the string : ";
cin>>c;
cout<<endl<<"The Concatenated String is : ";
for (int i=0; i<c.size(); i++){
if(c[i]>=65 && c[i]<=91){
n++;
cout<<endl;
}
cout<<c[i];
... |
#include "PolygonizationScene.hpp"
#include "MarchingCubes.hpp"
#include "Sphere.hpp"
#include <vector>
#include <atlas/gl/GL.hpp>
#include <atlas/utils/GUI.hpp>
namespace assignment2
{
using Vector3 = atlas::math::Vector;
PolygonizationScene::PolygonizationScene()
{
mSceneMesh.addSceneSphere(new... |
#include "stdafx.h"
#include "TestScene.h"
TestScene::TestScene()
{
}
TestScene::~TestScene()
{
}
HRESULT TestScene::Init()
{
isDebug = false;
SOUND->Play("Test", 0.5f);
//test.push_back("test");
//test.push_back("test1");
//test.push_back("test2");
//test.push_back("test3");
//TEXTDATA->TextSave((char*... |
// Created on: 2022-06-30
// Created by: Alexander MALYSHEV
// Copyright (c) 2022-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... |
// sample_multithread_c_program.c
// compile with: /c
//
// Bounce - Creates a new thread each time the letter 'a' is typed.
// Each thread bounces a happy face of a different color around
// the screen. All threads are terminated when the letter 'Q' is
// entered.
//
#include <afxwin.h>
#include <iostre... |
#include <windows.h>
#include "Audio.h"
//Costruttore
Audio::Audio(void)
{
}
//Distruttore
Audio::~Audio(void)
{
}
ALuint buffer[8]; //Array di buffer
ALuint source[8]; //Array di sorgenti
void Audio::initAL() {
alutInit(0, 0); //Inizializza OpenAL
//Vengono generati i buffers, altrimenti i suoni non saranno... |
// BSD 3-Clause License
//
// Copyright (c) 2020-2021, bodand
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, th... |
//
// EPITECH PROJECT, 2018
// nanotekspice
// File description:
// simulate chipsets
//
#include "Link.hpp"
Link::Link(std::string c, std::string p, std::string c1, std::string p1)
: _comp(c), _pin(p), _comp1(c1), _pin1(p1)
{
}
Link::Link()
{
_comp = "UNDEFINED";
_pin = "UNDEFINED";
_comp1 = "UNDEFINED";
_... |
//swap would work if array wasn't const
int Solution::repeatedNumber(const vector<int> &A) {
int n = A.size();
if (n == 0 || n == 1)
return -1;
if (n == 2)
{
if (A[0] == A[1]) {
return A[1];
} else {
return -1;
}
}
int i ... |
/*
Copyright (c) 2009-2013, Intel Corporation
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 conditions a... |
#include <iostream>
#include <algorithm>
#include<utility>
using namespace std;
int main()
{
long long n, m, j;
pair <long long , long long> temp;
cin >> n >> m;
pair<long long, long long> days[n];
for (int i = 0; i < n; i++)
cin >> days[i].first;
for (int i = 0; i < n; i++)
... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <sequtils.h>
#include <deque>
using namespace std;
void print(int t)
{
cout << t << " ";
}
int main(int argc, char *argv[])
{
deque<int> c1;
populate_lseq(c1, 10);
deque<int>::iterator pos1 = find(c1.begin(), c1.end(), 2);
deque<int>::ite... |
#include "H/mouse.h"
mouse KBmouse;
bool GetLeftClick(){
return KBmouse.mouseLeftClick;
}
bool GetRightClick(){
return KBmouse.mouseRightClick;
}
bool GetClick(){
return KBmouse.mouseClick;
}
bool GetMouseUp(){
return KBmouse.mouseUp;
}
bool GetMouseDown(){
return KBmouse.mouseDown;
}
bool GetMouseLeft(){
return... |
#include "PipeLine.h"
#include <assert.h>
void pipeLine::init(int width, int height, GLbyte* h_buffer, unsigned char* d_buffer, GLint bufferSize)
{
pipeLine::buffer = buffer;
pipeLine::bufferSize = bufferSize;
d_init(width, height, (unsigned char*)h_buffer, d_buffer);
}
void pipeLine::handleVerteices(Vertex* verti... |
#include "material.h"
#include <algorithm>
using namespace std;
namespace sbg {
Material::Material(double restitution, double density, double staticFriction, double dynamicFriction) : _density(density), _staticFriction(staticFriction), _dynamicFriction(dynamicFriction)
{
setRestitution(restitution);
}
double Mate... |
#pragma once
#include <cstdlib>
#include <array>
namespace Department {
enum Mask : unsigned int {
INTERNAL_SECURITY = 1,
AGRICULTURE = 2,
FACILITIES = 4,
MECHANICULTURE = 8,
RESEARCH = 16,
ALL = (uint)(-1)
};
using List_t = std::array<Mask,5>;
const List_t List = {{
I... |
//
// Created by 송지원 on 2020/05/23.
//
#include <iostream>
using namespace std;
int main() {
int input;
int ans = 0;
scanf("%d", &input);
while (input != 0) {
ans += (input%2);
input /= 2;
}
printf("%d", ans);
} |
#pragma once //______________________________________ CalculadoraIMC.h
#include "Resource.h"
class CalculadoraIMC : public Win::Dialog
{
public:
CalculadoraIMC()
{
}
~CalculadoraIMC()
{
}
protected:
//______ Wintempla GUI manager section begin: DO NOT EDIT AFTER THIS LINE
Win::LevelState lsIMC;
Win::Label l... |
#include "framework.h"
/*
콘솔의 출력 스트림 --> ostream cout <Console OUTput stream>
콘솔의 입력 스트림 --> istream cin <Console INput stream>
ofstream :
ifstream :
C++ 의 모드 상수
ios::in 읽기 상태
ios::ate 파일을 열고 파일포인터를 EOF로 이동
ios::app 출력 데이터가 항상 EOF에 기록
ios::trunc 기존 파일이 이미 있는 경우 , 파일을 삭제후 다시 생성
ios::nocreate fopen()을 시도하지 않고 f... |
const int PIEZO_OUTPUT_PIN = 3;
void setup()
{
Serial.begin(9600); // for printing values to console
}
void loop()
{
int potVal = analogRead(A0); // returns 0 - 1023 (due to 10 bit ADC)
Serial.println(potVal); // print value to Serial
if(potVal > 0)
{
tone(PIEZO_OUTPUT_PIN, map(potVal, 0, 1023, 0, 100... |
#ifndef _VEKTOR_HEADER_
#define _VEKTOR_HEADER_
#include "matrix.h"
class Vektor :
public Matrix
{
public:
Vektor(void);
float betrag();
float skalarprodukt(Vektor*);
float winkel(Vektor*);
virtual ~Vektor(void);
};
#endif /*_VEKTOR_HEADER_*/
|
#include<bits/stdc++.h>
using namespace std;
main()
{
long long int n, m;
while(cin>>n>>m)
{
long long int k, i;
k=n/m;
i=n%m;
cout<<((k*(k+1))/2)*i + ((k*(k-1))/2)*(m-i)<<" "<<((n-m)*(n-m+1))/2<<endl;
}
return 0;
}
|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** 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.
**
** Espen Sand
*/
#ifndef X11_ATOMIZER... |
/******************************************************************************
* $Id$
*
* Project: libLAS - http://liblas.org - A BSD library for LAS format data.
* Purpose: Implementation of Classification type.
* Author: Mateusz Loskot, mateusz@loskot.net
*
************************************************... |
// Datastructures.cc
// Remove the numberOfTowns and rechect the performance?
#include "datastructures.hh"
//#include <iostream>
#include <utility>
#include <cmath>
#include <random>
std::minstd_rand rand_engine; // Reasonably quick pseudo-random generator
template <typename Type>
Type random_in_range(Type start, ... |
#ifndef forme
#define forme
#include <iostream>
class Shape
{
public:
Shape() {}
virtual double getArea() = 0;
virtual std::ostream &put(std::ostream &s) const
{
s << "Forma Shape: " << std::endl;
return s;
}
};
class Rectangle : public Shape
{
double base;
double altezza;
... |
#include <bitset>
#include <iostream>
#include <cstdint>
auto get_bits(auto v) {
return std::bitset<sizeof(v)*8>(*reinterpret_cast<unsigned long long*>(&v));
}
int main() {
// Basic types
bool a = true;
std::cout << "bool a: " << a << std::endl;
std::cout << "sizeof(a): " << sizeof(a) << " bytes" ... |
#include "stdio.h"
#include "conio.h"
void main () {
int num1,num2,op;
clrscr();
printf("Enter number1: ");
scanf("%d",&num1);
printf("Enter number2: ");
scanf("%d",&num2);
printf("Enter case: ");
scanf("%d",&op);
switch (op) {
case 1:
printf(" = %d",num1+num2);
break;
case 2:
printf(" = ... |
uint8_t value1 = 0xFE;
uint8_t value = 0x01;
uint8_t digit[16] = { 0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xD8,
0x80, 0x90, 0x88, 0x83, 0xC6, 0xA1, 0x86, 0x8E
};
const int delayTime = 200;
int count = 0;
void setup() {
DDRC = 0xFF;
DDRA = 0xFF;
PORTC = digit[... |
#include <sstream>
#include <fstream>
#include <assert.h>
#include <unistd.h>
#include <string.h>
#include <map>
#include "steprun.h"
using namespace std;
//////////////////// print run step by step ////////////////////////////
void print_step_run(const char* bin, const char* traceFile, const char* outFile)
{
assert... |
#include "precompiled.h"
#include "q3shader/q3shadercache.h"
#include "q3shader/q3shader.h"
#include "q3shader/q3shaderpass.h"
#include "render/render.h"
#include "texture/texturecache.h"
#include "texture/texture.h"
#include "timer/timer.h"
namespace q3shader
{
Q3ShaderPass::parse_map Q3ShaderPass::s_pars... |
#include<iostream>
using namespace std;
int main()
{
int w, k, n, i;
int total = 0;
int pay;
cin >> k >> n >> w;
for (i = 1; i <= w; i++)
{
total = k * i + total;
}
cout << total << endl;
if (n > total)
{
cout << "0";
}
else
{
pay = total - n;
cout << pay;
}
return 0;
... |
#include <stdio.h>
#include <conio.h>
#include <windows.h>
void SetColor(int);
void gotoxy(short x, short y) {
COORD pos = {x, y};
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}
void matrix(char[],int,int);
int checkwin(char[]);
int main()
{
int l=0,m=0,n=0;
Here:
char arr[10]={'1'... |
//
// EPITECH PROJECT, 2018
// nanotekspice
// File description:
// simulate chipsets
//
#ifndef __COMPONENTS_HPP__
# define __COMPONENTS_HPP__
#include <vector>
#include <string>
class Components
{
public:
Components();
~Components();
void init_component_tab();
int find_in_component_tab(std::string str);... |
#ifndef THIRDMONSTER_H
#define THIRDMONSTER_H
#include "monster.h"
#include "launcher.h"
#include "fireball.h"
class ThirdMonster : public Monster, public Launcher {
Q_OBJECT
public:
ThirdMonster(QObject *parent = nullptr);
ThirdMonster(int x,
int y,
... |
#include "pch.h"
#include "DBServer.h"
DBServer::DBServer()
{
}
DBServer::~DBServer()
{
}
BOOL DBServer::Begin()
{
m_ServerConnector = new CServerConnector();
return TRUE;
}
BOOL DBServer::End()
{
return TRUE;
}
|
// Name : Angel E Hernandez
// Date : April 17
// CIS 1202.800
// Project name : Inheritance
#pragma once
#ifndef TRUCK_H
#define TRUCK_H
#include "Vehicle.h"
#include <string>
using namespace std;
// Truck is a type of vehicle that inherits members variables
//and functions from the class vehicle
class Truck : pub... |
#include "generator.h"
#include "widget.h"
extern Widget* widget;
Generator::Generator(QObject *parent) : QObject(parent)
{
counter = 0;
numbers = new int*[9];
for(int i = 0; i < 9; i++)
numbers[i] = new int [9];
}
void Generator::recieveDifficulty(int diff)
{
difficulty = diff... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int n, m;
cin >> n >> m;
vector<int> v(n+2);
for(int i=0; i<m; i++){
int l, r;
cin >> l >> r;
v[l]++;
v[r+1]--;
}
for(int i=0; i<n; i++) v[i+1] += v[i];
int ans = 0... |
#pragma once
#include "Mesh.h"
#include <vector>
#include <glm\glm.hpp>
using namespace std;
void generatePlaneData(vector<Vertex>& vertices, vector<unsigned int>& indices, unsigned int width, unsigned int length)
{
// right now we are hard coded at 8 floats per vertex and 6 vertices per cell of the plane
const ... |
/* 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... |
#if OCAML_MINOR >= 8
let attributeTxt = (x: Parsetree.attribute) => x.attr_name.txt;
#else
let attributeTxt = (x: Parsetree.attribute) => fst(x).txt;
#endif
#if OCAML_MINOR >= 8
let mkAttribute = (~loc, ~txt) => {
Parsetree.attr_loc: loc,
attr_name: Location.{loc, txt},
attr_payload: Parsetree.PStr([Ast_helper.S... |
// OgreEditorView.cpp : implementation of the COgreEditorView class
//
#include "stdafx.h"
#include "OgreEditor.h"
#include "OgreEditorView.h"
#include "Editor.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// COgreEditorView
IMPLEMENT_DYNCREATE(COgreEditorView, CView)
BEGIN_MESSAGE_MAP(COgreEdi... |
/**
\file gabaritoGerador.cpp
\author UnBeatables
\name gabaritoGerador
*/
#include "opencv2/opencv.hpp"
#include <iostream>
#include <stdlib.h>
#include <fstream>
#include <iterator>
#include <string>
#include <vector>
using namespace std;
using namespace cv;
vector<int> posX, posY;
bool flag = false;
/**
\b... |
/* -*- 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 "adjunct/quick/widgets/PagebarButt... |
#include <Windows.h>
#include <iostream>
#include "WPDException.h"
#include "WPDObject.h"
#include "WPDEnumerator.h"
#include "WPDDevice.h"
#include "WPDObjectIterator.h"
using namespace std;
using namespace WPD;
void printDate(const SYSTEMTIME &date) {
char dateStr[100];
GetDateFormatA(LOCALE_USER_DEFAULT, 0... |
//===- OR1KSubtarget.cpp - OR1K Subtarget Information -----------*- C++ -*-=//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===---------------------------------------------------------... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2003-2008 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Yngve Pettersen
**
*/
#include "core/pch.h"
#if defined(_NATI... |
// my name is pvp.
#include "stdafx.h"
#include "SuperMonsterSelect.h"
#include "pvpModeSelect.h"
#include <string>
#include "../GameCursor.h"
#include "ModeSelect.h"
#include "../StageSetup/StageSetup.h"
#include "../Game.h"
#include "../SaveLoad/PythonFileLoad.h"
#include "PMMonster.h"
#include "../Fade/Fade... |
//
// Created by arnito on 18/05/17.
//
#ifndef BEAT_THE_BEAT_RESOURCES_H
#define BEAT_THE_BEAT_RESOURCES_H
#define TEXTURETPATH "resources/Textures/"
#define FONTPATH "resources/"
#include "Utils.h"
class Resources {
public:
static void load();
static sf::Font* getFont(std::string key);
static sf::Shade... |
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int decReverse(int n, int d) {
vector<int> v;
while (n != 0) {
v.push_back(n % d);
n /= d;
}
int sum = 0;
for (int i = v.size() - 1; i >= 0; i--)
sum += v[i] * pow(d, v.size() - 1 - i);
return sum;
}
vector<int> primes... |
#pragma once
class Color
{
public:
Color();
Color(const unsigned char red, const unsigned char green, const unsigned char blue);
Color(const unsigned char red, const unsigned char green, const unsigned char blue, const unsigned char alpha);
const Color operator=(Color rhs);
const unsigned char ge... |
/*
* gnucraft.cpp
*
* Created on: 18 Apr 2013
* Author: TRocket
*/
#include <iostream>
#include "version.h"
#include "window.h"
int main(void) {
std::cout << "gnucraft v." << GIT_VERSION << std::endl;
openGNUCraftWindow();
}
|
#include "shader.h"
#include <iostream>
namespace sloth {
Shader::Shader(const char * vertexPath, const char * fragmentPath, const char * geometryPath)
{
std::cout << "vertexPath : " << vertexPath << std::endl;
std::cout << "fragmentPath : " << fragmentPath << std::endl;
if (geometryPath != nullptr)
std::c... |
#include <iostream>
#include <string>
#include <cstring>
const int MAX_N = 15;
int k;
std::string word[MAX_N];
int cache[MAX_N][1<<MAX_N], overlap[MAX_N][MAX_N];
int restore(int last, int used) {
if (used == (1 << k) - 1)
return 0;
int& ret = cache[last][used];
if (ret != -1)
return ret;
ret = 0;
f... |
class Nueva_clase :
{
public:
Nueva_clase();
virtual Nueva_clase();
setNuevoAtrib(int atribIn);
private:
unsigned int nuevoAtributo;
} |
#include "Rectangle.h"
class Block : public Rectangle {
static const int default_w = 50;
static const int default_h = 15;
public:
Block() : Rectangle(0,0, default_w, default_h, 0) {
color = rand() % 0xFFFFFFF00;
broken = false;
}
bool broken;
};
|
// Tests
#include "VnaIntermod.h"
#include "VnaIntermodTest.h"
using namespace RsaToolbox;
// RsaToolbox
#include "Definitions.h"
#include "Test.h"
// Qt
#include <QScopedPointer>
VnaIntermodTest::VnaIntermodTest(QObject *parent) :
VnaTestClass(parent)
{
}
VnaIntermodTest::VnaIntermodTest(ConnectionType type,... |
#include<bits/stdc++.h>
using namespace std;
class MyLinkedList {
public:
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(NULL) {}
ListNode(int x) : val(x), next(NULL) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
ListNode *head;
ListN... |
//
// Created by ahmed on 9/24/2018.
//
#include <iostream>
#include "windchillindex.h"
using namespace std;
using edu::vcccd::vc::csv13::computeWindChillIndex;
int main(int argc, char *argv[]) {
cout << computeWindChillIndex(5,2);
return 0;
} |
// Created on: 2001-03-06
// Created by: Christian CAILLET
// Copyright (c) 2001-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.... |
/*******************************************
C++ Program for 1D linear-hyperbolic Problem
********************************************/
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <iostream>
#include <string>
#include <fstream>
std::vector<double> x(100,0);
std::vector<double> yi(100,0); //initial... |
#include "list.hpp"
List::List():
head(nullptr)
{}
List::List(const List& other)
: head(nullptr)
{
node* newNode = other.head;
while (nullptr != newNode -> next) {
push(newNode -> key, newNode -> value);
newNode = newNode -> next;
}
push(newNode -> key, newNode -> value);
}
List::... |
// Name : Angel E Hernandez
// Date : April 17
// CIS 1202.800
// Project name : Inheritance
#pragma once
#include <iostream>
#include "Vehicle.h"
using namespace std;
// define displayInfo function from vehicle class
void Vehicle::displayInfo()
{
string manufact;
int vYear;
cout << "vehicle Program" << endl << ... |
/*
* File: manager.h
* Author: Dirk Vermeir
* Edited by: Wouter Van Rossem
*
* Created on July 22, 2009, 10:54 AM
*/
#ifndef _MANAGER_H
#define _MANAGER_H
#include <set>
#include <map>
#include <dvutil/debug.h>
#include <dvutil/props.h> // for config()
#include <dvthread/thread.h>
#include <dvthread/actor.h... |
#include <cstring>
#include <stdexcept>
#include <string>
#include "../include/catch.hpp"
#include "command_parser.h"
void testCommandParser(const char *command, void(test)(core::CommandParser &)) {
char *dup = new char[strlen(command)];
strcpy(dup, command);
core::CommandParser parser(dup);
test(parser);
... |
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* convertBST(TreeNode* root) {
int accumulation = 0;
midOr... |
#include <iberbar/Renderer/Font.h>
#include <iberbar/RHI/Device.h>
#include <iberbar/RHI/Texture.h>
#include <iberbar/Renderer/Renderer.h>
//#include <iberbar/Renderer/RendererSprite.h>
#include <iberbar/Font/FreeType.h>
#include <iberbar/Font/FontDrawText.h>
#include <iberbar/Utility/RectClip2d.h>
namespace iberbar... |
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "AbilitySystemInterface.h"
#include "CSCharacter.generated.h"
class UCameraComponent;
class USpringArmComponent;
class UCSHealthComponent;
class ACSWeapon... |
#include <iostream>
using namespace std;
int main()
{
int year = 0;
int done = 0;
while(done == 0)
{
do {
cout << "Please Enter the year : ";
cin >> year;
}while (year <= 1000 || year >= 3000);
int a = 0;
a = year - (year % 1000);
if ( a == 1000)
{
cout << "M";
}
else
{
... |
//#include "stdafx.h"
#include "Track.h"
#include <string>
using std::string;
using std::to_string;
const char* Track::getTargetsQuery = "SELECT distinct TARGETID FROM m_preprocessing;";
//extern vector<Track> HistoryTracks;
char* Track::getTargetRecords(char* targetID) {
char* res = new char[800];
sprintf_s(r... |
#include <functional>
#include <iostream>
#include <memory>
#include <sstream>
#include <string>
using namespace std;
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <boost/serialization/serialization.hpp>
struct Address {
string street, city;
int sui... |
#include<iostream>
using namespace std;
class Rectangle {
int width, height;
public:
void set_value(int, int);
int area() {
return width*height;
}
};
//using scope operator (::)
void Rectangle::set_value(int x, int y) {
width = x;
height = y;
}
int main() {
Rectangle rect,rectb;
rect.set_value(3, 4);
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.