Cod sursa(job #245789)
Utilizator | Data | 18 ianuarie 2009 21:06:36 | |
---|---|---|---|
Problema | Secventa 5 | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <stdio.h>
#include <fstream>
using namespace std;
long length;char * buffer;
int main(){
ifstream is;
is.open ("date.in",ios::in);
//freopen ("date.out","w",stdout);
// get length of file:
is.seekg (0, ios::end); length = is.tellg();
is.seekg (0, ios::beg);
// allocate memory:
buffer = new char [length];
// read data as a block:
is.read (buffer,length);
is.close();
//output file
//printf("%s",buffer);
//fclose(stdout);
return 0;
}