Advertisement
cd62131

scan integer

Jul 3rd, 2014
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. #include <stdio.h>
  2. #define N 10
  3. int main(void) {
  4.   FILE *in = fopen("a.txt", "r");
  5.   int a[N], b[N];
  6.   fscanf(in, "%d%d%d", &a[0], &a[1], &a[2]);
  7.   fscanf(in, "%d%d%d%d", &b[0], &b[1], &b[2], &b[3]);
  8.   printf("%d, %d, %d\n", a[0], a[1], a[2]);
  9.   printf("%d, %d, %d, %d\n", b[0], b[1], b[2], b[3]);
  10.   return 0;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement