2 条题解

  • 0
    @ 2026-8-12 20:32:18

    #include #include using namespace std; int main(){ string s; cin>>s; reverse(s.begin(),s.end()); cout<<s<<'\n'; }

    • -1
      @ 2026-10-8 10:57:49

      666,别告诉别人,害怕被骂喵; 没学过reverse怎么办? 我有一招;

      #include <bits/stdc++.h>
      using namespace std;
      int main() {
          ios::sync_with_stdio(false);
          cin.tie(nullptr);
      	string a;
      	getline (cin , a);
      	int i = 0;
      	int j = a.size() - 1;
      	while ( i <= j ){
      		swap(a[i],a[j]);
      		i++;
      		j--;
      	}
      	cout << a;
          return 0;
      }
      
      
      • 1

      信息

      ID
      381
      时间
      1000ms
      内存
      256MiB
      题目 Rating
      900
      标签
      递交数
      129
      已通过
      80
      上传者