Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Quantos números são pares em um conjunto de números
- a=io.read("*number")
- b=io.read("*number")
- c=io.read("*number")
- d=io.read("*number")
- e=io.read("*number")
- par=0
- impar=0
- if ((a)%2==0) then
- par=1
- else
- impar=1
- end
- if ((b)%2==0) then
- par=par+1
- else
- impar=impar+1
- end
- if ((c)%2==0) then
- par=par+1
- else
- impar=impar+1
- end
- if ((d)%2==0) then
- par=par+1
- else
- impar=impar+1
- end
- if ((e)%2==0) then
- par=par+1
- else
- impar=impar+1
- end
- if par>1 then
- print(par .. "valores pares")
- elseif par==1 or par==0 then
- print(par.."valor par")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement