Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- FILE *senars=NULL,*parells=NULL,*fusion=NULL;
- int n;
- if((senars=fopen("senars.txt","r"))==NULL){
- printf("Error al abrir/crear el archivo senars\n");
- }else if ((parells=fopen("parells.txt","r"))==NULL){
- printf("Error al abrir/crear el archivo parells\n");
- } else if ((fusion=fopen("fusion.txt","w"))==NULL){
- printf("Error al abrir/crear el archivo fusion\n");
- } else {
- while (!feof(senars) && !feof(parells)){
- fscanf(senars,"%d", &n);
- printf("%d ", n);
- fprintf(fusion,"%d ", n);
- fscanf(parells,"%d", &n);
- printf("%d ", n);
- fprintf(fusion,"%d ", n);
- }
- }
- fclose(senars);
- fclose(parells);
- fclose(fusion);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement