Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[warn(unused_variables)]
- fn calificacion (nota:i8)->&'static str{
- if nota > 95 {return "A+";}
- if (nota > 90) & (nota <= 95) {return "A";}
- if (nota > 80) & (nota <= 90) {return "B";}
- if (nota > 60) & (nota <= 80) {return "C";}
- "D"
- }
- fn main (){
- for nota in [95,90,95,80,90,60,80,60]{
- println! ("{} => {} ",nota,calificacion(nota));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement