CJam, 70 64 바이트
절단 {"789":I}{"76:":I}?
을 해준 @Peter Taylor에게 감사 합니다"789""76"?:I
"67":Iq:A{AI#:B){AB<7+A{BI,+}~>+s:A];}{"76"I={"789":I}{"76":I}?];}?}/A
"67":Iq:A{AI#:B){AB<7+A{BI,+}~>+s:A];}{"76"I="789""76"?:I];}?}/A
나는 이것이 훨씬 더 골프를 치고 당신의 도움이 크게 감사 할 것이라는 것을 알고 있지만 솔직히 나는 대답을 얻을 수있어서 기쁘다. 이것은 CJam을 쓰는 첫 시도였습니다.
설명:
"67":I e# Assign the value of 67 to I
q:A e# Read the input and assign to A
{ e# Opening brackets for loop
AI#:B) e# Get the index of I inside A and assign to B. The increment value by 1 to use for if condition (do not want to process if the index was -1)
{ e# Open brackets for true result of if statement
AB< e# Slice A to get everything before index B
7+ e# Append 7 to slice
A{BI,+}~> e# Slice A to get everything after index B plus the length of string I (this will remove I entirely)
+s:A e# Append both slices, convert to string, and assign back to A
]; e# Clear the stack
} e# Closing brackets for the if condition
{ e# Open brackets for false result of if statement
"76"I= e# Check if I is equal to 76
"789" e# If I is 76, make I 789
"76"?:I e# If I is not 76, make I 76
]; e# Clear the stack if I does not exist inside A
}? e# Closing brackets for false result of if statement
}/ e# Loop
A e# Output A