sergezhu

Untitled

Mar 30th, 2023
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. var yearSuffix1 = "лет";
  2. var yearSuffix2 = "год";
  3. var yearSuffix3 = "года";
  4.  
  5. bool isYearSuffixIsFirst = remainderOfDivisionBy10 == tenDividerThresholdLow ||
  6.                            remainderOfDivisionBy10 > tenDividerThresholdHigh ||
  7.                            (remainderOfDivisionBy100 >= hundredDividerThresholdLow &&
  8.                             remainderOfDivisionBy100 <= hundredDividerThresholdHigh);
  9.  
  10. string yearSuffix = isYearSuffixIsFirst
  11.     ? yearSuffix1
  12.     : remainderOfDivisionBy10 == 1
  13.         ? yearSuffix2
  14.         : yearSuffix3;
Add Comment
Please, Sign In to add comment