Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- FILE *afile = NULL;
- FILE *bfile = NULL;
- FILE *cfile = NULL;
- cfile = fopen("C", "w");
- if (cfile == NULL) {
- puts("Error create file C");
- return 0;
- }
- afile = fopen("A", "r");
- if (afile ==NULL){
- puts("Error open file A");
- return 0;
- }
- char symbol;
- while(fread(&symbol,sizeof(char), 1, afile)== sizeof(char)){
- if (symbol == '>' || symbol == '=' || symbol == '<'){
- fwrite(&symbol,sizeof(char), 1, cfile);
- }
- }
- fclose(cfile);
- fclose(afile);
- bfile = fopen("B", "r");
- if (bfile == NULL) {
- puts("Error create file C");
- return 0;
- }
- afile = fopen("A", "a");
- if (afile ==NULL){
- puts("Error open file A");
- return 0;
- }
- while(fread(&symbol,sizeof(char), 1, bfile)== sizeof(char)){
- if ((symbol >='a' && symbol <= 'z') || (symbol >= 'A' && symbol <= 'Z')){
- fwrite(&symbol,sizeof(char), 1, afile);
- }
- }
- fclose(bfile);
- fclose(afile);
- fclose(cfile);
- return 0;
- }
Add Comment
Please, Sign In to add comment