import java.io.*; import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); while(sc.hasNext()){ String str = sc.nextLine(); str=str.substring(2); int res=0; for(int i = str.length()-1;i>=0;i--){ char c = str.charAt(i); if(c>='0' && c<='9'){ res *= 16; res += c-'0'; }else if(c>='A'&&c<='F'){ res *= 16; res += c-'A'+10; }else if(c>='a' && c<='f'){ res *= 16; res += c-'a'+10; }else{ System.out.println(res); } } System.out.println(res); } } }
点赞

相关推荐

06-13 10:15
门头沟学院 Java
想去夏威夷的大西瓜在...:我也是27届,但是我现在研一下了啥项目都没有呀咋办,哎,简历不知道咋写
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
今天 11:24
大家还是用ai改吧,我心疼得要死,就当花钱买教训吧,人家直接拿完钱就跑路了
程序员小白条:简历修改700....神奇,又不是帮你面试,咋的,简历修改从双非变92了还是没实习变成有大厂实习了
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务