CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 18:07:24 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=c48785143f471967a6a72d27d881778edfb3569230895fdb8acf3b31147603c2a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22U2RxyBbkMzKImcoOFpgyq6oyiknPqYfs%22%3B%7D; HttpOnly; Path=/
cf-ray: 98d04bfb2a36c7cf-BLR
// 创建成绩数据val scores = sc.parallelize(Seq( ("Olivia", 95), ("Liam", 65), - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 创建成绩数据
- val scores = sc.parallelize(Seq(
- ("Olivia", 95),
- ("Liam", 65),
- ("Emma", 88),
- ("Noah", 89),
- ("Ava", 50),
- ("Ethan", 93),
- ("Sophia", 78),
- ("Mason", 99),
- ("Isabella", 66),
- ("Lucas", 59)
- ))
- // 求出成绩前三名的同学
- val top3Students = scores.sortBy(_._2, ascending = false).take(3)
- println("Top 3 Students:")
- top3Students.foreach { case (name, score) =>
- println(s"$name: $score")
- }
- // 求出不及格的同学(成绩小于60分)
- val failedStudents = scores.filter(_._2 < 60).collect()
- println("Failed Students:")
- failedStudents.foreach { case (name, score) =>
- println(s"$name: $score")
- }
Advertisement
Add Comment
Please, Sign In to add comment
-
✅ Make $2500 in 20 minutes⭐⭐⭐ 3
JavaScript | 8 sec ago | 0.24 KB
-
⭐⭐⭐Make $15OO in 2O minutesV G⭐⭐
Java | 14 sec ago | 0.10 KB
-
⭐ G2A Bug ⭐ (Get more on BTC swaps) ✅ NEVER S...
JavaScript | 14 sec ago | 0.24 KB
-
⭐⭐Exchange Exploit⭐⭐ 9
JavaScript | 21 sec ago | 0.24 KB
-
⭐✅ Jack's Profit Method ✅ NEVER SEEN BEF...
JavaScript | 23 sec ago | 0.24 KB
-
⭐⭐⭐Make $15OO in 2O minutesV E⭐⭐
Java | 24 sec ago | 0.10 KB
-
✅⭐ Make huge profits on trading ⭐⭐ 6
JavaScript | 30 sec ago | 0.24 KB
-
⭐⭐⭐MAKE $900 INSTANTLY⭐⭐
Java | 36 sec ago | 0.10 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand