做乘法

来源:互联网 发布:淘宝客服昵称怎么改 编辑:程序博客网 时间:2024/04/27 20:46

Problem Description

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

Input

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

Output


输出共N行数据,如上面的例子所示。

Example Input

5

Example Output

5*1=55*2=105*3=155*4=20

5*5=25

#include<stdio.h>int main(){int n,mul=0;scanf("%d",&n);for(int i=1;i<=n;i++){mul=n*i;printf("%d*%d=%d\n",n,i,mul);}return 0;}

0 0