Created
May 14, 2022 18:09
-
-
Save jtprogru/4870c8989fbe2f1f01151dc3057cb51c 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
package main | |
import "fmt" | |
func main() { | |
var inputBigNumber string | |
var inputSinglNumber string | |
var outputStr string | |
_, _ = fmt.Scan(&inputBigNumber) | |
_, _ = fmt.Scan(&inputSinglNumber) | |
for _, v := range inputBigNumber { | |
if inputSinglNumber != string(v) { | |
outputStr += string(v) | |
} | |
} | |
fmt.Println(outputStr) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment