0
入力およびユーザ入力 で多次元配列に文字列を格納し、私はGoogleからの多次元配列を学んできた、学ぶことは簡単だったが、私はどんなのscenerioに実装しなければならないとき!それを扱うことは困難です。私は、ユーザー入力を使用して多次元配列を宣言し、今はテーブルでこの配列を宣言したい。どうやって?これまでのところ Javaの多次元表中の配列
import java.util.Scanner;
public class RugbyProject{
final static int RESULT_POINTS_WIN = 2;
final static int RESULT_POINTS_DRAW = 1;
final static int RESULT_POINTS_LOSS = 0;
final static int GAME_POINTS_TRY = 5;
final static int GAME_POINTS_PENALTY = 3;
final static int GAME_POINTS_DROP_GOAL = 3;
final static int GAME_POINTS_CONVERSATION = 2;
public class Stats {
// TODO Auto-generated method stub
int wins;
int draws;
int losses;
int tries;
int penalties;
int dropgoals;
int conversation;
int totalResultPoints = (wins * RESULT_POINTS_WIN) + (draws * RESULT_POINTS_DRAW) + (losses + RESULT_POINTS_LOSS) + (tries * GAME_POINTS_TRY) +
(penalties * GAME_POINTS_PENALTY) + (dropgoals * GAME_POINTS_DROP_GOAL) + (conversation * GAME_POINTS_CONVERSATION) ;
int averageScorePerMatch = (totalResultPoints/5);
}
public static void main(String args[]){
String teams[] = {"Ireland","England","Scotland","Brazil","Irelan","Romania","Germany"};
System.out.println("Welcome to the six nation ChampionShip");
for(String element : teams){
System.out.println("Enter number of wins, draws and losses for " + element);
Scanner myScanner = new Scanner(System.in);
int [] integer = new int[3];
for(int i = 0; i<3; i++){
integer[i] = myScanner.nextInt();
}
System.out.println("ENter total try count, total penalty count ," + " total dropgoal count total conversation count for " + element);
Scanner myScanner2= new Scanner(System.in);
int[] integers2 = new int[3];
for(int i=0; i<3; i++){
integers2[i] = myScanner2.nextInt();
}
}
}
}
は、私はちょうど入力を取得し、it.Iはので、私はテーブルの印刷配列に対する答えザッツプログラミング
"この配列をテーブルに宣言したい" - それはどういう意味ですか? – Rehman
テーブルにこのようなデータを印刷したい チームP W D L PtsFor/Aga Pts Diff Pts アイルランド イングランド ウェールズ フランス –