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); } } }
点赞

相关推荐

05-21 15:47
门头沟学院 Java
浪漫主义的虹夏:项目有亮点吗,第一个不是纯玩具项目吗,项目亮点里类似ThreadLocal,Redis储存说难听点是花几十分钟绝大部分人都能学会,第二个轮子项目也没体现出设计和技术,想实习先沉淀,好高骛远的自嗨只会害了自己
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务