#include<stdio.h>
#include<string.h>
#include<stdlib.h>
main(){
int t;
int n;
int m;
int i;
char c;
int c1;
int c2;
char *q[20];
scanf("%d",&t);
q[0]=(char*)malloc(500);
while(t--){
scanf("%d %d",&n,&m);
getchar();
for(i=0;i<n;i++){
if(i!=0)
q[i]=(char*)malloc(100);
if(q[i]==NULL)
printf("gggg");
gets(q[i]);
}
for(i=1;i<=m;i++){
if(i!=1)
getchar();
scanf("%c %d %d",&c,&c1,&c2);
if(c=='A'){
strcat(q[c1-1],q[c2-1]);
}
if(c=='C'){
strcpy(q[c1-1],q[c2-1]);
}
}
printf("%s",q[0]);
for(i=0;i<n;i++){
strcpy(q[i],NULL);
}
}
for(i=0;i<n;i++){
free(q[i]);
q[i]=NULL;
}
}
```oj显示Runtime Error:Segmentation faul为什么
```c
c语言显示Runtime Error:Segmentation faul
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
3条回答 默认 最新
悬赏问题
- ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
- ¥88 找成都本地经验丰富懂小程序开发的技术大咖
- ¥15 如何处理复杂数据表格的除法运算
- ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
- ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
- ¥200 uniapp长期运行卡死问题解决
- ¥15 latex怎么处理论文引理引用参考文献
- ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
- ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
- ¥15 乘性高斯噪声在深度学习网络中的应用