Example3_1
2013-03-30 10:30 郭莹莹1114010807 阅读(114) 评论(0) 编辑 收藏 举报import java.util.*;
public class Example3_1{
public static void main(String args[]){
Scanner reader=new Scanner(System.in);
System.out.println("输入待移位的int型整数:");
int x=reader.nextInt();
System.out.println("输入移位量:");
int n=reader.nextInt();
System.out.println("左移位的结果:"+(x<<n));
System.out.println("右移位的结果:"+(x>>n));
}
}