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

相关推荐

04-17 10:16
门头沟学院 Java
小浪_coder:24届很难找了,马上25的都毕业了还有很多没找到的
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务