我vc6和dev-cpp都可以编译啊。。你的报错是啥啊?
另外,你的代码应该有一些错误,我改过了之后是这样的(输入:字符+空格+行数+空格+列数)
#include <stdio.h>
void display(char cr,int lines,int width);
int main(void){
char ch;
int rows,cols;
printf("Enter a character and two integers:\n");
while((ch=getchar())&&(getchar()!='\n')){
scanf("%d %d",&rows,&cols);
display(ch,rows,cols);
printf("Enter another character and two integers:\n");
printf("Enter a newline to quit.\n");
}
printf("Bye.\n");
return 0;
}
void display(char cr,int lines,int width){
int row,col;
for(row=1;row<=lines;row++){
for(col=1;col<=width;col++){
putchar(cr);
}
putchar('\n');
}
}