Last active
May 28, 2020 13:00
-
-
Save adyatlov/afd77c455164b42dba636df623fa69de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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