package practise;
import java.util.Scanner;
public class no2_2
{
public static void main(String[] args)
{
int[] a = null;
int[] b = null;
boolean k = true;
int i = 0;
System.out.println("请输入数组:");
//Scanner input = new Scanner(System.in);
while(k)
{
Scanner input = new Scanner(System.in);
if(input.hasNextInt())
{
a[i] = input.nextInt(); //报错位置
i++;
}
else
break;
}
for(i = 0; i < a.length; i++)
{
b[i]=a[i]*a[i];
System.out.print(b[i] + " ");
}
}
}