All pastes #393391 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-03-13 15:08 UTC
rendered paste body
#include<stdio.h>

#include<ctype.h>

#define max 80



void check(char *sptr,int n);



main()

{

	int n=0;

	char stringa[max];

	printf("\n Inserire la stringa: ");

	gets(stringa);

	printf("\n Inserire n: ");

	scanf("%d",&n);

	check(stringa,n);

}



void check(char *sptr,int n)

{

int controllo=0;

int nmax=n;

	while(*sptr!='\n')

		{

			if(*sptr=' ')	
				{

				for(x = n ; x = 0 ; x--)

					{

						if (*(sptr - n) =! *(sptr + nmax - n)) controllo = 1

					}	

						

				if(controllo=0) *sptr = *sptr + n;

		

		      }
			else if(*sptr== '\n') return 0

			else {
					printf("%c",*sptr);
					sptr++;
					}

			

		}



}