Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(){
  4. int n, dice, pos = 0;
  5. scanf("%d", &n);
  6. while(n--){
  7. scanf("%d", &dice);
  8. pos = (pos + dice) % 41;
  9. switch(pos){
  10. case 12:
  11. pos = 28;
  12. break;
  13. case 30:
  14. pos = 10;
  15. break;
  16. case 35:
  17. pos = 7;
  18. break;
  19. }
  20. }
  21. printf("%d\n", pos);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement