C++ 编程题:求整数的十位数
#include 
int main() { int n; cin >> n; // 将n除以10取整再除以10取余,即可得到十位数 int ten = (n / 10) % 10; cout << ten << endl; return 0; }
原文地址: https://www.cveoy.top/t/topic/dkwb 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
#include 
int main() { int n; cin >> n; // 将n除以10取整再除以10取余,即可得到十位数 int ten = (n / 10) % 10; cout << ten << endl; return 0; }
原文地址: https://www.cveoy.top/t/topic/dkwb 著作权归作者所有。请勿转载和采集!