50,523
社区成员
发帖
与我相关
我的任务
分享
jQuery(function(){
// keyup event
$('#TextValue1').on('keyup', function() {
console.log('.on(keyup) = ' + $(this).val());
});
$('#TextValue1').keyup(function() {
console.log('.keyup = ' + $(this).val());
});
// change event
$('#TextValue1').on('change', function() {
console.log('.on(change) = ' + $(this).val());
});
$('#TextValue1').change(function() {
console.log('.change = ' + $(this).val());
});
});
public class Test {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String temp = null;
System.out.println("请输入数字(1至5):");
while(true){
temp = scanner.next();
if(temp.length() > 1 || !Character.isDigit(temp.charAt(0)) ||
(Integer.valueOf(temp) > 5 || Integer.valueOf(temp) < 1))
System.out.println("输入不合法,请重新输入!");
else
break;
}
scanner.close();
int input = Integer.valueOf(temp);
System.out.println(input);
}
}