Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. FILE *myFile;
  6. myFile = fopen("input.txt", "r");
  7. int numb[2];
  8. int i, k = 0;
  9. for(i = 0; i < 2; i++)
  10. {
  11. fscanf(myFile, "%d", &numb[i]);
  12. }
  13. if(numb[0] < 32000 && numb[1] < 32000 && numb[0] > -32000 && numb[1] > -32000)
  14. {
  15. k = numb[0] - numb[1];
  16. }
  17. fclose(myFile);
  18. const char * filename = "output.txt";
  19. const char * mode = "w";
  20. FILE *file;
  21. file = fopen(filename, mode);
  22. fprintf(file, "%d", k);
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement