Benutzer-Werkzeuge

Webseiten-Werkzeuge


cowork:schulung:42:public:lowercasecode
ft_str_is_lowercase.c
  1 /* ************************************************************************** */
  2 /*                                                                            */
  3 /*                                                        :::      ::::::::   */
  4 /*   ft_str_is_lowercase.c                              :+:      :+:    :+:   */
  5 /*                                                    +:+ +:+         +:+     */
  6 /*   By: acossu <acossu@student.42berlin.de>        +#+  +:+       +#+        */
  7 /*                                                +#+#+#+#+#+   +#+           */
  8 /*   Created: 2026/02/24 14:49:39 by acossu            #+#    #+#             */
  9 /*   Updated: 2026/02/24 17:52:34 by acossu           ###   ########.fr       */
 10 /*                                                                            */
 11 /* ************************************************************************** */
 12 
 13 int ft_str_is_lowercase(char *str)
 14 {
 15         int     a;
 16 
 17         a = 0;
 18         while (str[a] != '\0')
 19         {
 20         if (str[a] >= 'a' && str[a] <= 'z') // || (!(str[a] != ' ')))
 21         {
 22         a++;
 23         }
 24         else
 25         {
 26                 return (0);
 27         }
 28         }
 29         return (1);
 30 
 31 }
 32 // asd 1
 33 // F3s@ 0
 34 // ' ' 1
 35 #include <stdio.h>
 36 
 37 int main()
 38 {
 39         printf("%d\n", ft_str_is_lowercase("a"));
 40         printf("%d\n", ft_str_is_lowercase("A"));
 41         printf("%d\n", ft_str_is_lowercase(""));
 42 }
/volume1/web/dokuwiki/data/pages/cowork/schulung/42/public/lowercasecode.txt · Zuletzt geändert: 2026/02/24 17:56 von 89.246.128.70