H2330819027


私信TA

用户名:dotcpp0701405

访问量:8458

签 名:

指向函数指针数组的指针int(*(*p[4]))(int int)

等  级
排  名 127
经  验 7473
参赛次数 1
文章发表 79
年  龄 18
在职情况 学生
学  校 Hzu university
专  业 软件工程

  自我简介:

TA的其他文章

解题思路:

注意事项:

参考代码:

#include <stdio.h>
#include <string.h>

int main() {
    char ch[80];

    while (fgets(ch, sizeof(ch), stdin) != NULL) {
        int len = strlen(ch);

        for (int i = 0; i < len; i++) {
            if (ch[i] == ' ') {
                for (int j = i; j < len; j++) {
                    ch[j] = ch[j + 1];
                }
                len--; // 减少字符串长度
                i--;   // 继续检查当前位置
            }
        }

        printf("%s", ch);
    }

    return 0;
}


 

0.0分

0 人评分

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

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区