Created
June 15, 2016 18:59
-
-
Save narenaryan/b772e6d09fd49636c342ef45c5c7768e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // https://www.hackerrank.com/challenges/plus-minus | |
| package main | |
| import ("fmt" | |
| "bufio" | |
| "os" | |
| "strconv" | |
| "strings" | |
| ) | |
| func main() { | |
| inputreader := bufio.NewReader(os.Stdin) | |
| N, _ := inputreader.ReadString('\n') | |
| number, _ := strconv.Atoi(strings.TrimSpace(N)) | |
| temp := number | |
| for i := temp; i > 0; i--{ | |
| result := fmt.Sprintf("%*s", temp, "#") | |
| for j := temp; j < number; j++{ | |
| result += "#" | |
| } | |
| fmt.Println(result) | |
| temp-- | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment