Closed CALL-ME-OLIVIA closed 1 week ago
1.优点,可以知道循环次数,用以进位
while (n >= 60)//110 { hour++;//12 n -= 60;//50 } if ((n + minute) >= 60)//70 { hour++;//13 minute = n + minute - 60;//10 }
2.优点,更快,无需循环 offest %= 26;
offest %= 26;
if (offest >= 0) { str[i] = (str[i] - 'a' + offest) % 26 + 'a'; } else { str[i] = (str[i] - 'a' + offest+26 ) % 26 + 'a'; }``
1.优点,可以知道循环次数,用以进位
2.优点,更快,无需循环
offest %= 26;
if (offest >= 0) { str[i] = (str[i] - 'a' + offest) % 26 + 'a'; } else { str[i] = (str[i] - 'a' + offest+26 ) % 26 + 'a'; }``