Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- public class Program
- {
- public static void Main()
- {
- string[] numbers = Console.ReadLine().Split(' ');
- string b;
- do
- {
- b = Console.ReadLine();
- {
- for (int i = 0; i < numbers.Length; i++)
- {
- int c = Convert.ToInt32(numbers[i]);
- {
- if (b == "add")
- {
- c++;
- }
- else if (b == "multiply")
- {
- c *= 2;
- }
- else if (b == "subtract")
- {
- c--;
- }
- }
- }
- }
- }while(b != "end");
- {
- foreach(var c in numbers)
- {
- Console.Write("{0} ", c);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement