Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- main() {
- FILE *input, *output;
- int x, y, numberArray[5][3];
- input = fopen("input", "r");
- for (x = 0; x < 5; x++)
- for(y = 0; y < 3; y++)
- fscanf(input, "%1d", &numberArray[x][y]);
- fclose(input);
- for (x = 0; x < 5; x++)
- for(y = 0; y < 3; y++){
- if(y == 1)
- numberArray[x][y] *= 2;
- if(y == 2)
- numberArray[x][y] *= 4;
- }
- output = fopen("output", "w");
- for (x = 0; x < 5; x++){
- for(y = 0; y < 3; y++)
- fprintf(output, "%d ", numberArray[x][y]);
- fprintf(output, "\n");
- }
- fclose(output);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement