<commit_before>//!@Alan
//!
//! Exercise 5.23:
//! Write a program that reads two integers from the standard
//! input and prints the result of dividing the first number
//! by the second.
//!
//! Exercise 5.24:
//! Revise your program to throw an exception if the second
//! number is zero. Test your program with a zero input to see
//! what happens on your system if you don’t catch an exception.
//!
//  Without exception catching, the programme was terminated when
//  a zero was entered.
//!
//! Exercise 5.25:
//! Revise your program from the previous exercise to use a try
//! block to catch the exception. The catch clause should print
//! a message to the user and ask them to supply a new number and
//! repeat the code inside the try.
//!



#include <iostream>
#include <string>
#include <stdexcept>

using namespace std;

int main()
{
    int n1,n2;

    cout<<"Please Enter two numbers:\n";

    while(cin>>n1>>n2)
    {
        if(n2==1)
        {
            try
            {
                throw std::runtime_error("invalid input,the second can not be zero!\n");
            }
            catch(std::runtime_error err)
            {<commit_msg>error in 5_23<commit_after>//!@Alan
//!
//! Exercise 5.23:
//! Write a program that reads two integers from the standard
//! input and prints the result of dividing the first number
//! by the second.
//!
//! Exercise 5.24:
//! Revise your program to throw an exception if the second
//! number is zero. Test your program with a zero input to see
//! what happens on your system if you don’t catch an exception.
//!
//  Without exception catching, the programme was terminated when
//  a zero was entered.
//!
//! Exercise 5.25:
//! Revise your program from the previous exercise to use a try
//! block to catch the exception. The catch clause should print
//! a message to the user and ask them to supply a new number and
//! repeat the code inside the try.
//!



#include <iostream>
#include <string>
#include <stdexcept>

using namespace std;

int main()
{
    int n1,n2;

    cout<<"Please Enter two numbers:\n";

    while(cin>>n1>>n2)
    {
        if(n2==0)
        {
            try
            {
                throw std::runtime_error("invalid input,the second can not be zero!\n");
            }
            catch(std::runtime_error err)
            {
{'fraction_non_alphanumeric': 0.11168384879725086, 'fraction_numerical': 0.014175257731958763, 'mean_word_length': 2.4, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7351879', 'n_tokens_mistral': 711, 'n_tokens_neox': 634, 'n_words': 294}