杭电oj 2025 C语言


#include

void main()
{
	char ch[100]="0", max;
	int i;
	while (~scanf_s("%s", ch, sizeof(ch)))
	{
		max = '\0';
		i = 0;
		while (ch[i])
			if (ch[i++] > max)max = ch[i-1];
		i = 0;
		while (ch[i])
		{
			if (ch[i] == max)printf("%c(max)", ch[i++]);
			else printf("%c", ch[i++]);
		}
		printf("\n");
	}
}

你可能感兴趣的:(c语言,算法,数据结构)