Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Test
- fun nahojdenieCheacSumm(){
- val mass = arrayOf(3, 1, 4, 1, 5, 9)
- var result = 0
- val seed = 113
- val limit = 10000007
- for (i in 0..mass.lastIndex){
- result = (result + i) * seed
- if (result > limit){
- result = (result + i) * seed
- result %= limit
- }
- }
- print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement