#include <iostream> using namespace std; int F(int a); int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { if (i % 3 == 0) { int b; b = 0; b=F(i); if (b == 1) { cout << i << endl; } } } } int F(int a) { for (int e = 1; e < a; e++) { int c; c = a % 10; a = a / 10; if (c == 5) { return 1; } } return 0; }
全部评论
(9) 回帖