这是代码:
#include <iostream>
using namespace std;
int main ()
{
int n;
cin >> n;
int first = n;
while (first>=10)
{
first/=10;
}
cout << first << endl;
}
Run Code Online (Sandbox Code Playgroud)
在上面的代码中,我试图获得正数的第一个数字,我想要做的是将它放在最后一个数字之后,例如:
1934 -> 9341.
c++ ×1