Printing only the longest line

Report a typo

You should comment or uncomment some lines of the code so that it prints only the longest string line.

This is the longest line in this exercise

Sample Input 1:


Sample Output 1:

This is the longest line in this exercise
Write a program in Go
package main

import "fmt"

func main() {
fmt.Println("Line 1")
// fmt.Println("Longer than line 1")
fmt.Println("Longer than line 2 ")
// fmt.Println("This is the longest line in this exercise")
fmt.Println("Shorter please")
}
___

Create a free account to access the full topic