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;
- using System.Threading.Tasks;
- namespace ConsoleApplication21
- {
- class Res
- {
- private int n;
- public void GetArg(int a)
- {
- if (a > 100) n = 100;
- this.n = a;
- PrintArg(n);
- }
- public void PrintArg(int n)
- {
- Console.Write("\nЗначение: " + n);
- Console.ReadKey();
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- int a;
- Res obj = new Res();
- Console.WriteLine("Введите число:");
- a = Convert.ToInt32(Console.Read());
- obj.GetArg(a);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement