suehtamfr

2253.dart

Sep 23rd, 2025
3,484
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.97 KB | Source Code | 0 0
  1. import 'dart:io';
  2. import 'dart:math';
  3.  
  4. bool istp(String c){//to upper
  5.   int code = c.codeUnitAt(0);
  6.   return (code  >= 'A'.codeUnitAt(0) && code  <= 'Z'.codeUnitAt(0));
  7. }
  8.  
  9. bool istl(String c){//to lower
  10.   int code = c.codeUnitAt(0);
  11.   return (code >= 'a'.codeUnitAt(0) && code  <= 'z'.codeUnitAt(0));
  12. }
  13.  
  14. bool isnb(String c){//nuber
  15.   int code = c.codeUnitAt(0);
  16.   return (code  >= '0'.codeUnitAt(0) && code  <= '9'.codeUnitAt(0));
  17. }
  18.  
  19. void main(){
  20.  
  21.   String s = "cobol";
  22.   while(true){
  23.     final v = stdin.readLineSync();
  24.     if(v==null || v.isEmpty) break;
  25.     int ll = 0, lu = 0, nb = 0;
  26.     bool ok = true;
  27.     for(int i=0;i<v.length;i++){
  28.       if(istp(v[i])||istl(v[i])||isnb(v[i])){
  29.         if(istp(v[i])) lu++;
  30.         else if(istl(v[i])) ll++;
  31.         else nb++;
  32.       }
  33.       else{
  34.         ok = false;
  35.       }
  36.     }
  37.     if(ok && lu>0 && ll>0 && nb>0 && v.length>=6 && v.length<=32) print("Senha valida.");
  38.     else print("Senha invalida.");
  39.   }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment