• 周年纪念勋章活动已圆满结束,如有已购买但仍未申请的用户,可以通过对应勋章的下载链接申请~
1011字符逆序-c++

资源 1011字符逆序-c++ 2023-08-27

Binary

悠然国际管理

搬运工
组长
正式会员
注册
2021/04/18
消息
230
金粒
4,937金粒
Binary 提交新资源:

1011字符逆序-c++ - 纯纯分享,自学c++,源码在概述!

C++:
#include<iostream>
#include<string.h>
#include <string>
using namespace std;
int main()
{
    char w[100];
    cin.getline(w,100);//输入一整行包括空格
    //置换
    int start = 0;
    int end = strlen(w)-1;


    for (int temp;start<=end;)
    {
        temp = w[start];
        w[start] = w[end];
        w[end] = temp;
        start++; end--;
    }


    //输出
    int i = 0;
    for (; i < strlen(w); i++)
    {
        cout << w[i];
    }


    return 0;
}

阅读关于此资源更多信息...
 

在线会员

  • Tian_Dog
  • ye1115660
  • 星界狮
  • eternal36900
  • zcl
  • 黄泉
  • 手动滑稽
  • 王聪聪
  • 尘帝阁空岛
  • Navy36393
  • FortyTwo
  • EpochOffice
  • 问就是玩不懂
  • yegeg
  • 1760747124
  • jodyhuang
  • ewsk
  • 2801326928
  • MrXiaoM
  • 我来诠释手法
  • polang
...和 46 更多。
后退
顶部 底部