/
githubmirror
/
CPlusPlusThings
Обзор
Документация
Войти
/
githubmirror
/
CPlusPlusThings
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
practical_exercises/10_day_practice/day9/exception/4.cpp
23 строки
382 B
zhangxing
support bazel complie this project and format code.
30 мар 2024, 17:00
30 мар 2024, 17:00
3c8a3f2
Код
Авторство
О чём код?
#include <iostream> using namespace std; void temperature(int t) { if (t == 100) throw "沸点!"; else if (t == 0) throw "冰点!"; else { cout << "temperatore=" << t << endl; } } int main() { try { temperature(0); // L1 temperature(10); // L2 temperature(100); // L3 } catch (char const *s) { cout << s << endl; } return 0; }