Skip to content

Instantly share code, notes, and snippets.

@adyatlov
Last active May 28, 2020 13:00
Show Gist options
  • Save adyatlov/afd77c455164b42dba636df623fa69de to your computer and use it in GitHub Desktop.
Save adyatlov/afd77c455164b42dba636df623fa69de to your computer and use it in GitHub Desktop.
package main
import (
"bufio"
"fmt"
"io"
"log"
"os"
"unicode"
)
func main() {
reader := bufio.NewReader(os.Stdin)
for {
r, size, err := reader.ReadRune()
if size == 0 {
if err != io.EOF {
log.Println("Error: ", err)
}
break
}
if unicode.IsUpper(r) {
fmt.Print(string(r))
}
}
fmt.Println()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment