6 条题解

  • 1
    @ 2023-3-29 20:25:37
    #include<iostream>
    using namespace std;
    int main()
    {
        int n;
        int sum=0;
     
        cin>>n;
        if(n<0)
        {
            cout<<"-";
            n=-n;
        }
        while(n)
        {
            sum=sum*10+n%10;
            n/=10;
        }
        cout<<sum<<endl;
        return 0;
    }
    
    
    • 0

      #include<iostream> using namespace std; int main(){ int input; cin>>input; if(input0){ cout<<0; return 0; } if(input<0){ cout<<'-'; input=-input; } while(input%100){ input/=10; } while(input!=0){ cout<<input%10; input/=10; } return 0; }

      • 0
        @ 2023-5-10 18:58:27

        #include<iostream> using namespace std;

        int n,ans;

        int main() { cin>>n; if(n<0) { n=-n; cout<<"-"; } while(n!=0) { ans=ans*10+n%10; n/=10; } cout<<ans; return 0; }

        • 0
          @ 2023-3-29 20:29:00
          #include <iostream>
          #include<iomanip>
          #include <cmath>
          using namespace std;
          int n,ans;
          int main(){
          	cin >> n;
          	if ( n<0 ){
          		cout << "-";
          		n=-n;
          		
          	}
          	while ( n ){
          		int ge = n%10;
          		n/=10;
          		ans =ans *10 +ge;
          	}
          	cout <<  ans;
          	return 0;
          }
          
          ```
          
          
          
          • 0
            @ 2023-1-3 11:32:40
            #include<bits/stdc++.h>
            using namespace std;
            int main()
            {
            	int n;
            	cin>>n;
            	int tag=0;
            	while(n)
            	{
            		tag=tag*10+n%10;
            		n/=10;
            	}
            	cout<<tag;
            	return 0;
            }
            
            • -1
              @ 2022-10-18 16:39:54
              #include<iostream>
              using namespace std;
              int main()
              {
                  int n;
                  int sum=0;
               
                  cin>>n;
                  if(n<0)
                  {
                      cout<<"-";
                      n=-n;
                  }
                  while(n)
                  {
                      sum=sum*10+n%10;
                      n/=10;
                  }
                  cout<<sum<<endl;
                  return 0;
              }
              
              • 1

              信息

              ID
              714
              时间
              1000ms
              内存
              256MiB
              难度
              5
              标签
              递交数
              385
              已通过
              158
              上传者