2023每日刷题(八)
Leetcode—2678.老人的数目
int countSeniors(char ** details, int detailsSize){
int ans = 0;
int i;
int tens = 0;
int ones = 0;
for(i = 0; i < detailsSize; i++) {
tens = ((details + i) + 11) - ‘0’;
ones = ((details + i) + 12) - ‘0’;
int age = tens * 10 + ones;
if(age > 60) {
ans++;
}
}
return ans;
}