Simple parsing

Report a typo

Write a program that reads 3 words separated by spaces and separates them with commas. Remember that the readLine function reads the line up to the first Enter.

Sample Input 1:

Hello my friends

Sample Output 1:

Hello, my, friends
Write a program in Scala 3
import scala.io.StdIn.readLine

@main def program =
// write your code here
___

Create a free account to access the full topic