import java.util.*;
/*已知某个班有M个学生,学习N个课程,已知所有学生的各科成绩。请编写程序:分别计算每个学生的平均成绩,并输出。
*/
public class no1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int M = 3;
int N = 2;
Scanner scanner = new Scanner(System.in);
int[][]score = new int[M][N];
for (int i = 0;i < M;i++)
{
for(int i = 0;j < N;j++)
score[i][j] = scanner.nextInt();
}
double[] scoreAver = new double[M];
for (int i = 0;i < M;i++)
{
double sum = 0;
for (int j = 0;j <= N;j++)
{
sum += score[i][j];
}
scoreAver[i] = sum/N;
}
for(int i = 0;i < M;i++)
{
System.out.println(scoreAver[i]);
}
}
}
//利用递归法求5!
public class no2 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(Digui(5));
}
public static int Digui(int n){
if(n==1){
return 1;
}else{
return Digui(n - 1) * n;
}
}
}
//有一分数数列:2/1,3/2,5/3,8/5,13/8,21/13…求出这个数列的前二十项和。
public class no3 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int n,t,number = 20;
double a = 2;
double b = 1;
double s = 0;
for(n = 1;n <= number;n++)
{
s = s + a/b;
t = (int)a;
a = a + b;
b = t;
}
System.out.println(s);
}
}