解题思路:
注意事项:........粘贴不过来手打代码又一遍。。。。。
参考代码:
import java.util.Scanner;
public class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
int a=0;
while(sc.hasNext()){
int n=sc.nextInt();
if(n<0){
System.out.println(n+"-->"+"-"+Integer.toBinaryString(Math.abs(n));
}
else
System.out.println(n+"-->"+Integer.toBinaryString(n));
a++;
if(a>50||n<-Math.pow(2,16)||n>Math.pow(2,16)){
break;
}
}
}
}
0.0分
1 人评分
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:746 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:451 |
C语言程序设计教程(第三版)课后习题6.6 (C语言代码)浏览:624 |
简单的a+b (C语言代码)浏览:597 |
C语言程序设计教程(第三版)课后习题10.4 (C语言代码)浏览:535 |
【计算两点间的距离】 (C语言代码)浏览:1473 |
母牛的故事 (C语言代码)浏览:1427 |
C二级辅导-同因查找 (C语言代码)浏览:563 |
永远的丰碑 (C语言代码)浏览:516 |
字符串比较 (C语言代码)浏览:680 |