AC 包对的信我

ppz  •  4天前


include

using namespace std;

int main() {

long long n, k;
cin >> n >> k;
long long ans = 0, x = n;
while (k-- && x) {
	int c = x % 10;
	x /= 10;
	ans = c;
}
if (x == 0 && k != 0) {
	x = n;
	while (k-- && x) {
		int c = x % 10;
		x /= 10;
		ans = c;
	}
}
cout << ans;
return 0;

}


评论:

请先登录,才能进行评论