You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
4.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{
"50598": {
"describe": "本关任务:统计一个字符串中字符个数(不含空格)。\n可以使用充分利用字符串自带的函数进行操作以便简化程序的编写。",
"require": "根据提示,在右侧编辑器##########begin######和#######end######之间补全代码请不要在此区间使用print语句。不要修改区间外面的代码。",
"code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Sep 7 15:23:19 2020\n\n@author: hyr\n拼接统计字数将空格改为换行查找子串\n\"\"\"\n\nsongs=input()#仅包含空格和中文\n\n\n##############begin###########\n#1. songs中存放的字符串仅包含空格和中文请统计字符串变量\nsongs中中文字的数量直接将统计结果输出\ncount = 0\nfor char in songs:\n if char != ' ':\n count+=1\nprint(count)\n\n\n\n\n#############end##############",
"verified": false,
"last_modified": "2023-12-05 15:44:02"
},
"50599": {
"describe": "本关任务:将字符串中的空格替换为换行。",
"require": "根据提示,在右侧编辑器##########begin#########和##########end##########之间补充代码请不要在该区间使用print语句。其他区域的语句不要改动。",
"code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Sep 7 15:23:19 2020\n\n@author: hyr\n拼接统计字数将空格改为换行查找子串\n\"\"\"\n\nsongs=input()#歌曲歌词,仅包含空格和中文\ntitle=input()#歌曲标题\n\n\n\n##############begin###########\n#1. 将songs中的空格改为换行。注意首尾空格应去掉不用替换成\n换行符连续的空格仅替换为一个换行符\n\n\n\n\n\n#2. 将title作为歌曲的首行显示输出整首歌曲\n\n",
"verified": false,
"last_modified": "2023-12-05 15:44:06"
},
"50601": {
"describe": "本关任务:统计字符串中文字出现的次数。",
"require": "根据提示,在右侧编辑器############begin#########和###########end##########区间补充代码",
"code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Sep 7 15:23:19 2020\n\n@author: hyr\n拼接统计字数将空格改为换行查找子串\n\"\"\"\n\nsongs=input()#仅包含空格和中文字\n\n\n\n################begin#############\n#1. 输出songs中出现最多的一个中文字并输出该字出现次数。\n#注意:如果有多个字出现次数相同,请以原文本中最先出现的那个\n为准。\n\n\n\n\n\n################end#############\n\n",
"verified": false,
"last_modified": "2023-12-05 15:44:10"
},
"50608": {
"describe": "本关任务:将歌曲以最长的那一行为标准,其它行居中对齐左补句号输出。\n例如\n。。。等风雨经过\n。。。等我们相见\n。。你微笑仰望着天\n。。我们一起种下心愿\n。。等花开等它实现\n该流的泪还是滑过你的脸\n。。我始终在你身边\n。。说好要一起走很远\n。。努力让未来鲜艳\n。在爱面前需要什么字眼\n。对你的承诺我一定实现\n真正的爱不需要有太多语言\n。有些感动就放在心里面\n。在爱面前需要什么字眼\n。付出的瞬间也就是永远\n每天离希望又再靠近了一点\n。守护家园是最美画面\n。。。我们为爱奉献\n。。。。为梦改变",
"require": "根据提示,在右侧编辑器##########begin##############和##########end#############区间补充代码。",
"code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Sep 7 15:23:19 2020\n\n@author: hyr\n拼接统计字数将空格改为换行查找子串\n\"\"\"\n\nsongs=input()#仅含空格和中文的歌词字符串\n\n\n######begin################## \n#1. 将songs按空格分割成一个字符串列表\n#提示可用字符串的split函数\n\n\n\n\n\n#######end##################\n\n\n#############begin####################\n#2. 以上面的字符串列表为基础,找出最长的那一个字符串,以它为",
"verified": false,
"last_modified": "2023-12-05 15:44:14"
}
}