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]);
  }

http://img.mukewang.com/58b02f370001c27d12480879.jpg

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

按照自己的节奏前行

删掉for循环的第一个输出

慕瓜9220888

AFUUKPJDTLRKGGKLRFEIZQFJGULJEULEEFWGAVRUMQUPADLLEXAYLIXBPSRYQEETPVBQHQXLBSYNTEOGXNIEHOOZNQBWQPCMQXDPNWSAEVFGEZVKQXRJKCAAJVFQQRBVVAWKDELDBUGZAUOIMBHRRVZKSNOAQZCDKLSPVBKKLPPOJFIXLLKHITMPSCCTETJJPISZZASUJSOHROLXOYNPKJMNNBHGWQGXRHMSJFJQRHOSLRAEFIOEPIOUYCTNDYUAZUQQBWNMIBSFBSUPBQAHKICXZZNGRILCPDPFUIURYECOXKEBFZNYUAKKHFMQXQBBWXOEXSXTDTEWAMNGCBISGBLWPIUEYVQEZSRRIKWNESOXMXVZQOZQWTJNXUFWNJPFSGXDLNTZJTLJQBRIUVJNTUPPUXLLWAEVVPFLFTWLAMFLCEYYNIHXNHOLEDUQZGEOFWHCFUXLVNKKBXXAKCOFAMZSSGNRLUCVRWNHYLMHEQQKXLZSACCLUUEZNBKXGWRRYRDGMBCNXRIOEKZWXXOBMZYHEAAIPURONYCPZIVWQTDEUBBMIMVFCARSZZLUWUOUSRUHQXSZHAFHXGNAHYGBJMTXESCOPBEDKTTXNCRQTYMMNSXGWLSCQKWVBABMTXCQLYQWTACWECSOXRIIDKLUGPAIZDNIONQHBFMEJPREISJJQ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