猿问

for中同时出现了两个输入语句,怎么让两个一个一个的出现并且输入。

Scanner in=new Scanner(System.in);
  System.out.println("请输入学生个数:");
  int a=in.nextInt();
  String b[]=new String [a];//学生姓名
  int c[]=new int [a];//学生分数
  for(int i=0;i<a;i++){
   System.out.println("请输入第"+(i+1)+" 个学生的成绩");
   b[i]=in.nextLine();
   System.out.println("请输入第"+(i+1)+" 个学生的成绩");
   c[i]=in.nextInt();
   
  }
  System.out.println("姓名\t成绩");
  for(int i=0;i<a;i++){
   System.out.println(b[i]+"\t"+c[i]);
  }

难想啊4382540
浏览 1623回答 0
0回答

按照自己的节奏前行

删掉for循环的第一个输出

慕瓜9220888

AFUUKPJDTLRKGGKLRFEIZQFJGULJEULEEFWGAVRUMQUPADLLEXAYLIXBPSRYQEETPVBQHQXLBSYNTEOGXNIEHOOZNQBWQPCMQXDPNWSAEVFGEZVKQXRJKCAAJVFQQRBVVAWKDELDBUGZAUOIMBHRRVZKSNOAQZCDKLSPVBKKLPPOJFIXLLKHITMPSCCTETJJPISZZASUJSOHROLXOYNPKJMNNBHGWQGXRHMSJFJQRHOSLRAEFIOEPIOUYCTNDYUAZUQQBWNMIBSFBSUPBQAHKICXZZNGRILCPDPFUIURYECOXKEBFZNYUAKKHFMQXQBBWXOEXSXTDTEWAMNGCBISGBLWPIUEYVQEZSRRIKWNESOXMXVZQOZQWTJNXUFWNJPFSGXDLNTZJTLJQBRIUVJNTUPPUXLLWAEVVPFLFTWLAMFLCEYYNIHXNHOLEDUQZGEOFWHCFUXLVNKKBXXAKCOFAMZSSGNRLUCVRWNHYLMHEQQKXLZSACCLUUEZNBKXGWRRYRDGMBCNXRIOEKZWXXOBMZYHEAAIPURONYCPZIVWQTDEUBBMIMVFCARSZZLUWUOUSRUHQXSZHAFHXGNAHYGBJMTXESCOPBEDKTTXNCRQTYMMNSXGWLSCQKWVBABMTXCQLYQWTACWECSOXRIIDKLUGPAIZDNIONQHBFMEJPREISJJQJGSFWWDRSSRNAXXYOEPPLULNH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