标题:格式的错误?
只看楼主
glglzb
Rank: 2
等 级:论坛游民
帖 子:47
专家分:22
注 册:2011-10-12
结帖率:93.33%
已结贴  问题点数:15 回复次数:2 
格式的错误?
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;
}
搜索更多相关主题的帖子: essential positive children generate required 
2012-01-25 21:06
beyondyf
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
等 级:贵宾
威 望:103
帖 子:3282
专家分:12654
注 册:2008-1-21
得分:15 
错误应该是在每行末多输出了一个制表符

重剑无锋,大巧不工
2012-01-25 21:12
glglzb
Rank: 2
等 级:论坛游民
帖 子:47
专家分:22
注 册:2011-10-12
得分:0 
OK  通过  谢谢版主
2012-01-25 21:23



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-360008-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.296691 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved