Advertisement
IvetValcheva

03. Combinations

Mar 16th, 2024
459
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.36 KB | None | 0 0
  1.  
  2. int n = int.Parse(Console.ReadLine());
  3. int count = 0;
  4.  
  5. for (int x1 = 0; x1 <= n; x1++)
  6. {
  7.     for (int x2 = 0; x2 <= n; x2++)
  8.     {
  9.         for (int x3 = 0; x3 <= n; x3++)
  10.         {
  11.             int sum = x1 + x2 + x3;
  12.  
  13.             if (sum == n)
  14.             {
  15.                 count++;
  16.             }
  17.         }
  18.     }
  19. }
  20.  
  21. Console.WriteLine(count);
  22.  
Advertisement
Comments
  • davtours
    83 days (edited)
    # text 1.06 KB | 0 0
    1. How do you get to Volcanoes National Park Rwanda?
    2. Tour Operator: Dav Safaris Website: www.davsafaris.com Email: info@davsafaris.com Tel: +256701412430 | +256757795781
    3. How do you get to Volcanoes National Park Rwanda?
    4. How do you get to Volcanoes National Park Rwanda? To get to Volcanoes National Park (one of the best places to see gorillas in Africa) for Rwanda safaris, visitors can choose between road and air transport options. The road journey from Kigali covers approximately 116 kilometers and typically takes 2-3 hours, passing through the vibrant city of Kigali and offering scenic views of the Rwandan countryside with its local villages, rolling hills, and lush greenery. On the other hand, travelers can opt for a quicker air transport option, with a flight from Kigali International Airport to the nearest airstrip to the park in Ruhengeri taking around 30-40 minutes. From the airstrip, ground transportation can be arranged to reach the park entrance or accommodations nearby.
    5. https://davsafarisuganda.blogspot.com/2024/03/blog-post.html
    6. #Gorillatrekking
    7.  
Add Comment
Please, Sign In to add comment
Advertisement