Advertisement
cd62131

Tax

Feb 23rd, 2014
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main(void) {
  4.   FILE *in = fopen("file1.txt", "r");
  5.   FILE *out = fopen("file2.txt", "w");
  6.   char buf[BUFSIZ];
  7.   int n, price;
  8.   fgets(buf, BUFSIZ, in); // ignore header
  9.   while (~scanf("%d %d", &n, &price))
  10.     fprintf(out, "%d\n", (int) (n * price * 1.05));
  11.   fclose(in);
  12.   fclose(out);
  13.   return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement