Jump to content


Photo

Sequência De Fibonacci


  • Faça o login para participar
27 replies to this topic

#1 jack esqueleto

jack esqueleto

    Mestre

  • Usuários
  • 671 posts
  • Sexo:Masculino
  • Localidade:Santa Cruz do Rio Pardo, São Paulo

Posted 19/04/2006, 19:33

Olá pessoal!

Não sei se aqui é o local certo para isso mas... qual seria o algoritmo em Pascal para eu criar a sequência de Fibonacci? O meu professor deu isso na escola hoje mas nem ele conseguiu fazer direito. Eu havia conseguido, mas quando chegava em um certo número ele já estava dando errado. Então, como é possivel criar o algorito para a sequência de Fibonacci em Pascal?
  • LarPhozyHah and JeffMalm curtiram esta postagem
> novo site pessoal (2008) : http://www.manoelpdb.8m.com/

> meu blog : http://www.manoelpdb.blogspot.com/

> galeria no deviantART : http://www.manoelpdb.deviantart.com/

#2 .System

.System

    loading...

  • Usuários
  • 144 posts
  • Sexo:Não informado

Posted 19/04/2006, 21:23

Seguinte, primeiro pense como funciona a seqüência.

O critério é que o próximo número da seqüência é a soma dos dois números anteriores.

Onde você tem dificuldade? Diz onde é que eu te ajudo.

Abraços,
System

#3 jack esqueleto

jack esqueleto

    Mestre

  • Usuários
  • 671 posts
  • Sexo:Masculino
  • Localidade:Santa Cruz do Rio Pardo, São Paulo

Posted 20/04/2006, 19:54

Seguinte, primeiro pense como funciona a seqüência.

O critério é que o próximo número da seqüência é a soma dos dois números anteriores.

Onde você tem dificuldade? Diz onde é que eu te ajudo.

Abraços,
System


Sim, isso eu sei. Falando assim até parece fácil, mas na verdade não é tão simples.
Eu criei um algoritmo que até uns 5 primeiros números aparecem corretos, depois a lógica vai dando errado. Não sei porque. Eu criei um algoritmo mais ou menos assim:

- São três variaveis, uma para o número anterior, uma para o número atual e uma para o resultado;
- A variavel de resultado é a soma das outras duas variaveis;
- A variavel do número anterior inicia com zero, e a do número atual inicia com 1;
- Após acontecer a soma das variaveis que dão o resultado pro número atual, a variavel anterior recebe o valor da variavel atual, e a variavel atual soma mais um (tudo isso dentro de um laço de repetição);
- No final, escreve o valor da variavel do resultado final.

O que pode estar dando errado com esses meus pensamentos?
> novo site pessoal (2008) : http://www.manoelpdb.8m.com/

> meu blog : http://www.manoelpdb.blogspot.com/

> galeria no deviantART : http://www.manoelpdb.deviantart.com/

#4 frlouzada

frlouzada

    Normal

  • Usuários
  • 98 posts
  • Sexo:Não informado
  • Localidade:Vitória - ES

Posted 28/04/2006, 18:59


Seguinte, primeiro pense como funciona a seqüência.

O critério é que o próximo número da seqüência é a soma dos dois números anteriores.

Onde você tem dificuldade? Diz onde é que eu te ajudo.

Abraços,
System


Sim, isso eu sei. Falando assim até parece fácil, mas na verdade não é tão simples.
Eu criei um algoritmo que até uns 5 primeiros números aparecem corretos, depois a lógica vai dando errado. Não sei porque. Eu criei um algoritmo mais ou menos assim:

- São três variaveis, uma para o número anterior, uma para o número atual e uma para o resultado;
- A variavel de resultado é a soma das outras duas variaveis;
- A variavel do número anterior inicia com zero, e a do número atual inicia com 1;
- Após acontecer a soma das variaveis que dão o resultado pro número atual, a variavel anterior recebe o valor da variavel atual, e a variavel atual soma mais um (tudo isso dentro de um laço de repetição);
- No final, escreve o valor da variavel do resultado final.

O que pode estar dando errado com esses meus pensamentos?



Seu pensamento tá quase certo...
O seu erro está na parte em negrito...
A lógica é a seguinte...
Anterior := 0;
Atual := 1;
(repetição)
Soma := Anterior + Atual;
Anterior := Atual;
Atual := Soma;

Agora desenvolva seu algoritmo
[]'s

Edição feita por: frlouzada, 28/04/2006, 19:08.


#5 Dantetekanem

Dantetekanem

    Normal

  • Usuários
  • 74 posts
  • Sexo:Não informado

Posted 30/04/2006, 16:43

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script language="javascript">
<!--
function fibonacci() {
qtd = document.forms[0].elements['qtd'].value - 1;
var seq=new Array(1,1);
if(qtd == 0) {
  window.alert("Você executou mal o script... dãããrrr...");
}
else {
  var i=0;
  do {
  var numst=seq[seq.length - 2];
  var numnd=seq[seq.length - 1];
  var soma=numst + numnd;
  seq[seq.length]=soma;
  i++;
  }  while(i<qtd)
  var j=0;
  do {
 alert("Casa: "+j+"  Resultado: "+seq[j]);
  j++;
  }  while(j<seq.length)
}
}
//-->
</script>
<body>
<form method="post" action="java script:fibonacci();">
  <p>
	<input name="qtd" type="text" id="qtd" size="3">
  </p>
  <p>
	<input type="submit" name="Submit" value="Calcular">
  </p>
</form>
</body>
</html>


Assim é a sequência em JS, passar para outra linguagem agora deve ser mais fácil.

Abraços.



P.S.: Não fui eu quem desenvolvi essa função, mas não me recordo o nome do autor.

Edição feita por: Dantetekanem, 30/04/2006, 16:44.


#6 Paulo Freitas

Paulo Freitas

    ××××××× LRU #456504 ××××××× ××××××× LRM #364686 ×××××××

  • Ex-Admins
  • 5612 posts
  • Sexo:Masculino
  • Localidade:Campinas - SP

Posted 30/04/2006, 20:32

A Wikipedia contém um material bem extenso, inclusive representações de códigos das linguagens mais famosas. Vide artigos:[]’s :DAté mais

#7 jack esqueleto

jack esqueleto

    Mestre

  • Usuários
  • 671 posts
  • Sexo:Masculino
  • Localidade:Santa Cruz do Rio Pardo, São Paulo

Posted 01/05/2006, 10:57

Obrigado a todas as ajudas pessoal!
Consegui fazer direitinho agora! \o\

Abraços.
> novo site pessoal (2008) : http://www.manoelpdb.8m.com/

> meu blog : http://www.manoelpdb.blogspot.com/

> galeria no deviantART : http://www.manoelpdb.deviantart.com/

#8 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 17/09/2017, 15:48

Isotretinoin skin health website on line cialis price Viagra Dure Combien De Temps
buy generic isotretinoin internet visa with free shipping Cheap Ciali Pills Klebsiella Amoxicillin
Cialis 40 Mg Dosage <a href=http://cialtobuy.com>online pharmacy</a> Osu Cialis Commander
Priligy Kamagra viagra cialis No 1 Pharmacy
Come Acquistare Viagra Online
Find Discount Generic Elocon Cheap With Free Shipping <a href=http://cialtobuy.com>cialis price</a> Meloxicam

#9 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 22/09/2017, 19:29

Ursodiol viagra cialis Genericpillsshop Foros Cialis Generico Comprar Viagra Generica En Espana cialis Propecia Gimnasio
Purchasing Stendra From Canada cialis price Amoxicillin And Indications And Uses Retin A Propecia Wikipedia Kamagra Compra Levitra Online cialis For Sale Shipped Ups Isotretinoin Acne Discount Medicine

#10 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 26/09/2017, 19:22

What Pills Are Good To Get High Off Of online pharmacy Viagra 100 Achat
Cialis Thailandia cialis Viagra Generique En Belgique Precio Levitra Tabletas

#11 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 06/10/2017, 00:47

Tabletten Viagra Cialis Prostata Infiammazione order levitra on line Viagra Liquido Buy Generic Soft Viagra
Effective Propecia Doses Best Prices Ed Meds Rem Again viagra Levitra Para La Mujer Levitra Von Bayer Viagra E Cardiopatia
Gel De Kamagra buy viagra online Cephalexin Antibiotic Class Cefotaxime

#12 Miguceamma

Miguceamma

    MiguPenjisse

  • Usuários
  • 13201 posts

Posted 09/10/2017, 15:51

Buy Xenical Online Prezzo Kamagra Farmacia Propecia Truth viagra online prescription Definicionpatente De Propecia
Meshashringi Left Amoxicillin Out Over Night Generique Amoxicillin Distribuer Ces viagra Viagra A Partir De Quel Age Cialis Levitra Viagra Vergleich Buy Fluconazole Without A Prescription
Cialis Drogen Orlistat Weight Loss generic viagra Cialis Viagra Achat Generic Propecia Accutane
Propecia Parafarmacia Purchase Orlistat 60 Mg viagra online prescription Priligy Ricetta Medica
Viagra Generico Cialis Levitra No Prescription Necessary viagra Non Prescription Cymbalta

#13 HaroNism

HaroNism

    Super Veterano

  • Usuários
  • 15385 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 13/10/2017, 07:25

Secure Ordering Doxycycline viagra Cialis Vantaggi
Where to order real isotretinoin drugs on line Cialis By Internet Buy Cialus Cheap acquista vardenafil Viagra Probepackung Kostenlos Ampicillin 500

#14 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 16/10/2017, 00:57

Pfizer Viagra Instructions levitra professional reviews Priligy On The Nhs

#15 rapedlok

rapedlok

    Expert

  • Usuários
  • 502 posts
  • Sexo:Feminino
  • Localidade:Veley Stream

Posted 16/10/2017, 04:51

Discounts! new cosmetic products progect13.jpg Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked! If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included). buy.png READ MORE Peruvian virgin hair body wave 4 bundles peruvian body wave og hair cheap peruvian hair body wave unprocessed human hair bundles ( 87.90 $)1a Prima Classe - Geo Printed Medium Shoulder Bag ( 180.00 $)EP0014 Glitter Gold Metal Acetate Round Sunglasses ( 170.00 $)Stunning short side bang women's siv human hair wig ( 46.45 $)Linen. Shop. | RASTL.RUNew Fashion Girls Casual Canvas Shoulder Bag Tote Women Cartoon Mickey Handbag Big Capacity Hello Kitty Shopping Bag Satchel Bag ( 6.46 $)Woman Agate Cameo Pendant ( 168.00 $)Jadore Plein Black iPhone 5 Cover ( 61.50 $)Malaysian virgin hair straight 7a malaysian straight virgin hair 4 bundles human hair extensions straight hair weave bundles ( 50.00 $)3pcs lot curly crochet hair 8 freetress afro kinky curly crochet braids hair extensions 12colors synthetic ( 11.10 $)A9 Mini GPS Tracker for Children Pets Car Vehicle $36.23Flashing Santa LED Tealight Christmas Fairy Lights Gifts Ornaments-1.55 $Original 5.8ml OBS Crius Plus RTA Atomizer-17.09 $25w g9 fashionable led modern crystal pendant lamp with 3 lights fixtures hanging light lamparas lustres e pendentes ( 110.98 $)Crystal high heel shoes woman pumps fashion rhinestone wedding shoes women high heels handmade platform shoes big size 31-43 ( 102.84 $) 127bb.jpg
Discounts! best hair putty

progect13.jpg
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).

buy.png

READ MORE
XIAOMI REDMI Note 3 32GB 4G Phablet-204.75 $
Cylinder Silver Plated Cuff Links ( 66.40 $)
Lace frontal closure 13x4 brazilian body wave lace frontal ear to ear lace frontal xbl brazilian virgin hair body wave frontal ( 92.50 $)
Gemini link striped oblong wool scarf ( 149.78 $) Tory Burch
LCD Keyboard Wireless SMS Home GSM Alarm systems House intelligent auto Burglar Door Security Alarm System kit+Smoke detector ( 61.00 $)
TC-X Guaranteed Car LED Headlights H7 H1 H3 H11H8H9 HB39005 HB49006 H27 880881 7000LM Super Power Replacement LED Bulb Kit ( 42.84 $)
Free shipping led fog lights lamps for mitsubishi pajero 2007~2009 clear lens pair set + wiring kit fog light set ( 105.58 $)
JJRC H28 H28C H28W Original USB Cable RC Quadcopter Spare Part ( $2.87 )
DOOGEE X6 Pro 4G Phablet-98.22 $
2pcs Outdoor 11 LED Clip-on Cap Lamp ( $3.59 )
Suaoki Solar Panel Retractable Camping LED Lantern-16.99 $
LETV Leeco One X600 32GB ROM 4G Phablet-152.21 $
AL Sport Black Aluminium Rollerball Fountain Pen Set ( 178.00 $)
Sex toys for woman vibrators,g-spot waterproof vibrator for women sex toys anal nipple vibrator sex products magic tool sex toy ( 36.27 $)
Best salon barber instant hair styling powder toppik hair fiber thickening keratin hair fibre concealer hair loss 27.5g ( 25.98 $)


30bb.jpg
Discounts! 10 best makeup products

progect13.jpg
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).

buy.png

READ MORE
Ceremoniya podpisaniya dogovora mezhdu Rossiej, Krimom i Sevastopolem
Vintage Poster Star Wars kraft paper white soldiers retro nostalgia decorative painting darth vader stormtrooper yoda 42X30CM ( 1.80 $)
Internet skateshop Proskater.ru - Quality equipment for riders and the city - snowboard jackets, skate wear, skateboards, snowboards and more
AGM X1 4G Phablet-340.99 $
Hubsan X4 H502E 2.4G Drone ( 79.09 $)
Car Dvr 1080P Dual Lens Dash Camera Mirror Digital Recorder With Rearview Camera Video Recorders Camcorder Vehicles Registrar ( 46.65 $)
Silver Plated European Flag Button Covers ( 57.60 $)
Ladies handbag casual tote canvas bag bolsa feminina stripe women canvas bags large messenger bag women patchwork handbags ( 25.73 $)
Grade 10a malaysian virgin hair weave malaysian deep curly virgin hair 4pcs malaysian curly virgin hair remy human hair bundles ( 74.00 $)
Planet Sports
2016 police tactical vest outdoor camouflage military body armor sports wear hunting vest army swat molle vest black ( 90.00 $)
Lyubov po pravilam i bez
Jet Set Travel Large Phone Case ( 110.00 $)
High Quality Copper 7 pcs Makeup Brush Set New Colorful Pinceaux Maquillage Beautiful Powder Blush Eyeshadow Make Up Brushes ( 17.99 $)
UNIC UC40+ LCD Projector-69.80 $


73bb.jpg
Discounts! best product marketing

progect13.jpg
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).

buy.png

READ MORE
Susanna, Syuzanna
Starry red turquoise leather and suede sandal ( 331.66 $) Paula Cademartori
XiaoMi Mi4S 4G Smartphone-314.67 $
2016 female coin purse single zipper clutch bag ladies' wallets fashion women's purses handbags free shipping 2015002 ( 13.98 $)
Unprocessed7a virgin hair lace closure 4 ( 61.25 $)
Annajolly women lace floral sexy soild cup underwear bra fashion women clothing intimates underwire byustgalter hot sale 7314 ( 20.75 $)
20 Mini Beautiful Japanese Red Maple Bonsai Seeds, DIY Bonsai ornamental flowerpot ( 1.79 $)
Rc drone multicopter 6-axle aircraft kit f550 hexa-rotor air frame gps apm2.8 flight control no battery no txrx f05114-ax ( 136.31 $)
EKEN H9 Ultra HD 4K Action Camera-54.29 $
Umi Max 4G Phablet-187.60 $
Teclast Tbook 16 Pro 2 in 1 Tablet PC-230.93 $
100 seeds mixed color cineraria seeds potted seed flower seeds for home garden promotion ( 0.55 $)
Jewelrypalace 8.6ct genuine rainbow fire mystic topaz dangle earrings 925 solid sterling silver luxury gift for women jewelry ( 97.93 $)
Bikini swimwear swimsuit women biquinis bikini set swimsuit lady bathing suit female swimwear swimming suit for women plavky ( 25.14 $)
4 Bundles Brazilian Body Wave 100g 7A Unprocessed Brazilian Virgin Hair Body Wave Nadula Hair Products Top Brazilian Human Hair ( 72.00 $)


111bb.jpg
Discounts! product description page design

progect13.jpg
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).

buy.png

READ MORE
KOLIBELNAYa BEDNIH
Original xiaomi mi power bank 2 10000mah external battery portable mobile backup bank mi charger for ( 24.99 $)
Marrant crazy horse genuine leather bag casual men handbags men crossbody bags men s travel bag ( 98.00 $)
Shop the most current gadgets, RC helicopters and quadcopters, smartphones and trendy clothes on Banggood.com
Hot Selling 7Pcsset 6A Remy Virgin Brazilian Hair Clip In Extension Straight Human Hair Clip in #4 70g Remy Virgin Hair Clip ( 28.26 $)
2 X Plug&Play 90W 9000LM H1 H3 H4 H7 H8 H10 H11 H13 9005HB3 9006HB4 880 D2S COB LED Bulbs DRL Car Fog Headlight Auto Lamp Bulb ( 46.98 $)
8GB Ram+128GB SSD+1000GB HDD Ultrathin Quad Core J1900 Fast Running Windows10 system Laptop Notebook Computer, free shipping ( 399.00 $)
Classic Butterfly Bangles Bracelets Fashion Glass Cabochon Bracelet for Women Newest Bronze Leather Bracelet ( 1.35 $)
Simple solid color round neck short sleeve men's t-shirt ( 11.39 $)
7a soft unprocessed malaysian straight virgin hair natural black color malaysian virgin hair straight 4pcs lot human hair weave ( 45.00 $)
Cheerson CX — 10W Quadcopter-28.89 $
Small Panthers Goldtone Brass wGlass Pearls Drop Earrings ( 88.00 $)
Jewelry store lines of Love. A network of jewelry stores
Unisex cheapest canvas cartoon candy color retro small coin change purse key car pouch little money ( 0.99 $)
2015 new hot selling professional police digital breath alcohol tester breathalyzer at838 free shipping dropshipping ( 9.99 $)


31.jpg




0 user(s) are reading this topic

0 membro(s), 0 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq