Skip to content

Instantly share code, notes, and snippets.

@penut85420
Last active October 22, 2017 12:16
Show Gist options
  • Save penut85420/2aba45482557aaa9a1fdf30ce14eb9fb to your computer and use it in GitHub Desktop.
Save penut85420/2aba45482557aaa9a1fdf30ce14eb9fb to your computer and use it in GitHub Desktop.
int array with eof
#include <stdio.h>
#include <stdlib.h>
int main() {
int i = 0, n[100];
while (scanf("%d", &n[i++]) != EOF) ; i--;
for (int j = 0; j < i; j++)
printf("%d ", n[j]);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment