Skip to content

Instantly share code, notes, and snippets.

@arkokoley
Created February 10, 2015 20:53
Show Gist options
  • Save arkokoley/c0c8c30add42519bc5cd to your computer and use it in GitHub Desktop.
Save arkokoley/c0c8c30add42519bc5cd to your computer and use it in GitHub Desktop.
#include<stdio.h>
int main(int argc, char*argv[]){
FILE *file = fopen(argv[1],"r");
int a,b,c,N[1000],i;
fscanf(file,"%d\n%d\n%d\n",&a,&b,&c);
printf("%d %d %d\n",a,b,c);
for(i=0;!feof(file);++i){
N[i] = fgetc(file) - '0';
if(feof(file))
break;
}
a = i-1;
for(i=0;i<a;++i)
printf("%d",N[i]);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment