why

wchzh objection 2024-08-11 16:11:22 3

#include <bits/stdc++.h> using namespace std; int main() { int i, nu, t; int m = 1, n; scanf("%d", &n); for (i = m; i <= n; i++) { if (i % 3 == 0) { t = i; while (t != 0) { nu = t % 10; if (nu == 5) { printf("%d", i); break; } } } } }

{{ vote && vote.total.up }}

共 2 条回复

root 站长
while (t != 0) {
                nu = t % 10;
                if (nu == 5) {
                    printf("%d", i);
                    break;
                }
            }

这个while循环应该要把 t的值除以10 吧

root 站长

以换行隔开 注意读题