文章

10

粉丝

0

获赞

12

访问

573

头像
字符串翻转 题解:c++
P1006 贵州大学机试题
发布于2026年1月23日 13:31
阅读数 52

#include<stdio.h>
#include <iostream>
#include<math.h>
#include <stdlib.h>
#include <string>
#include<cctype>
#include<algorithm>
using namespace std;

int main ()
{    
    string str;
    getline(cin,str);
    for( int i=0, j=str.size()-1;i<j;i++,j--)
    {
            char temp;
            temp=str[i];
            str[i]=str[j];
            str[j]=temp;
    }
    cout<<str<<endl;
   // system("pause");
    return 0;
}

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发