Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.14 KB | None | 0 0
  1. namespace ConsoleApp13
  2. {
  3.     class Program
  4.     {
  5.         public static string[] nums;
  6.  
  7.         static string GetCPlusPlusSimpleCode(int mode, string[] parameters)
  8.         {
  9.            
  10.             int m = mode;
  11.             string[] p = parameters;
  12.             string ret = "";
  13.             //int a = 1;
  14.            
  15.             if (m == 1)
  16.             {
  17.                 //Две линейные функции
  18.                
  19.                 string s = String.Format("{0} {1} {2} {3} {4} {5} {6} {7}", p);
  20.                 Console.WriteLine(s);
  21.                 Console.ReadKey();
  22.             }
  23.             if (m == 2)
  24.             {
  25.                 //Сумма двух линейных функций
  26.                
  27.                 Console.WriteLine(s);
  28.                 Console.ReadKey();
  29.             }
  30.             if (m == 3)
  31.             {
  32.                 //Арифметическая прогрессия
  33.                
  34.                 Console.WriteLine(s);
  35.                 Console.ReadKey();
  36.             }
  37.             else
  38.             {
  39.                 Console.WriteLine("Неудача");
  40.                 Console.ReadKey();
  41.             }
  42.  
  43.             return ret;
  44.         }
  45.  
  46.     static string GetParametersForSimpleCode(int mode)
  47.         {
  48.             int m = mode;
  49.             string ret = "";
  50.             if (m == 1)
  51.             {
  52.                 //Две линейные функции
  53.  
  54.                 nums = new string[] { "1", "0", "<=", "100", "+", "30", "*", "2" };
  55.             }
  56.             if (m == 2)
  57.             {
  58.                 //Сумма двух линейных функций
  59.  
  60.             }
  61.             if (m == 3)
  62.             {
  63.                 //Арифметическая прогрессия
  64.  
  65.             }
  66.             else
  67.             {
  68.                 Console.WriteLine("Неудача");
  69.                 Console.ReadKey();
  70.             }
  71.             return ret;
  72.         }
  73.  
  74.  
  75.         static void Main(string[] args)
  76.         {
  77.             GetParametersForSimpleCode(1);
  78.             string a = GetCPlusPlusSimpleCode(1, nums);
  79.             Console.WriteLine(a);
  80.         }
  81.     }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement