/*------------------------------------------------------- 【程序填空】 --------------------------------------------------------- 题目:请编写一个函数fun,它的功能是:删除字符串中的数字字 符。例如输入字符串:48CTYP9E6,则输出:CTYPE。 -------------------------------------------------------*/ #include <stdio.h> /***********FILL***********/ void fun(_____) { char *p=s; while(*p) if((*p>='0')&&(*p<='9')) p++; else *s++=*p++; /***********FILL***********/ _____ } void main( ) { char item[100] ; printf("\nEnter a string: "); gets(item); fun(item); printf("\nThe string:\"%s\"\n",item); }
时间: 2023-08-23 16:06:32 浏览: 36
/*------------------------------------------------------- 【程序填空】 --------------------------------------------------------- 题目:请编写一个函数fun,它的功能是:删除字符串中的数字字符。例如输入字符串:48CTYP9E6,则输出:CTYPE。 -------------------------------------------------------*/ #include <stdio.h> void fun(char *s) { char *p=s; while(*p) if((*p>='0')&&(*p<='9')) p++; else *s++=*p++; *s = '\0'; } void main( ) { char item[100] ; printf("\nEnter a string: "); gets(item); fun(item); printf("\nThe string:\"%s\"\n",item); }
相关问题
pyinstaller: error: unrecognized arguments: --add-dateimages/*;video/*;music/*-F
看起来你在命令行中使用了 `--add-date` 而不是正确的 `--add-data` 参数。请将命令中的 `--add-date` 修改为 `--add-data`,并且将参数值中的 `date` 改为正确的 `data`,如下所示:
```
pyinstaller --add-data "images/*;video/*;music/*" -F your_script_name.py
```
这个命令将会把 `images`、`video` 和 `music` 文件夹中的所有文件都打包到可执行文件中。`-F` 参数表示将所有依赖项都打包到一个单独的可执行文件中。
请注意,在命令行中使用 `--add-data` 参数时,需要将参数值用双引号括起来,并在路径中使用正斜杠(`/`)而不是反斜杠(`\`),否则 Windows 可能无法正确解析路径。
我想补齐每一行对称的-代码该怎么写--* -*** ***** -*** --*
以下是补齐每一行对称的代码:
```python
n = 5
for i in range(n):
if i < n//2:
print('-'*(n//2-i) + '*'*(2*i+1) + '-'*(n//2-i))
else:
print('-'*(i-n//2) + '*'*(2*(n-i)-1) + '-'*(i-n//2))
```
输出结果为:
```
--*--
-***-
*****
-***-
--*--
```