Exemplo n.º 1
0
Arquivo: uva519.cpp Projeto: ksBSB/ACM
void handle(int cur, char str[]){
    int p, q, k, t;
    p = block[cur].top = change_char(str[0]);
    rec[0][p]++;
    k = block[cur].right = change_char(str[1]);
    rec[1][k]++;
    t = block[cur].bottom = change_char(str[2]);
    rec[3][t]++;
    q = block[cur].lift = change_char(str[3]);
    rec[2][q]++;
    list [p * 3 + q][cnt[p * 3 + q]++] = cur;
}
Exemplo n.º 2
0
int main()
{
	char str[MAX]={0};
	printf("Informe a frase: ");
	scanf("%[^\n]s", str);
	int i, topo=0;
	for(i=0;i<strlen(str);i++)
		str[i] = change_char(&str[i]);
	printf("\nFrase corrigida: ");
	for(i=0;i<strlen(str);i++)
		printf("%c", str[i]);
	printf("\n");

	return 0;
}
Exemplo n.º 3
0
static void get_KeyFileName(const char* path, char* filename)
{
	int len = strlen(path);
	int i, j = 0,k;

	for(i = len-1; i >= 0 && path[i] != '/'; --i)
	{
		filename[j++] = path[i];
	}

	for(i = 0, k = j-1; i < k; ++i,--k)
	{
		change_char(&filename[i], &filename[k]);
	}
	filename[j] = '\0';
}
Exemplo n.º 4
0
void	rectangle(int x, int y)
{
	int width;
	int height;
	
	width = 1;
	height = 1;
	while (height <= y)
	{
		while (width <= x)
		{
			change_char(width, height, x, y);
			width++;
		}
		ft_putchar('\n');
		width = 1;
		height++;
	}
}
Exemplo n.º 5
0
static int	fill_str(char **str, t_tab *tab, int i, int len)
{
  char		*s2;
  int		n;

  n = 0;
  tab->stock_pipe = NULL;
  if ((s2 = my_xmalloc((len + 1) * sizeof(char))) == NULL)
    return (-1);
  s2[len] = 0;
  ++i;
  while (((*str)[i]) && (((*str)[i] != '`') || (!is_backslash(*str, i))))
    s2[n++] = (*str)[i++];
  ++tab->bquote;
  exec_all(tab, s2);
  change_char(tab->stock_pipe);
  --tab->bquote;
  return (replace_quote(str, tab->stock_pipe));
}