ورود

View Full Version : کمک فوری



salam20
جمعه 13 آبان 1390, 18:04 عصر
سلام دوستان
کسی برنامه تولید رشهت فیبو ناچی در جاوا رو داره سرچ کردم نبود
یعنی یک عدد بگیره و تا اون عدد رشته فیبو ناچی رو تولید کنه
ممنون

salam20
جمعه 13 آبان 1390, 18:07 عصر
بهتره بگم اشکال این سورس چیه که عدد رو میگیره ولی رشته رو تولید نمیکنه
public class fibo
{
private int i,n,seri=0;

public void fib(int seri)
{




for(i=1;i<=n;i++)
{
seri=(n-1)+(n-2);
System.out.print(seri);


}
}
public int bo() throws IOException
{
n=readint();
return n;
}
public static int readint()throws IOException
{
int f;
char ch;
String str=new String();
ch=(char)System.in.read();
while((ch>='0'&&ch<='9')||ch=='.')
{
str=str+ch;
ch=(char)System.in.read();
}
f=Integer.parseInt(str);
return f;
}
}