99乘法表1
2017-09-16 08:46
260 查看
#include<iostream> #include<iomanip> using namespace std; int main(){ int a[10]={1,1,2,3,4,5,6,7,8,9}; cout<<setw(3)<<setfill(' ')<<"*"; for(int i=1;i<=9;i++) cout<<setw(3)<<setfill(' ')<<a[i] ; cout<<endl; for(int j=1;j<=9;j++) {for(int k=0;k<=j;k++) cout<<setw(3)<<setfill(' ')<<a[k]*a[j]; cout<<endl;} }
相关文章推荐