安全问答

安全问答是一个知识全球问答,包含丰富的问答知识

首页 常规 游戏 娱乐 科技 程序员

C语言字符串反转代码示例

  • 日期: 2024-12-01
  • 标签: 常规
#include <stdio.h>
#include <string.h>

int main()
{
    char str[101];
    printf('请输入一个字符串:\n');
    scanf('%s', str);
    int len = strlen(str);
    printf('颠倒后的字符串为:');
    for (int i = len - 1; i >= 0; i--)
    {
        printf('%c', str[i]);
    }
    printf('\n');
    return 0;
}
C语言字符串反转代码示例

原文地址: https://www.cveoy.top/t/topic/oILw 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录

  • 上一篇: WPS表格库存管理:轻松记录入库、出库、结存数量
  • 下一篇: Spring Boot 配置 wwwroot 静态文件目录并默认打开 index.html

© 2019 • 2025 - 安全问答 站长邮箱:wxgpt@qq.com    ICP备案/许可证号:豫ICP备2024104334号-2