Fill in the blank:
If the input string in 'Moore machine is of length 'm', the output string
would be of the length
Answers
Answered by
1
Answer:
If the input string in 'Moore machine is of length 'm', the output string
would be of the length of "half of the length of stored in m".
Example:-
import java.io.*;
class moore
{
public static void main ( string args[] )
{
System. out. println (" Enter the length to be cropped from string ") ;
int m=sc. nextInt ( ) ;
System. out. println (" Enter the string be cropped ") ;
string m=sc. nextLine ( ) ;
System. out. println (" The cropped string output is ");
for (int i=0 ; i< m; i++)
{
System. out. println (a. charAt ( i ));
}
}
}
Similar questions