Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace кпур
- {
- public class cat
- {
- public int thickness=50;
- public void meow()
- {
- Console.WriteLine("Meow!");
- Console.Write("I want eat!");
- eat();
- }
- public void jump()
- {
- Console.WriteLine("Jumping \n*now hes thickness is:{0}*",thickness=thickness-5);
- }
- public void eat()
- {
- Console.WriteLine("Meow.. Thx,very tasty :3 \n*now hes thickness is:{0}*",thickness=thickness+5);
- }
- }
- class Program
- {
- public static void Main(string[] args)
- {
- cat cat=new cat();
- int a=0;
- do
- {
- Random rand=new Random();
- int t=rand.Next(1,4);
- a++;
- if (t==1) cat.jump();
- if (t==2) cat.eat();
- if (t==3) cat.meow();
- }while(a<10);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement