sentence <- "hello"
sentence2 <- "world!"
pigLatin <- function(x){
size <- nchar(x)
newSentence <- paste(substr(x,size-1,size),substr(x,1,size-2),sep="")
return(newSentence)
}
print(pigLatin(sentence))
print(pigLatin(sentence2))
'프로그래밍' 카테고리의 다른 글
운영체제 중간고사영역 요약 (0) | 2017.05.02 |
---|---|
데이터베이스 중간고사영역 요약 (0) | 2017.05.02 |
R 프로그래밍 데이터프레임 만들기 (0) | 2017.03.30 |
데이터마이닝 (0) | 2017.03.07 |
컴퓨터구조 (0) | 2017.03.06 |
댓글