//对齐输出九九乘法口诀 #include <iostream> #include <iomanip.h> //using namespace std; int main() { int i,j; for(i=1;i<=9;i++) { for(j=1;j<=i;j++) { cout<<i<<"*"<<j<<"="<<setw(2)<<i*j<<" "; } cout<<endl; } return 0; } /* #include <stdio.h> int main() { int i,j; for(i=1;i<=9;i++) { for(j=1;j<=i;j++) { printf("%2d*%2d=%2d ",i,j,i*j); } printf("\n"); } return 0; } */ <img src="http://img.blog.csdn.net/20150515192602235?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvZG91ZG91d2ExMjM0/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
时间: 2024-10-22 22:44:07