Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- int[] action = new int[18];
- int[] result = new int[6];
- int i, j, f, x;
- for (i = 0; i < action.Length; i++)
- {
- action[i] = int.Parse(Console.ReadLine());
- }
- for (j = 0; j < action.Length; j++)
- {
- if (j % 3 == 0)
- {
- if (action[j] == 1)
- {
- result[j / 3] = action[j + 1] + action[j + 2];
- }
- else if (action[j] == 2)
- {
- result[j / 3] = action[j + 1] - action[j + 2];
- }
- }
- }
- Console.WriteLine("");
- for (x = 0; x < action.Length; x++)
- {
- Console.Write(action[x] + " ");
- }
- Console.WriteLine("");
- for (f = 0; f < result.Length; f++)
- {
- Console.Write(result[f] + " ");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement