Bash, (削除) 74 (削除ここまで) (削除) 75 (削除ここまで) (削除) 103 (削除ここまで) (削除) 99 (削除ここまで) (削除) 88 (削除ここまで) 82 bytes
-10 bytes thanks to @DigitalTrauma!
-11 bytes thanks to @manatwork!
IFS=
b=ppcg
while [ "${b/hello}" ];do
read -rN1 a
b="${b: -4}$a"
echo -n "$a"
done
Explanation:
IFS= # making sure we can read whitespace properly
b=ppcg # set the variable b to some arbitrary 4 letter string
while [ "${b/hello}" ]; do # while the variable b doesn't contain "hello", do the following
read -rN1 a # get input
b="${b: -4}$a" # set b to its last 4 chars + the inputted char
echo -n "$a" # output the inputted char
done
betseg
- 8.8k
- 3
- 30
- 61