Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vetor = 1:5
- Vetor(1) = input("Digite o primeiro valor: ")
- Vetor(2) = input("Digite o segundo valor: ")
- Vetor(3) = input("Digite o terceiro valor: ")
- Vetor(4) = input("Digite o quarto valor: ")
- Vetor(5) = input("Digite o quinto valor: ")
- for b = 1:5
- if (modulo(Vetor(b),1) ~= 0 | Vetor(b)<0) then
- printf("Um valor digitado não é inteiro ou nulo!")
- abort()
- end
- end
- for a = 1:5
- printf("%g ",Vetor(a))
- end
- Vetor = 1:10
- for a = 1:10
- if a==1 then
- String = "Digite o primeiro valor: "
- end
- if a~=1 then
- String = "Digite o seguinte valor: "
- end
- Vetor(a) = input(String)
- end
- for b = 10:-1:1
- printf("%g \ ",Vetor(b))
- end
- Nota = 1:4
- Sum = 0
- for a = 1:4
- if a == 1 then
- Aluno = "Digite a Primeira Nota: "
- end
- if a == 2 then
- Aluno = "Digite a Segunda Nota: "
- end
- if a == 3 then
- Aluno = "Digite a Terceira Nota: "
- end
- if a == 4 then
- Aluno = "Digite a Quarta Nota: "
- end
- Nota(a) = input(Aluno)
- end
- for b = 1:4
- if(modulo(Nota(b),1) ~= 0 | Nota(b)<0) then
- printf("Uma das notas é inválida!!")
- abort()
- end
- end
- for b = 1:4
- Sum = Sum + Nota(b)
- end
- Media = Sum/4
- printf("A média do aluno é %g",Media)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement