1. C# / Говнокод #9865

    +122

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    switch (count)
    {
    	case 2:
    		return Tuple.Create(col[1]);
    	case 3:
    		return Tuple.Create(col[1], col[2]);
    	case 4:
    		return Tuple.Create(col[1], col[2], col[3]);
    	case 5:
    		return Tuple.Create(col[1], col[2], col[3], col[4]);
    	case 6:
    		return Tuple.Create(col[1], col[2], col[3], col[4], col[5], col[6]);
    	case 8:
    		return Tuple.Create(col[1], col[2], col[3], col[4], col[5], col[6], col[7]);
    	case 9:
    		return Tuple.Create(col[1], col[2], col[3], col[4], col[5], col[6], col[7], col[7]);
    	case 10:
    		return Tuple.Create(col[1], col[2], col[3], col[4], col[5], col[6], col[7], Tuple.Create(col[8]));
    	case 11:
    		return Tuple.Create(col[1], col[2], col[3], col[4], col[5], col[6], col[7], Tuple.Create(col[8], col[9]));
    	case 12:
    		return Tuple.Create(col[1], col[2], col[3], col[4], col[5], col[6], col[7], Tuple.Create(col[8], col[9], col[10]));
    	case 13:
    		return Tuple.Create(col[1], col[2], col[3], col[4], col[5], col[6], col[7], Tuple.Create(col[8], col[9], col[10], col[11]));
    	case 14:
    		return Tuple.Create(col[1], col[2], col[3], col[4], col[5], col[6], col[7], Tuple.Create(col[8], col[9], col[10], col[11], col[12]));
    	default:
    		throw new ArgumentOutOfRangeException("count", count, "Can't convert array to tuple.");
    }

    Запостил: a553r7fa1L3d, 05 Апреля 2012

    Комментарии (15) RSS

    Добавить комментарий