最简单的题目都写了很久,基础好差啊,加油吧~~~
题目:
Write a function that takes a string as input and returns the string reversed.
Example:
Given s = "hello", return "olleh".
char* reverseString(char* s) {
int len=strlen(s);
char temp;
for(int i=0;i<len/2;i++){
temp=s[i];
s[i]=s[len-1-i];
s[len-1-i]=temp;
}
return s;
}