Last active
May 28, 2020 13:13
-
-
Save adyatlov/195387eb49ce9d071f0c5356994a908b 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 | |
// NOTE, THAT THIS PROGRAM HAS A BUG | |
import ( | |
"bufio" | |
"fmt" | |
"io" | |
"log" | |
"os" | |
"unicode" | |
) | |
func main() { | |
reader := bufio.NewReader(os.Stdin) | |
for { | |
r, size, err := reader.ReadRune() | |
if err != nil { | |
if err == io.EOF && size == 0 { | |
break | |
} | |
log.Println("Error: ", err) | |
continue | |
} | |
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
NOTE, THAT THIS PROGRAM HAS A BUG