• MineBBS 第一期星光推广计划开始了!丰富的金粒奖励,还有现金大奖噢~【点我去看看】
1011字符逆序-c++

Source Code 1011字符逆序-c++ 2023-08-27

Source of resources
Original
Copyright link
#
Language
Chinese(Simplified)
Precondition
vsc等等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;
}
Author
Binary
Price
1金粒
Downloads
0
Views
284
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Binary

Share this resource