![]() |
#2
haitao99992009-10-05 18:56
|

#include <iostream>
#include <string.h>
using namespace std;
void sValue(char szA);
int main()
{
char szValue[10]={0};
cin >> szValue;
sValue(szValue);
return 0;
}
void sValue(char szA)
{
char arrValue[] = "abcdefg";
char *pA = arrValue;
int iInfo = strlen(arrValue)-1;
for (int i = iInfo; i>=0; i--)
{
cout << *(pA + i);
}
cout << szA << endl;
}
#include <string.h>
using namespace std;
void sValue(char szA);
int main()
{
char szValue[10]={0};
cin >> szValue;
sValue(szValue);
return 0;
}
void sValue(char szA)
{
char arrValue[] = "abcdefg";
char *pA = arrValue;
int iInfo = strlen(arrValue)-1;
for (int i = iInfo; i>=0; i--)
{
cout << *(pA + i);
}
cout << szA << endl;
}
这段代码的功能是将输入的字符串按反方向输出,但是现在出错了,找了一上午也没找出原因,请大家帮忙指正。