Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main() {
- FILE * input;
- FILE * output;
- input = fopen("in.txt", "r");
- output = fopen("out.txt", "w");
- float multiplicator;
- printf("Multiplicator: "); scanf("%f", &multiplicator);
- int openInt, endInt;
- printf("a= : "); scanf("%d", &openInt);
- printf("b= : "); scanf("%d", &endInt);
- char name[100];
- float salar;
- while (fscanf(input, "%[^,]s", &name) != EOF) {
- fscanf(input, "%*c");
- fscanf(input, "%f", &salar);
- if (salar >= openInt && salar <= endInt)
- fprintf(output, "%s, %f", name, multiplicator * salar);
- else
- fprintf(output, "%s, %f", name, salar);
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement