nguyentruong98

Untitled

Dec 14th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. int main()
  2. {
  3.       int i;
  4.       int array1[1000];
  5.       int array2[1000];
  6.       Stack *s = makeStack();
  7.       FILE*f = fopen("experval.txt", "r");
  8.       if(f == NULL)
  9.       printf("FILE ERROR\n");
  10.       else{
  11.             fscanf(f, "%d", &n);
  12.             for(i = 1; i<=n; i++)
  13.             {
  14.                   fscanf(f, "%d", &array1[i]);
  15.                   node.value = array1[i];
  16.                   Node* newnode = makeNode(value);
  17.                   pushStack(s, newNode);
  18.             }
  19.       }
  20.       return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment