Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int siteIndex(const QString& site)
- {
- static const int max_storey = 100000;
- if (site == "Обвязка") return 0;
- if (site.startsWith("Перекрытие ")) {
- bool ok;
- int n = site.mid(11).toInt(&ok);
- if (ok && n <= max_storey) return n * 2 - 1;
- }
- if (site.endsWith(" этаж")) {
- bool ok;
- int n = site.left(site.size() - 5).toInt(&ok);
- if (ok && n <= max_storey) return n * 2;
- }
- if (site == "Чердак") return INT_MAX - 2;
- if (site == "Кровля") return INT_MAX - 1;
- return INT_MAX;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement