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;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] a = new int[4] {4, 6, 7, 3};//В фигурных скобках можно поменять значения для новых массивов
- int[] b = new int[4] {5, 8, 9, 0};
- int[] c = new int[4];
- int[] d = new int[4];
- for (int i = 0; i < 4; i++)
- {
- c[i] = a[i] + b[i];
- d[i] = a[i] - b[i];
- }
- Console.Write("Сумма массивов равна:");
- for (int i = 0; i < 4; i++)
- {
- Console.Write("{0} ", c[i]);
- }
- Console.WriteLine();
- Console.Write("Разность массивов равна:");
- for (int i = 0; i < 4; i++)
- {
- Console.Write("{0} ", d[i]);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement