--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char *argv[]){
+ if(argc != 2){
+ printf("Not the right amount of arguments given");
+ return -1;
+ }
+ FILE *file = fopen(argv[1], "r");
+ if(file == 0){
+ return -1;
+ }
+ int a = 0;
+ int c = 0;
+ int g = 0;
+ int t = 0;
+ int amount_chars = 0;
+ char x;
+ while((x = fgetc (file) ) != EOF){
+ switch(x){
+ case 'A':
+ a += 1;
+ amount_chars += 1;
+ break;
+ case 'C':
+ c += 1;
+ amount_chars += 1;
+ break;
+ case 'G':
+ g += 1;
+ amount_chars += 1;
+ break;
+ case 'T':
+ t += 1;
+ amount_chars += 1;
+ break;
+ case '\n':
+ if(amount_chars % 100 != 0){
+ printf("%i", amount_chars);
+ printf("Not right format");
+ return -1;
+ }
+ break;
+ default:
+ return -1;
+ }
+ }
+ if(amount_chars != 50000){
+ return -1;
+ }
+ printf("There were %i A's, %i C's, %i G's, %i T's\n",a,c,g,t);
+ return 0;
+}