Advertisement
informaticage

Untitled

Jul 1st, 2020
1,234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. Taxi_amount = int ( input ( "N taxi: " ) )
  2. Taxi = []
  3.  
  4. for i in range ( 0, Taxi_amount ):
  5.     Taxi.append ( int ( input ( "Insert city: ") ) )
  6.  
  7. TaxiBest = Taxi [ 0 ]
  8. Prezzo = Taxi [ 0 ]
  9.  
  10. for i in range ( 1, len ( Taxi ) ):
  11.     # TaxiBest = minimo tra ( TaxiBest + 1 ) VS ( T [ i ] )
  12.     if  ( ( TaxiBest + 1 ) < Taxi [ i ] ):
  13.         TaxiBest = TaxiBest + 1
  14.     else:
  15.         TaxiBest = Taxi [ i ]
  16.    
  17.     Prezzo = Prezzo + TaxiBest
  18.  
  19. print ( Prezzo )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement