Last active
September 20, 2017 12:06
-
-
Save invatainfo/eac669d4d045e882521409129a692d5a 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 f("BAC.TXT"); | |
void main() { | |
long x, y, n; | |
f >> x; | |
n = 1; | |
while (f >> y) { | |
if (x == y) | |
n++; | |
else { | |
cout << x << " " << n << " "; | |
n = 1; | |
} | |
x = y; | |
} | |
cout << x << " " << n; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment