Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <cmath>
- #include <string>
- using namespace std ;
- int main () {
- ifstream arq ;
- ofstream arqs ;
- int cont = 0, i ;
- string linha[100];
- arq.open ("arq1.txt") ;
- for ( i = 0 ; i < 100 ; i++ )
- {
- getline (arq, linha[i]) ;
- if ( linha[i].size() == 0 )
- {
- break ;
- }
- else
- {
- cont ++ ;
- }
- }
- arqs.open ("arqs2.txt") ;
- for ( i = 0 ; i < cont ; i -- )
- {
- arqs << linha[i] << endl ;
- }
- arq.close();
- arqs.close() ;
- return 0 ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement