Skip to content

C/C++·的翻转文字列 #6

@xinxin0430

Description

@xinxin0430
#include<iostream>
#include<string>
using namespace std;

int main()
{
	string str("");
	string newStr("");
	cout << "input your message :";
	cin >> str;
	for (int i = (str.length() - 1); i >= 0; i--) {
		newStr += str[i];
	}
	cout << newStr << endl;
	cin.ignore(6);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions