笔记
#include <cstdio>
int main()
{
char str[101];
fgets(str, 101, stdin);
int cnt = 0;
for (int i = 0; str[i] && str[i] != '\n'; i ++)
{
if (str[i] >= 48 && str[i] <= 57) cnt ++;
// 48 == '0' 58 == '9'
}
printf("%d\n", cnt);
return 0;
}
str[i] && str[i] != ‘\n’
这是什么意思a?