Run Code
|
API
|
Code Wall
|
Users
|
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
1
Please
log in
to post a comment.
Dar
test111
gp series
SOS DP
CqueueArray
Lowest common ancestor
Org
¡Arriba, Papalotes, Arriba!
XD
KMP substring search
Please log in to post a comment.