题解 | #成绩判定#

成绩判定

http://www.nowcoder.com/practice/b2b3fa396af04925adb5f43653da267c

package main //import "fmt"

/**

  • 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
  • @param score int整型 分数
  • @return string字符串 */ func judgeScore( score int ) string { // write code here var ans string switch { case score < 60 :ans = "不及格" case score >= 60 && score < 80 :ans="中等" case score >= 80 && score < 90 :ans="良好" case score >= 90: ans = "优秀" } return ans }
全部评论

相关推荐

评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务