fork download
  1. import 'dart:io';
  2.  
  3. void main() {
  4.  
  5. // reading the value from the console
  6. String x = stdin.readLineSync();
  7.  
  8.  
  9. int stringLength = x.length; //to find the length of 'x'
  10.  
  11.  
  12. //$x to print the value of 'x' also in the output
  13.  
  14. //if the string is less than or equal to 5
  15. if(stringLength<=5)
  16. print("$x is a short string");
  17.  
  18. //if the string length is 6 to 10
  19. else if(stringLength>=6 && stringLength<=10)
  20. print("$x is a normal string");
  21.  
  22. //if the string length greater than 10
  23. else
  24. print("$x is a long string");
  25.  
  26. }
Success #stdin #stdout 0.85s 129500KB
stdin
NarutoAndSasuke
stdout
NarutoAndSasuke is a long string