@@ 0,0 1,43 @@
+#include <stdio.h>
+
+/* charinstring: check if char is in string */
+int
+charinstring(int c, char s[])
+{
+ int i;
+
+ for (i = 0; s[i] != '\0'; ++i) {
+ if (s[i] == c) {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+/* htoi: returns the first location in the string s where any character from
+ * the string t occurs */
+int
+any(char s[], char t[])
+{
+ int i;
+
+ for (i = 0; s[i] != '\0'; ++i) {
+ if (charinstring(s[i], t)) {
+ return i;
+ }
+ }
+
+ return -1;
+}
+
+/* print some examples */
+int
+main()
+{
+ char s[] = "Hay una z en la posición número";
+
+ printf("%s %d.\n", s, any(s, "z"));
+
+ return 0;
+}