An easy problem
来源:互联网 发布:淘宝 剑三测试激活码 编辑:程序博客网 时间:2024/05/15 21:34
An easy problem
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5727 Accepted Submission(s): 4008
Problem Description
In this problem you need to make a multiply table of N * N ,just like the sample out. The element in the ith row and jth column should be the product(乘积) of i and j.
Input
The first line of input is an integer C which indicate the number of test cases.
Then C test cases follow.Each test case contains an integer N (1<=N<=9) in a line which mentioned above.
Then C test cases follow.Each test case contains an integer N (1<=N<=9) in a line which mentioned above.
214
HintThere is no blank space at the end of each line.
#include <stdio.h>int main(){int a[10][10];int n,m,i,j;scanf("%d",&n);while (n--){scanf("%d",&m);for (i=1;i<=m;i++){for (j=1;j<=m;j++){a[i][j]=i*j;}}for (i=1;i<=m;i++){for (j=1;j<m;j++){printf("%d ",a[i][j]);}printf("%d",j*i);//这一个完美解决最后一行省去空格的问题,真心不错!printf("\n");}}}
0 0
- An Easy Problem
- 2055 An easy problem
- An Easy Problem!
- An Easy Problem!
- poj2826 An Easy Problem?!
- HDOJ2055 An easy problem
- An Easy Problem
- hdu-An Easy Problem
- hdu2601 An easy problem
- An Easy Problem
- hdu-An Easy Problem
- HDU_2055 An easy problem
- HDU_2123 An easy problem
- B - An easy problem
- B - An easy problem
- An easy problem
- An easy problem 2132
- An easy problem 2123
- JavaScript_正则表达式_验证手机号
- 《嵌入式linux系统工程师实训教程》读书笔记
- IT增值服务实践心得体会:企业客户的钱比个人客户好赚得多
- 【剑指Offer面试编程题】题目1356:孩子们的游戏(圆圈中最后剩下的数)--九度OJ
- HTTP 错误 403.14 - Forbidden
- An easy problem
- C++中智能指针的设计和使用
- 三省斋之一
- 重温WIN32 API ------ SetTimer()无窗口调用方式
- android控件属性
- jsp乱码问题
- cocos2d setTextureRect用法
- 求10个数中最大值
- JS定时器