| 1 |
#include <iostream> |
| 2 |
#include "fistream.h" |
| 3 |
|
| 4 |
using namespace std; |
| 5 |
using namespace FBB; |
| 6 |
|
| 7 |
//MAIN |
| 8 |
int main() |
| 9 |
{ |
| 10 |
Fistream fis(cin); |
| 11 |
|
| 12 |
fis >> hex; |
| 13 |
while (true) |
| 14 |
{ |
| 15 |
size_t x; |
| 16 |
switch (x = fis.get()) |
| 17 |
{ |
| 18 |
case '\n': |
| 19 |
cout << '\n'; |
| 20 |
break; |
| 21 |
case '+': |
| 22 |
cout << ' '; |
| 23 |
break; |
| 24 |
case '%': |
| 25 |
fis >> field(2) >> x >> field(0); |
| 26 |
// FALLING THROUGH |
| 27 |
default: |
| 28 |
cout << static_cast<char>(x); |
| 29 |
break; |
| 30 |
case EOF: |
| 31 |
return 0; |
| 32 |
} |
| 33 |
} |
| 34 |
} |
| 35 |
/* |
| 36 |
Generated output after: |
| 37 |
echo My+name+is+%60Ed%27 | a.out |
| 38 |
|
| 39 |
My name is `Ed' |
| 40 |
*/ |
| 41 |
//= |