{"problem":{"name":"[GESP202406 二级] 计数","description":{"content":"小杨认为自己的幸运数是正整数 $k$（注：保证 $1 \\le k\\le 9$）。小杨想知道，对于从 $1$ 到 $n$ 的所有正整数中， $k$ 出现了多少次。","description_type":"Markdown"},"platform":"Luogu","limit":{"time_limit":1000,"memory_limit":524288},"difficulty":{"LuoguStyle":"P1"},"is_remote":true,"is_sync":true,"sync_url":null,"sign":"LGB4007"},"statements":[{"statement_type":"Markdown","content":"小杨认为自己的幸运数是正整数 $k$（注：保证 $1 \\le k\\le 9$）。小杨想知道，对于从 $1$ 到 $n$ 的所有正整数中， $k$ 出现了多少次。\n\n## Input\n\n第一行包含一个正整数 $n$。\n\n第二行包含一个正整数 $k$。\n\n## Output\n\n输出从 $1$ 到 $n$ 的所有正整数中， $k$ 出现的次数。\n\n[samples]\n\n## Background\n\n对应的选择、判断题：<https://ti.luogu.com.cn/problemset/1150>\n\n## Note\n\n从 $1$ 到 $25$ 中，$2$ 出现的正整数有 $2,12,20,21,22,23,24,25$ ，一共出现了 $9$ 次。\n\n对于全部数据，保证有 $1 \\le n\\le 1000,1 \\le k\\le 9$。","is_translate":false,"language":"English"}],"meta":{"iden":"LGB4007","tags":["2024","循环结构","GESP"],"sample_group":[["25\n2","9"]],"created_at":"2026-03-03 11:09:25"}}