Guest User

Untitled

a guest
Aug 24th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 KB | None | 0 0
  1. static int[] values = new int[2];
  2.  
  3. public static int[] getValue()
  4.         {
  5.             bool tryAgain;
  6.  
  7.             do
  8.             {
  9.                 string line = Console.ReadLine();
  10.                 string[] svals = line.Split(new char[] { ':' });
  11.                 tryAgain = false;
  12.  
  13.                 for (int i = 0; i <= values.Length; i++)
  14.                 {
  15.                     try
  16.                     {
  17.                         values[i] = Int16.Parse(svals[i]);
  18.                     }
  19.                     catch { continue; }
  20.                 }
  21.              
  22.             } while (tryAgain);
  23.             return values;
  24.         }
  25.  
  26. public int conversion1()
  27.         {
  28.             int score= values[0];
  29.             int book= values[1]
  30.            
  31.             //reszta programu      
  32.         }
Advertisement
Add Comment
Please, Sign In to add comment