题目描述
输入一个整数N,输出N的乘法表,如下:
C++
#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
for(int i=1;i<=10;i++){
cout<<i<<" x "<<n<<" = "<<i*n<<endl;
}
return 0;
}
java
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner s=new Scanner(System.in);
int n=s.nextInt();
for(int i=1;i<11;i++){
System.out.println(i+" x "+n+" = "+i*n);
}
s.close();
}
}