2 solutions

  • 0
    @ 2023-10-1 13:31:18
    #include<iostream>
    using namespace std;
    int main()
    {
        cin >> n;
    	if (n<0)
    	{
    		cout << "-";
    		n = -n;
    	}
    	for (; n; n/=10)
    	{
    		ans = n % 10 + ans * 10;
    		//cout << ans<<' ';
    	}
    	cout << ans;
    	return 0;
    }
    

    Information

    ID
    6755
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    8
    Tags
    (None)
    # Submissions
    370
    Accepted
    63
    Uploaded By