Blue Bridge Cup questions basic exercises from hexadecimal decimal --5 lines of code AC

note

1, do not use int, overflow,% x input,% d output on the line
2, note:% x, if lower case x, then the hexadecimal number in lowercase letters, and vice versa empathy.
3, do not be the beginning of the "input string" to deceive, I think too complicated. Our ultimate goal is to solve problems, rather than take into consideration the algorithm to show skills, so we can focus on variables related issues and the process of it .

#include<stdio.h>  
int main() {
	long long x; scanf("%x", &x); printf("%lld",x); 
	return 0;
} 
Published 57 original articles · won praise 45 · views 3735

Guess you like

Origin blog.csdn.net/weixin_43899069/article/details/104546056