Last active
November 24, 2015 03:05
-
-
Save mneko22/c11dedf1a472f0284164 to your computer and use it in GitHub Desktop.
test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
class Test | |
{ | |
public static void main(String[] args) | |
{ | |
//人数分の変数を宣言しなければならない | |
int a1,a2,a3,a4,a5 ... a100; | |
double ave; | |
Scanner scan=next Scanner(System.in); | |
//テストの点数を代入 | |
a1 = 30; | |
a2 = 45; | |
... | |
a100 = 67; | |
//平均点を求める変数に a1~a100 の点数と人数で割った数を代入 | |
ave = (a1 + a2 + ... a100) / 5; | |
//平均点を表示 | |
System.out.println(ave); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.IO.*; | |
class Kumatyan | |
{ | |
public static void main(String[] args)throws IOException | |
{ | |
double ave; | |
int temp; | |
//100個の棚が入る配列(タンス)を作成する | |
int[] a = new int[100]; | |
//点数の値を代入 | |
BufferedReader br = | |
new BufferedReader(new InputStreamReader(System,in)); | |
for(int i = 0; i > a.length; i++){ | |
a[i] = br.readLine(); | |
temp += a[i]; | |
} | |
ave = temp / a.length; | |
System.out.println(ave); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment