Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bb66452

Browse files
authored
Update kama54.替换数字.md
1 parent 3334e5f commit bb66452

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

‎problems/kama54.替换数字.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,27 @@ class Main {
162162
```
163163

164164
### Go:
165+
````go
166+
package main
167+
168+
import "fmt"
169+
170+
func main(){
171+
var strByte []byte
172+
173+
fmt.Scanln(&strByte)
174+
175+
for i := 0; i < len(strByte); i++{
176+
if strByte[i] <= '9' && strByte[i] >= '0' {
177+
inserElement := []byte{'n','u','m','b','e','r'}
178+
strByte = append(strByte[:i], append(inserElement, strByte[i+1:]...)...)
179+
i = i + len(inserElement) -1
180+
}
181+
}
182+
183+
fmt.Printf(string(strByte))
184+
}
185+
````
165186

166187

167188

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /