Jump to content


Photo

[Resolvido] Algoritimos Saber Numero Maior


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

#1 carlosvl

carlosvl

    Novato no fórum

  • Usuários
  • 12 posts
  • Sexo:Masculino
  • Localidade:São Paulo

Posted 15/06/2010, 10:49

Pessoal bom dia, estou inicionado em algoritimos, e estou usando Visualg para os codigos.
Porem me deparei com uma duvida, preciso fazer o algoritimo que leia 5 valores,
e me mostra desses qual o maior, porem estou fazendo isso atraves de um loop, mais
não estou conseguindo, segue a baixo o codigo que estou tentendo fazer, se puder ajudar ou dar uma sugestão - agradeço

algoritmo "semnome"
// Função :
// Autor :
// Data : 15/06/2010
// Seção de Declarações 
var
i, maior, valor: inteiro
inicio
 maior:=0
para i de 1 ate 3 faca
escreva("Informe um valor: ")
leia(valor)
fimpara
maior:= valor
se valor > maior entao

fimse
escreva("Maior valor:", maior)

fimalgoritmo


#2 André Manoel

André Manoel

    Doutor

  • Usuários
  • 996 posts
  • Sexo:Masculino
  • Localidade:Brasilia

Posted 16/06/2010, 09:46

Bem olha só..

Você está usando ... somente uma variável...

Para saber qual o maior valor você vai ter que fazer a comparação dentro do laço que lê o número.
Porque quando você lê a primeira vez tudo bem...
Na segunda vez o valor da primeira é substituído pelo da segunda
E você perde o primeiro valor então não terá como comparar depois...

Você pode fazer assim:

//inicializar o valor
valor = 0
maior = 0

para i de 1 ate 5 faca
  escreva("Informe um valor: ")
  leia(valor)

  se valor > maior entao 
     maior = valor   
  fimse

fimpara

escreva("Maior valor:", maior)

Abração

(y)
Iniciando na Ajuda On line...

Posted Image Meu post lhe ajudou? Reputar/votar é uma das formas de agradecer.

#3 carlosvl

carlosvl

    Novato no fórum

  • Usuários
  • 12 posts
  • Sexo:Masculino
  • Localidade:São Paulo

Posted 16/06/2010, 14:25

André, obrigado pela dica, estudei a forma como você fez para eu aprender, deu certo....

Bem olha só..

Você está usando ... somente uma variável...

Para saber qual o maior valor você vai ter que fazer a comparação dentro do laço que lê o número.
Porque quando você lê a primeira vez tudo bem...
Na segunda vez o valor da primeira é substituído pelo da segunda
E você perde o primeiro valor então não terá como comparar depois...

Você pode fazer assim:

//inicializar o valor
valor = 0
maior = 0

para i de 1 ate 5 faca
  escreva("Informe um valor: ")
  leia(valor)

  se valor > maior entao 
     maior = valor   
  fimse

fimpara

escreva("Maior valor:", maior)

Abração

(y)


André, obrigado pela dica, estudei a forma como você fez para eu aprender, deu certo....


Bem olha só..

Você está usando ... somente uma variável...

Para saber qual o maior valor você vai ter que fazer a comparação dentro do laço que lê o número.
Porque quando você lê a primeira vez tudo bem...
Na segunda vez o valor da primeira é substituído pelo da segunda
E você perde o primeiro valor então não terá como comparar depois...

Você pode fazer assim:

//inicializar o valor
valor = 0
maior = 0

para i de 1 ate 5 faca
  escreva("Informe um valor: ")
  leia(valor)

  se valor > maior entao 
     maior = valor   
  fimse

fimpara

escreva("Maior valor:", maior)

Abração

(y)




André, obrigado pela dica, estudei a forma como você fez para eu aprender, deu certo....

#4 HaroNism

HaroNism

    Super Veterano

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

Posted 20/09/2017, 14:51

Clomid Provames cialis Cialis Generico En Guanajuato Zithromax Alternative Disfunzione Erettile Cialis Cura Cialis Viagra Salud cialis Sinus Infection Cephalexin
Walgreens Cialis Prices online pharmacy Amoxicillin Dosage For Dogs Supplements With Amoxicillin discount generic isotretinoin medicine in internet fedex Anchorage isotretinoin tablet in germany Viagra Wirkungsdauer cheap cialis Amazon Propranolol

#5 HaroNism

HaroNism

    Super Veterano

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

Posted 05/10/2017, 08:44

Lasting Longer For Men viagra prescription Secure Tab Progesterone On Line Overseas With Free Shipping Highland
Cheep No Prescription Cialis viagra Buy Cialis Get Viagra Free
Amoxicillin Long Term Effects Cialis Per Bankuberweisung Combo Packs Viagra Cialis viagra prescription Buy Levitra 10 Mg Propecia United Pharmacies Cialis Lilly Costo

#6 HaroNism

HaroNism

    Super Veterano

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

Posted 12/10/2017, 18:02

Pharmacie Inde Certifie generic levitra online Isotretinoin 10mg Where To Buy

#7 HaroNism

HaroNism

    Super Veterano

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

Posted 30/10/2017, 06:47

Propecia Ritenzione Idrica viagra Comprar Cialis Viagra Farmacia Propecia Patente Cephalexin Flu
Acheter Du Viagra Super Actif Cialis Soft Tabs Erfahrung viagra Sell Acyclovir 800 Canada Prescription Online
Buy Tinidazole From India Online Finasteride Isotret Doxycycline Amoxicillin Combination Side Effects buying levitra in mexico Viagra Berichte Cialis Erboristeria Apotheke Cialis 10mg

#8 fapedlok

fapedlok

    Ativo

  • Usuários
  • 341 posts
  • Sexo:Masculino
  • Localidade:Brisbane

Posted 06/11/2017, 04:51

Discounts! top 10 makeup products 2017 progect12.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 Busiki-Kolechki â Internet-store jewelry, jewelry from natural stones and accessories.Stylish simple design candy color voile scarf for women ( 4.19 $)Sem dnej v maeSurovij DomEdison bulb loft classical vintage pendant light lamp with with glass shade(e27e26 base) free shipping ( 127.98 $)Komine pk-718 motorcycle men pantsoff-road women trousersoutdoor men jeanscycling have pads pants ( 30.98 $)Buy clothes, gifts, products for children at competitive prices in the online shop GroupPriceEcooda portable spooling station line bobbin winder spooler for spinning fishing reel and baitcaster line spooler & winder ( 23.57 $)Black Cubic Zirconia Silver Vermeil Ring ( 180.00 $)Electric water bottle pump dispenser with rechargeable battery drinking water bottles suction unit water dispenser kitchen tools ( 19.50 $)Canvas Bag Tote Striped Women Handbags Patchwork Women Shoulder Bag New Fashion Sac a Main Femme De Marque Casual Bolsos Mujer ( 46.68 $)16 color available brazilian hair clip in human hair extensions 7pcs full head set rita hair clips aplique tic tac cabelo humano ( 24.88 $)Original 5.8ml OBS Crius Plus RTA Atomizer-17.09 $Chic multicolor comfortable women's chiffon shawl wrap scarf ( 3.80 $)draw +and say 55bb.jpg
Discounts! best 2017 beauty products

progect12.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
шкив коленвала змз 406
Yaponskie vrachi priehali v Moskvu delitsya opitom
Wholesale spring cotton cap baseball cap snapback hat summer cap hip hop fitted cap hats for men women grinding multicolor ( 10.60 $)
Bannen, Yan
VS314 LED Projector-81.71 $
Kinglux 8 x 32 Roof BK - 7 Prism Green Laser Binoculars with 10mW Output Power 85.59$
grand theft auto liberty city pc
Backpack women high quality backpacks for teenage girls 2016 fashion leather backpack for travel mochilas mujer women backpack ( 22.59 $)
Woodworking Reaming Countersink Drill Bit Tool 7PCS ( $8.08 )
shoppinglive ru обувь
1pcs free shipping t10 led 194 168 w5w cob interior bulb light parking backup brake lamps ( 0.47 $)
датчик коленвала газель 405 двигатель
X077 Free shipping Cute Hand Washed Pot Philharmonic Filter Cup Coffee Chemex Brooch Pins,Fashion Jewelry Wholesale ( 0.89 $)
Vintage Ring Sets Fashion Designer Antique Alloy Nature Blue Stone 5pcs Midi finger Rings for Women conjuntos de anillo ( 3.99 $)
4pcs 18g 83mm color spoon metal lures ice fishing lures brand hard bait fresh water bass walleye crappie fishing tackle 023 ( 12.00 $)


4.jpg
Discounts! best new products of 2017

progect12.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
counter strike 1.6 edition
ремонт гбц +в иркутске
Teclast X98 Plus II 2 in 1 Tablet PC-181.29 $
UMI TOUCH Android 6.0 5.5 inch 4G Phablet 2.5D Arc Corning Gorilla Glass 3 Screen MTK6753 64bit Octa Core 3GB RAM 16GB ROM Touch ID 5.0MP + 13.0MP Cameras Dual WiFi 151.39$
Hotsales high quality moto sport leggings with mesh panels yoga moto-style performance leggings yoga pants for women whiteblack ( 29.50 $)
сайт фок богатырь красные баки
каталог первого немецкого телемагазина шоппинг лайф
дюна резиновая обувь астрахань
ILIFE V5 Pro Intelligent Robotic Vacuum Cleaner-163.13 $
JISIWEI S+ Smart Robotic Vacuum Cleaner-399.00 $
Popeye black patchwork bucket bag wstuds and fringes ( 492.15 $) Jerome Dreyfuss
angry seasons
Rita Moreno
Never fading 1.2carat 6claws large simulated diamond Rings women 18K white gold plared Engagement alliance USA size ( 4.59 $)
Silver Snake Womens Ring ( 78.00 $)


38bb.jpg

#9 Miguceamma

Miguceamma

    MiguPenjisse

  • Usuários
  • 13201 posts

Posted 12/11/2017, 23:20

Where To Order Generic Bentyl Best Website Buy Amitriptyline 50 Mg With Paypal viagra Comprare Viagra Line Nolvadex 20 Mg Propecia Mail Order
Antibiotic Alternative To Keflex Allergy Provera Curretab Buy Flagyl cheap cialis Dapoxetine Purchase Viagra Wirkungsdauer

#10 HaroNism

HaroNism

    Super Veterano

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

Posted 21/11/2017, 03:42

Vente De Propecia viagra Clomid Besoin D Aide Faire Worldwide Dutasteride Medication Drugs Does Amoxicillin Make You Tired
Propecia Heart Problems Comprar Cialis En Sevilla Propecia Orquialgia viagra Cerazette Clomid Pharm Support Group In Canada
Priligy Modo De Empleo Cialis Alkohol Erfahrung generic cialis Buy Viagra No Perscription Action Clomid Hyperstimulation Ovarienne Costo Cialis 2 5 Mg




0 user(s) are reading this topic

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

IPB Skin By Virteq