求大神帮忙看看这个C语言程序哪里出错了。急!!!

2025-02-28 04:18:17
推荐回答(1个)
回答1:

#include 
int main() 
{//数组array存放想说的话  //下面这一句不要手动去换行
char array[6][60]={"To you","sweetheart","with all my love","There's someone who loves you far more than you know","with a love that keeps growing as days come and go","Have a very happy birthday!"}; 
char c; 
char name[20]={'\0'}; //这里加这个
int i=0,j=0; 
printf("请按enter键继续\n"); 
while((c=getchar())=='\n'&&i<6) 
printf("%s\n",array[i++]); 
printf("\n请输入你的名字(字母):"); 
while((name[j++]=getchar())!='\n'); 
printf("\n Happy birthday to "); 
puts(name); 
c=3; 
printf(" %c%c %c%c\n",c,c,c,c,c,c); 
printf(" %c %c %c %c\n",c,c,c,c); 
printf(" %c %c %c\n",c,c,c); 
printf(" %c forever %c\n",c,c); 
printf(" %c love %c\n",c,c); 
printf(" %c %c\n",c,c); 
printf(" %c %c\n",c,c); 
printf(" %c\n",c); 
getchar(); //这里
return 0; 
}