Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Finding the first digit of a number
//g++ 5.4.0 #include <iostream> using namespace std; int main() { int x; int res = 0; cin >> x; while(x > 0) { res = x % 10; // finding the first digit of a number x /= 10; } cout << res; }
run
|
edit
|
history
|
help
2
VecScalMultiOpLaod
Hacher Cup
Sorting sort function stl in c++
День Программиста
SOS DP
pbds
pi with cmath
MatrixVectorConversion
C++ Test
unordered_map