孤鸿悬影


私信TA

用户名:Nonewilli

访问量:8082

签 名:

人生尝尝叹叹几十年,风风雨雨又多少岁月。

等  级
排  名 323
经  验 5309
参赛次数 0
文章发表 59
年  龄 0
在职情况 学生
学  校 中国石油大学
专  业 自动化

  自我简介:

了却天涯独此命,乘舟散尽也由荣。

解题思路:

注意事项:

参考代码:

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
	char f[500];
	char max,ch;
	int b,d=0,s[100],q=0;
	while(cin>>f){
	b=strlen(f);
	max=f[0];
	for(int i=0;i<b;i++){
		if(f[i]>max){
			max=f[i];
		}
	}
	for(int i=0;i<b;i++){
		if(f[q]==max){
			for(int c=b+d*5;c>q;c--){
				f[c+5]=f[c];
			}
			f[q+1]='(';
			f[q+2]='m';
			f[q+3]='a';
			f[q+4]='x';
			f[q+5]=')';
			s[d]=q;
			d++;
		}
		for(int y=0;y<100;y++){
			if(s[y]==q){
				q=q+5;
			}
		}
		q++;
	}
	for(int o=0;o<b+d*5;o++){
		printf("%c",f[o]);
	}
	printf("\n");
	memset(f, 0, sizeof f);
	d=0;
	memset(s, 0, sizeof s);
	q=0;
}
}


 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区