mọi người cho e hỏi chỗ này sai là vì sao và phải sửa như thế nào ạ. em cảm ơn ạ
Đề bài: Viết chương trình nhập vào n và in ra hình theo quy luật
INPUT
5
OUTPUT
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25
#include <stdio.h>
int main()
{
int n,a;
scanf("%d",&a);
n=1;
While(n<=(a*a))
{
if(n%a==0)
{
printf(" %d\n",n);
n=n+1;
}
else
{
printf(" %d",n);
n=n+1;
}
}
}
Line | Col | File | Message |
---|---|---|---|
C:\Users\PL_FR_HP\Desktop\Dev C\Untitled1.cpp | in function 'int main()' | ||
C:\Users/PL_FR_HP\Desktop\Dev C\Untitled1.cpp | [Error] ‘While’ was not in this scope |