用java数组来获取输入值并输出

图片说明图片说明

请问我这有什么问题呢

数组声明有问题,int[] nums = new int[]{6};相对于声明了一个长度为1的数组,存了6这个元素。改成new int[6]