Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "My ear" = 48;
- "My mouth" = 57;
- "My thoughts" = 0;
- Cast "My ear" to char; // '0'
- Cast "My mouth" to char; // '9'
- "My thoughts" -= 1;
- "The thought" = 10; // константа, см. ниже
- "Reality" = 0; // сумма
- Read from STDIN to "The world";
- While "The world" != null {
- Split "The world" by ' ' to "Your mind";
- "My hands" = "Your mind"[0]; "Your mind".remove(0);
- "Your thoughts" = "My thoughts"; // здесь храним первую цифру
- While "My hands" != undefined {
- If "My hands" >= "My ear" {
- If "My hands" <= "My mouth" { // '0' <= "My hands" <= '9'
- Cast "My hands" to int; // например, '3' => 3
- If "Your thoughts" < 0 {
- "Your thoughts" = "My hands"; // см. коммент выше
- }
- "Your hands" = "My hands"; // здесь храним последнюю цифру
- }
- }
- "My hands" = "Your mind"[0]; "Your mind".remove(0);
- }
- "Your dream" = "The thought" * "Your thoughts"; // 10 * первая цифра
- "Your dream" = "Your dream" + "Your hands"; // += последняя цифра
- "Reality" = "Reality" + "Your dream"; // сумма += число
- Read from STDIN to "The world";
- }
- Print "Reality" to STDOUT;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement