格式的错误?
sicily在线平台说是格式错误,但是我怎么样也不知道是哪里的问题。(前面是题目描述,最后是我的代码)求找问题,谢谢。
题目要求:
题目描述
The multiplication table was taught as an essential part of elementary arithmetic around the world. All children in primary school are required to memorize the table of 9×9, but better to memorize up to 25×25. Please write a program to generate a multiplication table of n (1<=n<=25) for the children’s math study.
输入格式
A positive integer between 1 and 25.
输出格式
The multiplication table of n. Tabs are used to separate the numbers in each line, and every line is ended by a newline (\n).
样例输入
将样例输入复制到剪贴板
2
样例输出
1 (printf format: %d\n)
2 4 (printf format: %d\t%d\n)
我的代码是:
#include<stdio.h>
int main()
{
int x,y;
int n;
scanf("%d",&n);
for(x=1;x<=n;x++)
{
for(y=1;y<=x;y++)
{
printf("%d\t",x*y);
}
printf("\n");
}
return 0;
}