--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char* argv[])
+{
+ if(argc != 2)
+ {
+ printf("Usage: %s filepath\n", argv[0]);
+ return 2;
+ }
+
+ FILE *f;
+ int c = 0;
+ int charsperline = 0;
+ int numlines = 0;
+ int occs[4] = {0, 0, 0, 0};
+
+ f = fopen(argv[1], "r");
+ if(f == NULL)
+ {
+ printf("Unable to open file...");
+ return 2;
+ }
+
+ while((c = fgetc(f)) != EOF)
+ {
+ if(c == '\n')
+ {
+ if(charsperline != 100)
+ return -1;
+ numlines += 1;
+ charsperline = 0;
+ }
+ else
+ {
+ if(c == 'A')
+ occs[0] += 1;
+ else if(c == 'C')
+ occs[1] += 1;
+ else if(c == 'G')
+ occs[2] += 1;
+ else if(c == 'T')
+ occs[3] += 1;
+ else
+ return -1;
+ charsperline += 1;
+ }
+ }
+ fclose(f);
+ if(numlines != 500)
+ return -1;
+
+ printf("A: %d\nC: %d\nG: %d\nT: %d\n", occs[0], occs[1], occs[2], occs[3]);
+ return 0;
+}