如何在不使用任何功能的情况下找到字符串palindrom [英] How to find string palindrom or not without using any function

查看:95
本文介绍了如何在不使用任何功能的情况下找到字符串palindrom的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我想知道字符串Palindrome的程序或不使用任何函数和反向字符串它也没有使用任何函数

请帮助......

解决方案

这是家庭作业

所以,建议的代码方式是,



将您的字符串拆分为字符数组例如将其命名为 forward array

并以相反顺序使用for循环(start读取最后一个元素并递减计数器变量以达到数组的第一个元素)得到 反向 字符串。

<获得反向字符串后只需比较


元素,

前向阵列&反向数组,如果有任何不匹配,那么它不是回文字符串



快乐编码!

:)

Hello I would like to know the program for string Palindrome or not without using any function and reverse string it is also without using any function
please help......

解决方案

It is home-work
so, a suggested way to code is,

split your string into array of characters e.g name it forward array
and use for loop in reverse order(start reading from last element and decrement counter variable to reach at first element of array) to get Reverse string.

after getting reverse string just compare
elements of,
forward array & reverse array if any mismatch then it''s not a palindrome string

Happy Coding!
:)


这篇关于如何在不使用任何功能的情况下找到字符串palindrom的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆