Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication21
  8. {
  9. class Res
  10. {
  11. private int n;
  12.  
  13. public void GetArg(int a)
  14. {
  15. if (a > 100) n = 100;
  16. this.n = a;
  17. PrintArg(n);
  18. }
  19.  
  20. public void PrintArg(int n)
  21. {
  22. Console.Write("\nЗначение: " + n);
  23. Console.ReadKey();
  24. }
  25. }
  26.  
  27.  
  28. class Program
  29. {
  30. static void Main(string[] args)
  31. {
  32. int a;
  33. Res obj = new Res();
  34.  
  35. Console.WriteLine("Введите число:");
  36. a = Convert.ToInt32(Console.Read());
  37. obj.GetArg(a);
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement