using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void print(List name, List X, List Y, List F) { double XMax = 0; double YMax = 0; double FMax = 0; for (int i = 0; i < X.Count; i++) { if (X[i].Length > XMax) XMax = X[i].Length; if (Y[i].Length > YMax) YMax = Y[i].Length; if (F[i].Length > FMax) FMax = F[i].Length; } for (int i = 0; i < X.Count; i++) { do X[i] = X[i] + " "; while (X[i].Length == XMax); do Y[i] = Y[i] + " "; while (Y[i].Length == YMax); do F[i] = F[i] + " "; while (F[i].Length == FMax); } for (int i = 0; i < X.Count; i++) { Console.Write(F[i] + " "); Console.Write(X[i] + " "); Console.Write(Y[i] + " "); Console.WriteLine(); } } static void Main(string[] args) { int a = 0; double b = 0.9; double x = a; double h = 0.3; double y0 = 0.6; double y = y0; int i = 0; double f = 15 - 1 / 3 * y0; Console.WriteLine("F x y"); do { x = a + h * i; y = y + f * x; f = 15 - y / 3; i++; var name = new List(); name.Add("f"); name.Add("x"); name.Add("y"); var X = new List(); var Y = new List(); var F = new List(); X.Add(x.ToString()); Y.Add(y.ToString()); F.Add(f.ToString()); print(name, X, Y, F); } while (x+0.00001 < b); } } }