Пятничные задачки

Added by Алексей Румянцев over 9 years ago

Появилась идея давать вам маленькие задачки по шарпу, для общего развития так сказать:) Программировать ничего не надо, только подумать пару минут и дать ответ.
Если заинтересуетесь, то буду делать это регулярно.
Вообщем вот:
  1. есть такой кусок кода:
    Action action = null;
    for (int i = 0; i < 3; i++)
      action += () => Console.Write(i);

    Что будет выведено на консоль?
  2. Наверно все знают, что у нас в LinearAlgebra есть класс Vector, у него есть конструкторы Vector(int size) и Vector(params double[] data) и свойтво Size, возвращающее размерность вектора. Что будет выведено на консоль?
    Vector a = new Vector(4.0);
    Vector b = new Vector(1, 2, 3);
    Vector c = new Vector(2, 3);
    Vector d = new Vector(3);
    Console.Write("{0}{1}{2}{3}", a.Size, b.Size, c.Size, d.Size);

Ответы пишем тут в комментариях.

Replies (52)


yeezy - Added by Anonymous over 2 years ago

I and also my friends ended up checking out the nice tips and tricks on your site and the sudden developed an awful suspicion I had not expressed respect to the web site owner for those tips. All the ladies happened to be totally warmed to learn them and have now in fact been having fun with those things. Thank you for truly being quite accommodating as well as for considering this kind of nice things millions of individuals are really desperate to be aware of. My very own honest apologies for not saying thanks to earlier.
yeezy http://www.yeezy-shoes.ca


Adidas NMD Runner Black White Fixed - Added by Anonymous over 2 years ago

I wanted to post a quick remark to be able to thank you for all of the unique strategies you are placing on this website. My particularly long internet research has now been compensated with good quality suggestions to exchange with my colleagues. I would point out that many of us site visitors are very fortunate to dwell in a wonderful community with very many wonderful individuals with very helpful strategies. I feel very fortunate to have come across your web pages and look forward to plenty of more exciting minutes reading here. Thanks a lot once more for all the details.
Adidas NMD Runner Black White Fixed http://www.adidas-nmds.us.com/adidas-nmd-runner-black-white-fixed-p-473.html

1 2 3 (51-52/52)