Данный отчёт сгенерирован 04.04.2023 06:21:13 UTC.
HTML версия (этот сайт) сгенерирован 04.04.2023 06:21:31 UTC.
Коммит: [bfeb65b9] add automatic zip creation
04.04.2023 06:21:13
Задача: Два типи винятків 04.04.2023 06:21:13
Описание: Є статичний метод void M(), виклик якого може викидати винятки Exception та ArgumentException. Оголосити статичний метод int M1(), який викликає метод М() і повертає 1, якщо метод M() викине ArgumentException, повертає 2, якщо метод M() викине Exception, і повертає 0, якщо метод M() нічого не викине. 04.04.2023 06:21:13
Решений: 27 04.04.2023 06:21:13
Два типи винятків 04.04.2023 06:21:13
 static int M1()
{
    try
    {
        M();
    }
    catch (ArgumentException e)
    {
        return 1;
    }
    catch (Exception e)
    {
        return 2;
    }

    return 0;
}
 static int M1()
{
try
{
        M();
    }
catch (ArgumentException)
{
        return 2;
}
    catch (Exception)
    {
        return 1;
    }

    return 0;
}
 static int M1() {
    try{
        M();
        return 0;
    }
    catch(ArgumentException ex){
        return 1;
    }
    catch(Exception ex){
        return 2;
    }
    
}
 static int M1() {
    try
    {
        M();
    }
    catch(ArgumentException e)
    {
        return 1;    
    }
    catch(Exception e)
    {
        return 2;
    }
    
    return 0;
}
 static int M1() {
    try
    {
        M();
    }
    catch(System.ArgumentException)
    {
        return 1;
    }
    catch (System.Exception)
    {
        return 2;
    }

    return 0;
}
 static int M1()
{
try
{
        M();
    }
    catch (ArgumentException)
    {
return 1;
    }
    catch (Exception)
{
return 2;

    }
    return 0;
}
 static int M1() {
    try 
    {
        M();
    }
    catch (ArgumentException e)
    {
        return 1;
    }
    catch (Exception e)
    {
        return 2;
    }
    return 0;
}
 static int M1() {
    try
    {
        M();
        return 0;
    }
    catch(ArgumentException)
    {
        return 1;
    }
    catch(Exception)
    {
        return 2;
    }
}
 static int M1() {
    try
    {
        M();
        return 1;
    }
    catch(ArgumentException)
    {
        return 2;
    }
    catch(Exception)
    {
        return 0;
    }
}
 static int M1() {
    try
{
        M();
}
catch (ArgumentException)
{
        return 1;
}
catch (Exception)
{
        return 2;
}
    return 0;
}
 static int M1()
{
    try
    {
        M();
    }
    catch (ArgumentException e)
    {
        return 1;
    }
    catch (Exception e)
    {
        return 2;
    }

    return 0;
}
 static int M1()
{
    try
    {
        M();
    }
    catch (ArgumentException)
    {
        return 1;
    }
    catch (Exception)
    {
        return 2;
    }
    return 0;
}
 static int M1() {

    try
    {
        M();
    }
    catch (ArgumentException e)
    {
        return 1;
    }
    catch (Exception e)
    {
        return 2;
    }
    
    return 0;
}
 static int M1() 
{
    try
    {
        M();
    }
    catch (ArgumentException)
    {
        return 2;
    }
    catch (Exception)
    {
        return 1;
    }
    return 0;
}
 static  int M1()
{
    try
    {
        M();
    } catch (ArgumentException ae)
    {
        return 1;
    } catch (Exception e)
    {
        return 2;
    } 
    return 0;
}
 static int M1() 
{
    try
    {
        M();
    }
    catch (ArgumentException)
    {
        return 1;
    }
    catch (Exception)
    {
        return 2;
    }

    return 0;
    
}
 static int M1() {
    try
    {
       M();
    }
    catch(ArgumentException e)
    {
        return 1;
    }
    catch(Exception e)
    {
        return 2;
    }
    return 0;
}
 static int M1() {
    try
    {
        M();
    }
    catch(ArgumentException e)
    {
        return 1;
    }
    catch(Exception e)
    {
        return 2;
    }
    
    return 0;
}
 static int M1() {
    try
    {
        M();  
    }
    catch (ArgumentException ex)
    {
        return 1;
    }
    catch (Exception ex)
    {
        return 2;
    }
    
    return 0;
}
static int M1() {
    try {
        M();
    } catch (ArgumentException) {
        return 1;
    } catch (Exception) {
        return 2;
    }
    return 0;
}
 static int M1() 
{
    try
    {
        M();
    }
    catch(ArgumentException ex)
    {
        return 1;
    }
    catch(Exception ex)
    {
        return 2;
    }
    
    return 0;
}
 static int M1() {
    try {
        M();   
    }
    catch (ArgumentException) {
        return 1;
    }
    catch (Exception) {
        return 2;
    }
    return 0;
}
 static int M1()
{
    try
    {
        M();
        return 0;
    }
    catch (ArgumentException)
    {
        return 1;
    }
    catch (Exception)
    {
        return 2;
    }
}
 static int M1()
{
    try
    {
        M();
        return 0;
    }
    catch (ArgumentException ex)
    {
        return 1;
    }

    catch (Exception ex)
    {
        return 2;
    }
    

}
 static int M1()
        {
            try
            {
                M();
                return 0;
            }
            catch(ArgumentException)
            {
                return 1;
            }
            catch(Exception ex) when (ex.GetType() == typeof(Exception))
            {
                return 2;
            }
        }
 static int M1() {
    try
{
        M();
}
catch (ArgumentException)
{
        return 1;
}
catch (Exception)
{
        return 2;
}
    return 0;
}
 static int M1()
{
    try
    {
        M();
    }
    catch (ArgumentException)
    {
        return 1;
    }
    catch (Exception)
    {
        return 2;
    }
    return 0;
}