Олимпиадный тренинг

Задача . 16


Задача

Темы:
Consider this method:
   public static String doSomething(String s)
    {
        readonly String BLANK = " "; //BLANK contains a single space
        String str = ""; //empty string
        String temp;
        for (int i = 0; i < s.Length; i++)
        {
            temp = s.Substring(i, i + 1);
            if (!(temp.Equals(BLANK)))
                str += temp;
        }
        return str;
    }

Which of the following is the most precise description of what doSomething does?
(A) It returns s unchanged.
(B) It returns s with all its blanks removed.
(C) It returns a String that is equivalent to s with all its blanks removed.
(D) It returns a String that is an exact copy of s.
(E) It returns a String that contains s.Length blanks.

time 1000 ms
memory 32 Mb
Правила оформления программ и список ошибок при автоматической проверке задач

Статистика успешных решений по компиляторам
Комментарий учителя