Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. for (int i = 0; i < noce; i++) {
  2. cena += 180;
  3. }
  4.  
  5. to nie jest to samo co:
  6.  
  7. cena += 180*noce; ?
  8.  
  9. takich pętli for się używa jak musisz coś iterować, np:
  10.  
  11. for (int i = 0; i < noce; i++) {
  12. cena += (180 - i*2);
  13. }
  14.  
  15. jak chcesz zrobić np żeby każda kolejna noc była tańsza, a jak nie to po prostu:
  16. cena += 180*noce;
  17.  
  18. :-)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement