Varianta 100 / Subiectul 3 / Problema 4 |
#include<fstream.h> ifstream fin("sir.txt"); void main() { int x,k,a,b,c; char cif; fin>>x>>k; if(x==9) { a=1;b=2;} else if(x<9) a=b=1; else a=b=2; do { c=a+b; a=b; b=c; } while (c<k); for(int i=1;i<=a;i++) { fin>>cif; cout<<cif; } } |