language: Forth (gforth-0.7.0)
date: 566 days 22 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
: saccept 1- swap 1+ swap accept ;  
64 constant #name \ Define que name sera numero constante 64
 
\ alocar variaveis do tamanho name
create stringPrincipal #name chars allot
create substring #name chars allot
 
\ procura usando o search pela substring dentro da string principal
: compara stringPrincipal count substring count search ;
 
: meuPrograma
cr stringPrincipal dup #name saccept
swap c! cr
cr substring dup #name saccept
swap c! cr
 
cr substring count type
compara
 
0 = if
.(  nao e substring de ) drop drop
else
.(  e substring de ) drop drop
then
 
stringPrincipal count type cr
;
meuPrograma \ executa o programa
  • upload with new input
  • result: Runtime error     time: 0.11s    memory: 7508 kB     signal: 25 (SIGXFSZ)

    oi
    thay
     nao e substring de  e substring de