fork(3) download
  1. #!/usr/bin/perl
  2. # your code goes here
  3. $fixedlines[0]=<>;
  4.  
  5. while($line = <>){
  6.  
  7. $tabs=0;
  8. while($line =~ /^\(tab\)/){
  9. $line =~ s/^\(tab\)//g;
  10. $tabs++;
  11. }
  12.  
  13. $line = "\t" x $tabs . $line;
  14.  
  15. $fixedlines[~~@fixedlines] = $line;
  16.  
  17. if($line ne " \n" && $line ne ""){
  18. $fixedlines[$#fixedlines-1] = "";
  19. }
  20. }
  21.  
  22. print @fixedlines,"\n"
Success #stdin #stdout 0s 3564KB
stdin
import random
 
PhiNotPi
PhiNotPi
13:25
words = dict()
 
user2509848
user2509848
words[0] = 'Cabbage'
 
PhiNotPi
PhiNotPi
13:48
words.update({1:'potato',2:'vegetable',3:'fruit',4:'avocado',5:'strawberry',6:'‌​apple'})
 
user2509848
user2509848
words.update({7:'pear',8:'corn',9:'tomato',10:'kiwi',11:'peach',12:'‌​eggplant',‌​13:'pineapple'})
stdout
import random
words = dict()
words[0] = 'Cabbage'
words.update({1:'potato',2:'vegetable',3:'fruit',4:'avocado',5:'strawberry',6:'‌​apple'})
words.update({7:'pear',8:'corn',9:'tomato',10:'kiwi',11:'peach',12:'‌​eggplant',‌​13:'pineapple'})