请问这个程序哪里出了问题?
#include<stdio.h>
#include<string.h>
int main()
{
char str[100],c[100],*p=str,*q=c;
int l;
printf("请输入一个字符串\n");
scanf("%s",p);
l=strlen(str);
for(p=str;p<p+l;p++)
if(*p>='A'&&*p<='Z')
*(q++)=*p;
*q='\0';
q=c;
printf("字符串中的大写字符有\n");
printf("%s\n",q);
return 0;
}