做乘法

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/weixin_43886377/article/details/100547383

Problem Description
请用C语言编写一个程序。此程序接收一个正整数N,然后打印输出“N次N*(1->N)格式”的数据。例如:此程序接收正整数5,那会输出以下格式的数据:
51=5
5
2=10
53=15
5
4=20
5*5=25

Input
只有一个正整数N(N<=100)。
Output

输出共N行数据,如上面的例子所示。
Sample Input
5
Sample Output
51=5
5
2=10
53=15
5
4=20
5*5=25
Hint
Source

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,i;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
      printf("%d*%d=%d\n",n,i,n*i);
    }
    return 0;

}

猜你喜欢

转载自blog.csdn.net/weixin_43886377/article/details/100547383