import java.util.Random;
public int numGen(int keta){
int tmp=0;
for(int i=0 ; i<keta ; i++){
if(keta>=2){
tmp *= 10;
}
Random rnd = new Random();
tmp += rnd.nextInt(10);
if(tmp == 0){
i--;
}
}
return tmp;
}
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme