Fixed Include Statements.

This commit is contained in:
2019-08-30 09:02:49 -06:00
parent 370a7f748e
commit a64ee7b610
2 changed files with 30 additions and 28 deletions

View File

@@ -39,11 +39,9 @@
<file leaf-file-name="main.cpp" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/main.cpp">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="353">
<caret line="28" column="52" lean-forward="true" selection-start-line="0" selection-start-column="0" selection-end-line="58" selection-end-column="1" />
<folding>
<element signature="e#0#19#0" expanded="true" />
</folding>
<state relative-caret-position="0">
<caret line="0" column="15" lean-forward="true" selection-start-line="0" selection-start-column="15" selection-end-line="0" selection-end-column="15" />
<folding />
</state>
</provider>
</entry>
@@ -64,7 +62,7 @@
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="ProjectFrameBounds">
<option name="y" value="23" />
<option name="y" value="26" />
<option name="width" value="1280" />
<option name="height" value="731" />
</component>
@@ -295,16 +293,16 @@
<option name="presentableId" value="Default" />
<updated>1566875696177</updated>
<workItem from="1566875700085" duration="8341000" />
<workItem from="1567005135551" duration="4824000" />
<workItem from="1567005135551" duration="7022000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="13165000" />
<option name="totallyTimeSpent" value="15363000" />
</component>
<component name="ToolWindowManager">
<frame x="0" y="23" width="1280" height="731" extended-state="6" />
<editor active="false" />
<frame x="0" y="26" width="1280" height="731" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24861" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
@@ -314,9 +312,9 @@
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32952693" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32952693" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32952693" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39967373" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.39967373" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
@@ -351,9 +349,7 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#0#19#0" expanded="true" />
</folding>
<folding />
</state>
</provider>
</entry>
@@ -367,11 +363,9 @@
</entry>
<entry file="file://$PROJECT_DIR$/main.cpp">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="353">
<caret line="28" column="52" lean-forward="true" selection-start-line="0" selection-start-column="0" selection-end-line="58" selection-end-column="1" />
<folding>
<element signature="e#0#19#0" expanded="true" />
</folding>
<state relative-caret-position="0">
<caret line="0" column="15" lean-forward="true" selection-start-line="0" selection-start-column="15" selection-end-line="0" selection-end-column="15" />
<folding />
</state>
</provider>
</entry>

View File

@@ -1,17 +1,20 @@
#include <stdio.h>
#include <iostream>
#include <vector>
#include <numeric>
#include <cmath>
#include <stdio.h>
#include <string>
long nbonacci(unsigned int series, unsigned int n);
void computeNbonacciRatio(std::string title, unsigned int series);
int main() {
int main()
{
std::string fib, trib, fourb, fiveb;
for (int i = 1; i <= 20; i++){
for (int i = 1; i <= 20; i++)
{
fib += " " + std::to_string(nbonacci(2, i));
trib += " " + std::to_string(nbonacci(3, i));
fourb += " " + std::to_string(nbonacci(4, i));
@@ -33,11 +36,14 @@ int main() {
return 0;
}
long nbonacci(unsigned int series, unsigned int n){
long nbonacci(unsigned int series, unsigned int n)
{
if(n < series + 1) return 1;
else {
else
{
long sum = 0;
for (int i = series; i > 0; i--) {
for (int i = series; i > 0; i--)
{
sum += nbonacci(series, n - i);
}
return sum;
@@ -46,10 +52,12 @@ long nbonacci(unsigned int series, unsigned int n){
}
void computeNbonacciRatio(std::string title, unsigned int series){
void computeNbonacciRatio(std::string title, unsigned int series)
{
int i = 0;
double last = series, current = series;
while(std::abs(last-current) > 0.000001 || current - last == 0){
while(std::abs(last-current) > 0.000001 || current - last == 0)
{
i++;
last = current;
current = static_cast<double>(nbonacci(series,