RLE ¶
~cpp #include <iostream> #include <fstream> using namespace std; void main() { ifstream fin("input.txt"); // 3b11a char ch; int num; do{ fin >> num; // ... fin.get(ch); for ( int i = 0 ; i < num ; i++ ) cout << ch; }while( !fin.eof() ); }
DPCM ¶
¶
~cpp #include <iostream> using namespace std; void main() { char ch; ch = cin.get(); cout << ch; char initial = ch; do { cout << initial - ch; cin.get(initial); }while(!(initial == '\n')); }