Chinaunix首页 | 论坛 | 博客
  • 博客访问: 253808
  • 博文数量: 170
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1709
  • 用 户 组: 普通用户
  • 注册时间: 2014-05-06 18:01
文章分类

全部博文(170)

文章存档

2016年(11)

2015年(130)

2014年(29)

分类: Java

2015-04-15 10:39:37

import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;


public class RemoveIndex {


public static void main(String[] args) {
// TODO 自动生成的方法存根
Scanner s = null;
try {
s = new Scanner(new File("F:\\输入.txt"));
} catch (FileNotFoundException e1) {
// TODO 自动生成的 catch 块
e1.printStackTrace();
}


ArrayList a =new ArrayList();

while(s.hasNext()){
a.add(s.nextInt());

}
ArrayList b =new ArrayList();
b.add(0);
for(int i=1;i<=64;i++){
b.add(i);
}
for(int i=0;i int c=b.get(a.get(i));
System.out.print(c+" ");
//(int) 非常重要,调用的是remove(i),否则调用的是remove(Element)
b.remove((int)a.get(i));

}

}


}
阅读(724) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~