estephane

Forma decrescente

Apr 17th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. -- FORMA DECRESCENTE
  2.  
  3.  
  4. a=io.read("*number")
  5. b=io.read("*number")
  6. c=io.read("*number")
  7.  
  8.  
  9.  
  10. if (a>b) and (a>c) then
  11. print(a)
  12.  
  13.     elseif ((b>a) and (b>c)) then
  14.     print(b)
  15.  
  16.         elseif ((c>a) and (c>b)) then
  17.         print(c)
  18. end
  19.  
  20. if ((a>b) and (a<c)) then
  21. print(a)
  22.  
  23.     elseif((b>a) and (b<c)) then
  24. print(b)
  25.  
  26.         elseif ((c>b) and (c<a)) then
  27.     print(c)
  28. end
  29.  
  30.     if((a<b) and (a<c))then
  31.     print(a)
  32.  
  33.         elseif ((b<a) and (b<c)) then
  34.     print(b)
  35.  
  36.             elseif ((c<a) and (c<b)) then
  37.             print(c)
  38. end
Advertisement
Add Comment
Please, Sign In to add comment