题解 | #整数的十位#
整数的十位
https://www.nowcoder.com/practice/031db23916904f4fad72198fe491b47b
#include <iostream>
#include <string>
using namespace std;
int main() {
int a;
cin>>a;
string b = to_string(a);
cout<<b[b.length()-2];
}
// 64 位输出请用 printf("%lld")
取一个数字的某个位置的数字也可以使用string来做
查看2道真题和解析