更新时间:2021-07-20 09:54:37
在您的代码中,则变量"i"没有初始化.
也许您可以更改"for(i = 0; i< n; i ++)".>
In your code,the variables "i" isn''t initialize.
maybe you can change "for(i=0;i<n;i++)".>
您的问题不清楚,您的英语也不清楚(抱歉表示... )
Your question is not clear and so is your English (sorry for indicating that...)
如果输出应为20星(*
),则可以通过以下方式进行操作:
If the output should be 20 stars (*
), you can do it in the this way:
#include <stdio.h>
#include <string.h>
#include <conio.h>
int main ()
{
char str[21]; //21 because 20 stars and '\0' at the end
strcpy (str,"*********************"); //fill
//or char str[21] = {"*********************"};
//or char str[] = {"*********************"}; //automatically preserve the size
printf(str);
getch();
return 0;
}
C-我差点忘了它;)
C - i almost forgot it ;)