Jump to content

Ajuda em C++


Recommended Posts


mas agr ja tenhu a respost

#include <stdio.h>
#include <string.h>
void main(void)
char pal [100];
    char palavra [100];
    int x, z = 0, k, w;
int espaco=0;
int y=0;
    strcpy(pal,"escola sa      miranda");

	for (x = 0; pal[x]; x++)
		 z++ ;
		 espaco = 0 ;
		 w = x ;
		 while (pal[w]==32) 
			 w++ ;
		  if (espaco==1) palavra[z]=' ' ;
				else if (espaco > 1)
					for (k = 0; k < espaco - 1; k++)
	palavra[z] = pal[x];

pra km precisar

cumps :w

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
  • 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.