首页
比赛
题库
课程
竞赛讨论区
登录
/
注册
去牛客
首页
>
整数的十位
104条解析
开通博客写题解
云小逸0987
发表于 2022-04-28 22:30:24
描述 输入一个整数,求其十位数 输入描述: 输入一个整数,在int范围内 输出描述: 输出一个整数 思路: 了解输出个、十、百的方法 ">int main(void) { int a; scanf("%d",&a); printf("%d",a%100/10);
展开全文
张田懿
发表于 2020-12-08 17:32:39
include<bits/stdc++.h> using namespace std;int main(){ int a,c=0; cin>>a; c=a/10%10; cout<<c; return 0;}
凡夏
发表于 2021-05-04 22:53:26
c语言解法#include <stdio.h>int main (){ int a,b; scanf("%d",&a); b=a/10%10; printf("%d",b);}
每天捐款做慈善只为拿offer
发表于 2022-04-21 10:36:57
import java.util.Scanner; public class Main{ public static void main(String[]args){ Scanner in = new Scanner(System.in); String
展开全文
金龙月轩寰语唐舞麟
发表于 2020-12-26 11:43:47
#include<bits/stdc++.h> using namespace std; int main() { int a; cin>>a; cout<<a%100/10; return 0; }
老6
发表于 2022-04-22 16:23:09
#include <stdio.h> int main(){ int a; scanf("%d",&a); printf("%d",a/10%10); return 0
展开全文
HUAYI_SUN
发表于 2022-09-29 13:11:52
#include<iostream> using namespace std; int main() { int a=0; cin>>a;
展开全文
苦瓜迅
发表于 2024-04-19 21:22:06
C++一个可以用但没必要的做法: 反转字符串输出s[1],就是第十位了 代码如下: #include<bits/stdc++.h> using namespace std; string s; int main(){ cin>>s; reverse(s.begin(),s
展开全文
19oier
发表于 2020-12-01 17:30:03
可以用字符串处理。 #include<bits/stdc++.h> using namespace std; int main() { string s; getline(cin,s); int len=s.size(); cout<<s[l
展开全文
究极潜水月亮
发表于 2024-01-10 11:57:04
#include <stdio.h> int main() { int a; scanf("%d", &a); printf("%d", a/10 %10); //先将a除10消除个位0,然后再%10 r
展开全文
查看本题
查看本题讨论
相关比赛
17358-练习赛3
进入比赛
18201-2021暑假准大一生编程练习1
进入比赛
18212-2021暑假准大一生编程练习一
进入比赛
18839-牛客竞赛语法入门班顺序结构习题
进入比赛
18851-Python语言实验第一次课
进入比赛
等你来战
查看全部
2025牛客五一集训派对day5
报名截止时间:2025-05-05 17:00
牛客练习赛138
报名截止时间:2025-05-09 21:30
牛客周赛 Round 92
报名截止时间:2025-05-11 21:00
哈尔滨华德学院第十六届程序设计竞赛(同步赛)
报名截止时间:2025-05-13 20:30
牛客小白月赛116
报名截止时间:2025-05-16 21:00
牛客AI人机大战巅峰赛1
报名截止时间:2025-05-17 17:00
2025牛客暑期多校训练营1
报名截止时间:2025-07-15 17:00
扫描二维码,关注牛客
意见反馈
下载牛客APP,随时随地刷题