mdlib

Palindromo

Jan 18th, 2021 (edited)
903
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int verificaPalindromo(char *string){
  5.     for(int i=strlen(string)-1, j=0; i>=0; i--, j++){
  6.         if(string[i] != string[j]){
  7.             return 0; //false
  8.         }
  9.     }
  10.     return 1; //true
  11. }
  12.  
RAW Paste Data