BJ4 請愛用指標(組合語言的指令較少)

60000000 是偷吃步(別人說這樣會AC~~~)

 

#include <stdio.h>
#include <string.h>

char str[60000000];

int main()
{
  int i;
  int n, m;
  int pos;

 

 

  char *pstr, *pinput;
  char input[100];

  while(scanf("%d%d", &n, &m) && (n || m))
  {
    pstr = str;
    while(n--)
    {
      scanf("%s", input);
      pinput = input;
      while(*(pinput)!='\0') *(pstr++) =*(pinput++);
    }

    while(m--)
    {
      scanf("%d", &pos);
      printf("%c", *(str+pos-1));
    }
    
    printf("\n");
  }

  return 0;
}

arrow
arrow
    全站熱搜

    大神(偽) 發表在 痞客邦 留言(0) 人氣()