Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 7.
- a.
- my.function7 = function(a)
- {
- palindrome = FALSE
- if (my.function(my.function6(a)) == my.function6(a)) {
- cat(a, "is a palindrome.")
- return(palindrome = TRUE)
- } else
- {
- cat(a, "is not a palindrome.")
- return(palindrome = FALSE)
- }
- }
- b.
- my.function7a = function(a)
- {
- palindrome = FALSE
- for (i in a:1000000) {
- while (palindrome != TRUE) {
- if (my.function7(i) == TRUE) {
- palindrome = TRUE
- }
- }
- }
- return(palindrome)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement