#include <stdio.h>
#include <string>
#include <memory.h>
int size;
void sort(char *string)
{
char temp;
for (int i = 0; i < 10; i++)
{
if ((string[i] >= 'A') && (string[i] <= 'Z'))
{
printf("找到位置%d大写字母\n", i);
temp = string[i];
for (int j = i; j < 9; j++)
{
printf("temp值%s\n", &temp);
string[j ] = string[j+1];
}
string[9] = temp;
}
}
}
int main()
{
char arr[] = "Hello-Word";
size = strlen(arr);
sort(arr);
printf("字符串长度%d\n", size);
printf("%s\n", arr);
}
大写字母后移
最新推荐文章于 2023-09-11 16:29:27 发布