Created
September 16, 2017 15:04
-
-
Save invatainfo/e751576788314111a32f7a2dab0c2ae8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment