我想做一个程序,检查输入的字符串是否是回文或使用递归。这是下面的代码。 #include <stdio.h>
#include <string.h>
int isPalindrome(char* s, int i, int j) {
if (i >= j)
return 1;
if (s[i] != s[j])
return 0;
r
我试图复制std :: string :: insert方法。 这是我的代码。 string& string::insert(int pos, char ch)
{
int len = m_length; //the length of the current string
resize(++m_length); //a method to resize the curren
#include<iostream>
using namespace std;
void HardToFollow(int *p, int q, int *num);
void HardToFollow(int *p, int q, int *num) {
*p = q + *num;
*num = q;
num = p;
p = &q;