/*字符串逆置*/
#include <stdio.h>
int main(void)
{
char str[100] = "hello world";
int i = 0;
while (str[i++]);
int min = 0;
int max = i - 2;
while (min < max)
{
char tmp = str[min];
str[min] = str[max];
str[max] = tmp;
min++;
max--;
}
printf("%s\n", str);
return 0;
}
#include <stdio.h>
int main(void)
{
char str[100] = "hello world";
int i = 0;
while (str[i++]);
int min = 0;
int max = i - 2;
while (min < max)
{
char tmp = str[min];
str[min] = str[max];
str[max] = tmp;
min++;
max--;
}
printf("%s\n", str);
return 0;
}