estephane

quantos serão vistos em uma fila l4q6

Apr 19th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. print("Digite 5 alturas em cm")
  2. p1=io.read("*number")
  3. p2=io.read("*number")
  4. p3=io.read("*number")
  5. p4=io.read("*number")
  6. p5=io.read("*number")
  7.  cont=1
  8.  maior=p1
  9.  
  10.  if p2>maior then
  11.  cont=cont+1
  12.  maior=p2
  13.  end
  14.     if (p3>maior) then
  15.     cont=cont+1
  16.     maior=p3
  17.     end
  18.         if (p4>maior) then
  19.         cont=cont+1
  20.         maior=p4
  21.         end
  22.         if (p5>maior) then
  23.             cont=cont+1
  24.             maior=p5
  25. end
  26. print( "serão vistos:" ..   cont    ..  "   " .. "O maior será:" .. maior)
Advertisement
Add Comment
Please, Sign In to add comment