Jump to content

[Resolvido] Exercício C


Nun0
 Share

Recommended Posts

Boas malta, estou a tentar implementar este código:

#include <stdio.h>



int um_dos (char palavra1[] , char palavra2[])

{

int i = 0;

int j;



while (palavra1 [i] != '\0') {

	for (j=0; palavra2 [j] != '\0'; j++) {

		if (palavra1 [i] == palavra2 [j]) {

			return i;

		}

	}

i++;

}

return 1;

}



int main ()

{

printf("%d\n" , um_dos ("maria" "rocarzito"));



return 1;

}

E está sempre a dizer que tem poucos argumentos, alguém me pode ajudar?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.