| 1 | #include <iostream.hfa>
|
|---|
| 2 | #include <containers/string.hfa>
|
|---|
| 3 | #include <containers/string_res.hfa>
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 | void istream_cstr(void) {
|
|---|
| 7 | char s1[999], s2[999], s3[999], si[999];
|
|---|
| 8 | sin | wdi(999,s1) | wdi(999,s2) | wdi(999,s3);
|
|---|
| 9 | sout | s1;
|
|---|
| 10 | sout | s2;
|
|---|
| 11 | sout | s3;
|
|---|
| 12 | for(;;) {
|
|---|
| 13 | sin | wdi(999,si);
|
|---|
| 14 | if (si[0] == '=') break;
|
|---|
| 15 | sout | si;
|
|---|
| 16 | }
|
|---|
| 17 | }
|
|---|
| 18 |
|
|---|
| 19 | string accumulator;
|
|---|
| 20 |
|
|---|
| 21 | void reset_otherStringAction(void) {
|
|---|
| 22 | accumulator = "";
|
|---|
| 23 | }
|
|---|
| 24 | void step_otherStringAction(void) {
|
|---|
| 25 | string localAction = "--";
|
|---|
| 26 | accumulator += localAction(0,1);
|
|---|
| 27 | sout | accumulator;
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| 30 | void istream_string_res(void) {
|
|---|
| 31 | string_res s1, s2, s3, si;
|
|---|
| 32 | sin | s1 | s2 | s3;
|
|---|
| 33 | sout | s1; step_otherStringAction();
|
|---|
| 34 | sout | s2; step_otherStringAction();
|
|---|
| 35 | sout | s3; step_otherStringAction();
|
|---|
| 36 | for(;;) {
|
|---|
| 37 | sin | si;
|
|---|
| 38 | if (size(si) > 0 && si[0] == '=') break;
|
|---|
| 39 | sout | si; step_otherStringAction();
|
|---|
| 40 | }
|
|---|
| 41 | }
|
|---|
| 42 |
|
|---|
| 43 | void istream_string(void) {
|
|---|
| 44 | string s1, s2, s3, si;
|
|---|
| 45 | sin | s1 | s2 | s3;
|
|---|
| 46 | sout | s1; step_otherStringAction();
|
|---|
| 47 | sout | s2; step_otherStringAction();
|
|---|
| 48 | sout | s3; step_otherStringAction();
|
|---|
| 49 | for(;;) {
|
|---|
| 50 | sin | si;
|
|---|
| 51 | if (size(si) > 0 && si[0] == '=') break;
|
|---|
| 52 | sout | si; step_otherStringAction();
|
|---|
| 53 | }
|
|---|
| 54 | }
|
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 | int main() {
|
|---|
| 58 | istream_cstr(); sout | "=";
|
|---|
| 59 | istream_string_res(); sout | "="; reset_otherStringAction();
|
|---|
| 60 | istream_string();
|
|---|
| 61 | }
|
|---|