6 条题解

  • 7
    @ 2024-8-16 19:12:30
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	string s;
    	cin>>s;
    	for(int i=s.length()-1;i>=0;i--){
    		cout<<s[i]-'0';
    	}
    }
    
    • 4

      又是我,三位数,四位数,翻转数字,都是一个题解

      #include<bits/stdc++.h>
      using namespace std;
      int main(){
      	string str;
      	cin>>str;
      	reverse(str.begin(),str.end());
      	cout<<str;
      	return 0;
      }
      
      • 0
        @ 2024-1-23 13:30:23

        #include<bits/stdc++.h> using namespace std; int main() { int a,i=1,w=10,c,b=0,x=1; cin>>a; while(a) { c=a%10; b=b*10+c; a=a/10; } cout<<b; return 0; }

        • 0
          @ 2024-1-21 13:53:34

          打了20分钟,哭死

          • 0
            @ 2024-1-21 13:53:03

            #include<bits/stdc++.h> using namespace std; int main() { int a,i=1,w=10,c,b=0,x=1; cin>>a; while(a/x!=0) { x=(pow(w,i))/10; c=a/x%10; b=b*10+c; i=i+1; } cout<<b/10; return 0; }

            • 0

              不要定义int型变量 建议使用char并结合strlen函数按位转换

              • 1

              信息

              ID
              76
              时间
              1000ms
              内存
              256MiB
              难度
              1
              标签
              递交数
              74
              已通过
              53
              上传者