這是Herr Deng桑的教學blog,主要處理作業與班導事務,另外還有數位小品。
import java.util.*;import java.io.*;public class fileRead { public static void main (String[]args) throws Exception { File f=new File("test.txt"); Scanner input=new Scanner(f); String tmp; int i=0; while (input.hasNext()) { tmp=input.next(); System.out.print(i++); System.out.print("\t"+tmp); if (input.hasNextInt()) System.out.println(); } }}
import java.util.Scanner;import java.io.*;class GAP{ public static void main(String [] args)throws Exception{ File f=new File("test.txt"); Scanner input=new Scanner(f); String tmp; int i=0; int a; int sum=0; while (input.hasNext()){ tmp=input.next(); System.out.print(i++); System.out.print("\t"+tmp); if(input.hasNextInt()) { a=input.nextInt(); System.out.print("\t"+a); sum+=a; } System.out.println(); } float b=((float)sum)/(i-1); System.out.print("平均"+b); }}
import java.util.Scanner;import java.io.*;class ab{ public static void main(String [] args)throws Exception{ File f=new File("test.txt"); Scanner input=new Scanner(f); String tmp; int i=0; int a; int sum=0; while (input.hasNext()){ tmp=input.next(); System.out.print(i++); System.out.print("\t"+tmp); if(input.hasNextInt()) { a=input.nextInt(); System.out.print("\t"+a); sum+=a; } System.out.println(); } float b=((float)sum)/(i-1); System.out.print("平均"+b); }}
import java.util.*;import java.io.*;public class fileRead { public static void main(String[] args) throws Exception { File f=new File("test.txt"); Scanner input=new Scanner(f); String tmp; int i=0; int a; float sum=0; while (input.hasNext()) { tmp=input.next(); System.out.print(i++); System.out.print("\t"+tmp); if (input.hasNextInt()) { a=input.nextInt(); System.out.print("\t"+a); sum+=a; } System.out.println(); } sum=sum/(i-1); System.out.println(); System.out.print("平均= "+sum); }}
import java.util.Scanner;import java.io.*;class dd{ public static void main(String [] args)throws Exception{ File f=new File("test.txt"); Scanner input=new Scanner(f); String tmp; int i=0; int a; float sum=0; while (input.hasNext()){ tmp=input.next(); System.out.print(i++); System.out.print("\t"+tmp); if(input.hasNextInt()) { a=input.nextInt(); System.out.print("\t"+a); sum+=a; } System.out.println(); } sum=sum/(i-1); System.out.println(); System.out.print("平均="+sum); }}
import java.util.Scanner;import java.io.*;class dd{ public static void main(String [] args)throws Exception{ File f=new File("test.txt"); Scanner input=new Scanner(f); String tmp; int i=0; int a; int sum=0; while (input.hasNext()){ tmp=input.next(); System.out.print(i++); System.out.print("\t"+tmp); if(input.hasNextInt()) { a=input.nextInt(); System.out.print("\t"+a); sum+=a; } System.out.println(); } float b=((float)sum)/(i-1); System.out.print("全班平均是:"+b); }}
import java.util.Scanner;import java.io.*;class dd{ public static void main(String [] args)throws Exception{ File f=new File("test.txt"); Scanner input=new Scanner(f); String tmp; int i=0; int a; int sum=0; while (input.hasNext()){ tmp=input.next(); System.out.print(i++); System.out.print("\t"+tmp); if(input.hasNextInt()) { a=input.nextInt(); System.out.print("\t"+a); sum+=a; } System.out.println(); } float b=((float)sum)/(i-1); System.out.print("平均"+b`); }}
import java.util.Scanner;import java.io.*;class fileRead{ public static void main(String [] args)throws Exception{ File f=new File("test.txt"); Scanner input=new Scanner(f); String tmp; int i=0; int a; int sum=0; while (input.hasNext()){ tmp=input.next(); System.out.print(i++); System.out.print("\t"+tmp); if(input.hasNextInt()) { a=input.nextInt(); System.out.print("\t"+a); sum+=a; } System.out.println(); } float b=((float)sum)/(i-1); System.out.print("平均"+b); }}
import java.util.*;import java.io.*;class fileRead { public static void main(String[] args) throws Exception { File f=new File("test.txt"); Scanner input=new Scanner(f); String tmp; int sum=0; int i=0; int a; while (input.hasNext()) { tmp=input.next(); System.out.print(i++); System.out.print("\t"+tmp); if (input.hasNextInt()) { a=input.nextInt(); System.out.print("\t"+a); sum+=a; } System.out.println(); } float b=((float)sum/(i-1)); System.out.print("全班平均是:"+b); }}
import java.util.*;import java.io.*;public class U1 { public static void main(String[]args) throws Exception { File f=new File("test.txt"); Scanner input=new Scanner (f); String tmp; int i=0; int sum=0; int a; while (input.hasNext()) { tmp=input.next(); System.out.print(i++); System.out.print("\t"+tmp); if (input.hasNextInt()) { a=input.nextInt(); System.out.print("\t"+a); sum+=a; } System.out.println(); } float b=((float)sum)/(i-1); System.out.print("平均是:"+b); } }
import java.util.Scanner;import java.io.*;class fileRead { public static void main(String[] args) throws Exception{ File f=new File("test.txt"); Scanner input=new Scanner(f); String tmp; int i=0; int a; int sum=0; while (input.hasNext()){ tmp=input.next(); System.out.print(i++); System.out.print("\t"+tmp); if (input.hasNextInt()) { a=input.nextInt(); System.out.print("\t"+a); sum+=a; } System.out.println(); } float b=((float)sum)/(i-1); System.out.print("全班平均:"+b); }}
import java.util.*; import java.io.*; public class U1 { public static void main(String[]args) throws Exception { File f=new File("test.txt"); Scanner input=new Scanner (f); String tmp; int i=0; int sum=0; int a; while (input.hasNext()) { tmp=input.next(); System.out.print(i++); System.out.print("\t"+tmp); if (input.hasNextInt()) { a=input.nextInt(); System.out.print("\t"+a); sum+=a; } System.out.println(); } float b=((float)sum)/(i-1); System.out.print("全班的平均是:"+b); } }
import java.util.*;public class Fibonacci{ public static double a(int n) { double sqrt5=Math.sqrt(5); double a1=Math.pow((1+sqrt5)/2,n); double a2=Math.pow((1-sqrt5)/2,n); return (a1-a2)/sqrt5; } public static void f(int n){ int f[]=new int[n+1]; f[0]=0;f[1]=1; for(int i=2; i<=n; i++){ f[i]=f[i-1]+f[i-2]; System.out.print("f["+i+"]="+f[i]); System.out.println("a("+1+")="+a(i)); } } public static void main(String[] args)throws Exception{ Scanner input=new Scanner(System.in); int n=input.nextInt(); f(n); } }
fileReadimport java.util.Scanner;import java.io.*;class fileRead { public static void main(String[] args) throws Exception{ File f=new File("test.txt"); Scanner input=new Scanner(f); String tmp; int i=0; int a; int sum=0; while (input.hasNext()){ tmp=input.next(); System.out.print(i++); System.out.print("\t"+tmp); if (input.hasNextInt()) { a=input.nextInt(); System.out.print("\t"+a); sum+=a; } System.out.println(); } float b=((float)sum)/(i-1); System.out.print("全班平均:"+b); }}
import java.util.Scanner;import java.io.*;class ab{public static void main(String [] args)throws Exception{File f=new File("test.txt");Scanner input=new Scanner(f);String tmp;int i=0;int a;int sum=0;while (input.hasNext()){tmp=input.next();System.out.print(i++);System.out.print("\t"+tmp);if(input.hasNextInt()){a=input.nextInt();System.out.print("\t"+a);sum+=a;}System.out.println();}float b=((float)sum)/(i-1);System.out.print("平均"+b);}}
張貼留言
26 則留言:
import java.util.*;
import java.io.*;
public class fileRead {
public static void main (String[]args) throws Exception
{
File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int i=0;
while (input.hasNext())
{
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if (input.hasNextInt())
System.out.println();
}
}
}
import java.util.Scanner;
import java.io.*;
class GAP{
public static void main(String [] args)throws Exception{
File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int i=0;
int a;
int sum=0;
while (input.hasNext()){
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if(input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum)/(i-1);
System.out.print("平均"+b);
}
}
import java.util.Scanner;
import java.io.*;
class ab{
public static void main(String [] args)throws Exception{
File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int i=0;
int a;
int sum=0;
while (input.hasNext()){
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if(input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum)/(i-1);
System.out.print("平均"+b);
}
}
import java.util.*;
import java.io.*;
public class fileRead {
public static void main(String[] args) throws Exception
{
File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int i=0;
int a;
float sum=0;
while (input.hasNext())
{
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if (input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
sum=sum/(i-1);
System.out.println();
System.out.print("平均= "+sum);
}
}
import java.util.Scanner;
import java.io.*;
class dd{
public static void main(String [] args)throws Exception{
File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int i=0;
int a;
float sum=0;
while (input.hasNext()){
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if(input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
sum=sum/(i-1);
System.out.println();
System.out.print("平均="+sum);
}
}
import java.util.Scanner;
import java.io.*;
class dd{
public static void main(String [] args)throws Exception{
File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int i=0;
int a;
int sum=0;
while (input.hasNext()){
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if(input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum)/(i-1);
System.out.print("全班平均是:"+b);
}
}
import java.util.Scanner;
import java.io.*;
class dd{
public static void main(String [] args)throws Exception{
File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int i=0;
int a;
int sum=0;
while (input.hasNext()){
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if(input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum)/(i-1);
System.out.print("平均"+b`);
}
}
import java.util.Scanner;
import java.io.*;
class fileRead{
public static void main(String [] args)throws Exception{
File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int i=0;
int a;
int sum=0;
while (input.hasNext()){
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if(input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum)/(i-1);
System.out.print("平均"+b);
}
}
import java.util.*;
import java.io.*;
class fileRead {
public static void main(String[] args) throws Exception
{ File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int sum=0;
int i=0;
int a;
while (input.hasNext())
{ tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if (input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum/(i-1));
System.out.print("全班平均是:"+b);
}
}
import java.util.*;
import java.io.*;
public class U1 {
public static void main(String[]args) throws Exception
{
File f=new File("test.txt");
Scanner input=new Scanner (f);
String tmp;
int i=0;
int sum=0;
int a;
while (input.hasNext())
{
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if (input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum)/(i-1);
System.out.print("平均是:"+b);
}
}
import java.util.Scanner;
import java.io.*;
class fileRead {
public static void main(String[] args) throws Exception{
File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int i=0;
int a;
int sum=0;
while (input.hasNext()){
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if (input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum)/(i-1);
System.out.print("全班平均:"+b);
}
}
import java.util.*;
import java.io.*;
public class U1 {
public static void main(String[]args) throws Exception
{
File f=new File("test.txt");
Scanner input=new Scanner (f);
String tmp;
int i=0;
int sum=0;
int a;
while (input.hasNext())
{
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if (input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum)/(i-1);
System.out.print("全班的平均是:"+b);
}
}
import java.util.Scanner;
import java.io.*;
class fileRead {
public static void main(String[] args) throws Exception{
File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int i=0;
int a;
int sum=0;
while (input.hasNext()){
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if (input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum)/(i-1);
System.out.print("全班平均:"+b);
}
}
import java.util.*;
import java.io.*;
public class U1 {
public static void main(String[]args) throws Exception
{
File f=new File("test.txt");
Scanner input=new Scanner (f);
String tmp;
int i=0;
int sum=0;
int a;
while (input.hasNext())
{
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if (input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum)/(i-1);
System.out.print("全班的平均是:"+b);
}
}
import java.util.Scanner;
import java.io.*;
class fileRead {
public static void main(String[] args) throws Exception{
File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int i=0;
int a;
int sum=0;
while (input.hasNext()){
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if (input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum)/(i-1);
System.out.print("全班平均:"+b);
}
}
import java.util.Scanner;
import java.io.*;
class fileRead {
public static void main(String[] args) throws Exception{
File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int i=0;
int a;
int sum=0;
while (input.hasNext()){
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if (input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum)/(i-1);
System.out.print("全班平均:"+b);
}
}
import java.util.Scanner;
import java.io.*;
class fileRead {
public static void main(String[] args) throws Exception{
File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int i=0;
int a;
int sum=0;
while (input.hasNext()){
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if (input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum)/(i-1);
System.out.print("全班平均:"+b);
}
}
import java.util.Scanner;
import java.io.*;
class fileRead {
public static void main(String[] args) throws Exception{
File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int i=0;
int a;
int sum=0;
while (input.hasNext()){
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if (input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum)/(i-1);
System.out.print("全班平均:"+b);
}
}
import java.util.Scanner;
import java.io.*;
class fileRead {
public static void main(String[] args) throws Exception{
File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int i=0;
int a;
int sum=0;
while (input.hasNext()){
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if (input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum)/(i-1);
System.out.print("全班平均:"+b);
}
}
import java.util.Scanner;
import java.io.*;
class fileRead {
public static void main(String[] args) throws Exception{
File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int i=0;
int a;
int sum=0;
while (input.hasNext()){
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if (input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum)/(i-1);
System.out.print("全班平均:"+b);
}
}
import java.util.Scanner;
import java.io.*;
class fileRead {
public static void main(String[] args) throws Exception{
File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int i=0;
int a;
int sum=0;
while (input.hasNext()){
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if (input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum)/(i-1);
System.out.print("全班平均:"+b);
}
}
import java.util.*;
public class Fibonacci{
public static double a(int n)
{
double sqrt5=Math.sqrt(5);
double a1=Math.pow((1+sqrt5)/2,n);
double a2=Math.pow((1-sqrt5)/2,n);
return (a1-a2)/sqrt5;
}
public static void f(int n){
int f[]=new int[n+1];
f[0]=0;f[1]=1;
for(int i=2; i<=n; i++){
f[i]=f[i-1]+f[i-2];
System.out.print("f["+i+"]="+f[i]);
System.out.println("a("+1+")="+a(i));
}
}
public static void main(String[] args)throws Exception{
Scanner input=new Scanner(System.in);
int n=input.nextInt();
f(n);
}
}
import java.util.*;
public class Fibonacci{
public static double a(int n)
{
double sqrt5=Math.sqrt(5);
double a1=Math.pow((1+sqrt5)/2,n);
double a2=Math.pow((1-sqrt5)/2,n);
return (a1-a2)/sqrt5;
}
public static void f(int n){
int f[]=new int[n+1];
f[0]=0;f[1]=1;
for(int i=2; i<=n; i++){
f[i]=f[i-1]+f[i-2];
System.out.print("f["+i+"]="+f[i]);
System.out.println("a("+1+")="+a(i));
}
}
public static void main(String[] args)throws Exception{
Scanner input=new Scanner(System.in);
int n=input.nextInt();
f(n);
}
}
import java.util.*;
public class Fibonacci{
public static double a(int n)
{
double sqrt5=Math.sqrt(5);
double a1=Math.pow((1+sqrt5)/2,n);
double a2=Math.pow((1-sqrt5)/2,n);
return (a1-a2)/sqrt5;
}
public static void f(int n){
int f[]=new int[n+1];
f[0]=0;f[1]=1;
for(int i=2; i<=n; i++){
f[i]=f[i-1]+f[i-2];
System.out.print("f["+i+"]="+f[i]);
System.out.println("a("+1+")="+a(i));
}
}
public static void main(String[] args)throws Exception{
Scanner input=new Scanner(System.in);
int n=input.nextInt();
f(n);
}
}
fileRead
import java.util.Scanner;
import java.io.*;
class fileRead {
public static void main(String[] args) throws Exception{
File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int i=0;
int a;
int sum=0;
while (input.hasNext()){
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if (input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum)/(i-1);
System.out.print("全班平均:"+b);
}
}
import java.util.Scanner;
import java.io.*;
class ab{
public static void main(String [] args)throws Exception{
File f=new File("test.txt");
Scanner input=new Scanner(f);
String tmp;
int i=0;
int a;
int sum=0;
while (input.hasNext()){
tmp=input.next();
System.out.print(i++);
System.out.print("\t"+tmp);
if(input.hasNextInt())
{
a=input.nextInt();
System.out.print("\t"+a);
sum+=a;
}
System.out.println();
}
float b=((float)sum)/(i-1);
System.out.print("平均"+b);
}
}
張貼留言