Editorial for Соңғы цифра


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Hint 1.

Санның соңғы цифры ондық жүйеде оның ең оң жақтағы цифры болып табылады.

Hint 2.

Санды 10-ға бөлгенде, бөлінді толық ондықтарды, ал қалдық соңғы цифрды береді.

Hint 3.

Сондықтан соңғы цифрды табу үшін 10-ға бөлгендегі қалдықты қарастыру жеткілікті:
\(n \bmod 10\)