C++ 统计符合条件的整数个数
#include
int main() { int N; cin >> N;
int count = 0;
for (int i = 1; i <= N; i++) {
if (i % 5 == 0) {
int temp = i;
while (temp > 0) {
if (temp % 100 == 55) {
count++;
break;
}
temp /= 10;
}
}
}
cout << count << endl;
return 0;
}
原文地址: https://www.cveoy.top/t/topic/bOeA 著作权归作者所有。请勿转载和采集!