Advertisement
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 CondenseArayToNumber
- {
- class Program
- {
- static void Main()
- {
- int wagons = int.Parse(Console.ReadLine());
- int[] peopleInWagons = new int[wagons];
- int sum = 0;
- string passangers = "";
- for (int i = 0; i < wagons; i++)
- {
- int people = int.Parse(Console.ReadLine());
- peopleInWagons[i] = people;
- passangers += peopleInWagons[i] + " "; // тук е всичко, което ти бягаше!
- sum += people;
- }
- Console.WriteLine(passangers + " ");
- Console.WriteLine(sum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement