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 ConsoleApp1
- {
- class Program
- {
- static void Main()
- {
- bool b = true;
- string input;
- int x = 0, y =0;
- int[] vs = new int[1];
- while (b)
- {
- Console.WriteLine("Введите число: ");
- input = Console.ReadLine();
- switch (input.ToLower())
- {
- case "sum":
- bool d = true;
- while (d)
- {
- for(int i = x; i<0; i--)
- {
- y += vs[i];
- }
- Console.WriteLine("Сумма чисел: " + y);
- d = false;
- }
- break;
- case "sort":
- break;
- default:
- int[] tempvs = new int[vs.Length + 1];
- for(int i=0; i <vs.Length; i++)
- {
- tempvs[i] = vs[i];
- }
- tempvs[tempvs.Length - 1] = Convert.ToInt32(input);
- tempvs = vs;
- x++;
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement