Advertisement
LordMZTE

Untitled

Jun 4th, 2023
847
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. char* printerError(char *s) {
  2.   int errors, total;
  3.   errors = total = 0;
  4.  
  5.   while (*s) {
  6.     char c = *s++;
  7.     total++;
  8.     if (c < 'a' || c > 'm')
  9.       errors++;
  10.   }
  11.  
  12.   char* result;
  13.   asprintf(&result, "%d/%d", errors, total);
  14.   return result;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement