[shkola] Dwe hubawi zadachki
- From: Ivaylo Riskov <ivaylo_riskov@xxxxxxx>
- To: shkola@xxxxxxxxxxxxx
- Date: Thu, 13 Feb 2003 02:53:00 +0200
Eto wi dwe hubawi zadachi, koito reshawah naskoro:
Mislq che imah nqkxde i testowe, taka che zhelaeshtite mogat da mi
prashtat i resheniq.
Ivo
==========
1. Po dadeno chislo n (1 <= n <= 2*10^9) da se opredeli poslednata cifra
na sumata: S = 1^1 + 2^2 + 3^3 + ... + n^n
Primer:
pri n = 1 poslednata cifra na S e 1
pri n = 2 poslednata cifra na S e 5
pri n = 3 poslednata cifra na S e 2
2. Kogato chast ot cifrite w edno wqrno chislowo rawenstwo zamenim sxs
zwezdichki se poluchawa rebus. Napr. 9334 + 789 = 10123 =>
*3*4 + 78* = 101*3
Napishete programa, koqto reshawa daden rebus.
Pxrwite dwa whodni reda sxdxrzhat sxbiraemite, a tretiqt red sxdxrzha
sbora(uchstawat zwezdichki i cifri). Izhodniqt fail sxdxrzha nqkoe ot
resheniqta na rebusa(wxw sxshtiqt format) ili "NO SOLUTION", kogato
rebusxt nqma nito edno reshenie. Dxlzhinata na whodnite string-owe e ne
poweche ot 20 znaka.
Primer:
INPUT
*3*4
78*
10123
OUTPUT
9334
789
10123
INPUT
55
**
22
OUTPUT
NO SOLUTION
--
Ivaylo Riskov <ivaylo_riskov@xxxxxxx>
"Do not take life too seriously; you will never get out of it alive."
Other related posts:
- » [shkola] Dwe hubawi zadachki