Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- код на c++
- /*подключенные библиотеки*/
- #include <cstdio>
- #include <iostream>
- using namespace std;
- int main ()
- {
- FILE * f;
- FILE *fp;
- int c;
- if ( ! ( f = fopen("file.txt", "r") ) )
- { perror("oshibka otkrytija file.txt");
- cin.get();
- return -1;}
- if ( ! ( fp = fopen("rslt.txt", "wb") ) )
- { perror("oshibka otkrytija rslt.txt");
- cin.get();
- return -1;}
- cout<<"Schityvaem simvoly iz fajla file.txt i vstavljaem v rslt.txt, perevodja vse v VERHNIJ REGISTR";
- cout << endl;
- while ( ( c = fgetc(f) ) != EOF )
- {cout << ".";
- fputc( toupper(c),fp );
- }
- cout << endl;
- fclose(f);
- fclose(fp);
- cout<<"Rabota vypolnena, rezul'tat mozhno proverit' v fajle rslt.txt";
- cin.get();
- return ( 0 );
- }
- _____________________________________________________________________________
- код на c
- #include <stdio.h>
- #include <ctype.h>
- int main ()
- {
- FILE * f;
- FILE *fp;
- int c;
- if ( ! ( f = fopen("file.txt", "r") ) )
- { perror("oshibka otkrytija file.txt");
- getchar();
- return -1;}
- if ( ! ( fp = fopen("rslt.txt", "wb") ) )
- { perror("oshibka otkrytija rslt.txt");
- getchar();
- return -1;}
- printf("Schityvaem simvoly iz fajla file.txt i vstavljaem v rslt.txt, perevodja vse v VERHNIJ REGISTR");
- while ( ( c = fgetc(f) ) != EOF )
- {
- //printf(".");
- fputc( toupper(c),fp );
- }
- fclose(f);
- fclose(fp);
- printf("Rabota vypolnena, rezul'tat mozhno proverit' v fajle rslt.txt");
- getchar();
- return ( 0 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement