Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CSThree
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Type how many flights have you been to?");
- int Flights = int.Parse(Console.ReadLine());
- int Tickets=0, Leftover=0;
- int Distance = 0;
- for (int i = 1; i <= Flights; ++i)
- {
- Console.WriteLine("Type the distance of your {0} flight in km", i);
- int SpecDist = int.Parse(Console.ReadLine());
- Distance = SpecDist + Distance;
- Tickets = Distance / 3000;
- Leftover = Distance % 3000;
- }
- Console.WriteLine("You're eligible for " + Tickets + " flights to Honolulu, and you have accumulated {0}/3000 km for another flight.", Leftover);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment