package cap14.semplici;
import IngressoUscita.*;

public class FiboThread extends Thread {
  int n;
  public FiboThread(int n){
    this.n = n;
  }
  public void run(){
    int i1 = 0, i2 = 1;
    for(; n>0; n--){
      try {
        Thread.sleep(1000);
        int tmp = i1;
        i1 = i2;
        i2 += tmp;
      } catch(InterruptedException ie) {
        Console.scriviStringa("Thread interrotto");
      }
      Console.scriviIntero(i2);
    }
  }
}
