June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
11
Task/Narcissist/Scala/narcissist.scala
Normal file
11
Task/Narcissist/Scala/narcissist.scala
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import scala.io.StdIn
|
||||
|
||||
object Narcissist extends App {
|
||||
val text = scala.io.Source.fromFile("Narcissist.scala", "UTF-8").toStream
|
||||
println("Enter the number of lines to be input followed by those lines:\n")
|
||||
val n = StdIn.readInt()
|
||||
val lines = Stream {
|
||||
StdIn.readLine()
|
||||
}
|
||||
if (lines.mkString("\r\n") == text) println("\naccept") else println("\nreject")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue