teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

classをPriceとCountに分けましたが駄目でした。

2016/01/22 11:36

投稿

coffeee
coffeee

スコア19

title CHANGED
File without changes
body CHANGED
@@ -29,10 +29,11 @@
29
29
  ```java
30
30
  class Price{
31
31
  int[] price;
32
- int[] count;
33
32
  Price(int[] p){
34
33
  price=p;
35
34
  }
35
+ class Count{
36
+ int[] count;
36
37
  Count(int[] c){
37
38
  count=c;
38
39
  }
@@ -53,7 +54,7 @@
53
54
  int[] money={150,400,200,100};
54
55
  Price p=new Price(money);
55
56
  p.getSum();
56
-
57
+
57
58
  int[] type={3,2,10,1};
58
59
  Count c=new Count(type);
59
60
  c.getNumber();