问题及代码:
/*
*Copyright (c) 2014,烟台大学计算机学院
*All rights reserved.
*文件名称:test.cpp
*作者:吴胜男
*完成日期:2014年10月23日
*版本号:v1.0
*
*问题描述:输出一个乘法口诀表
*输入描述:
*程序输出:输出小九九
*/
#include <iostream>
using namespace std;
int main()
{
int i=1,j=1;
cout<<"我的小九九是:"<<endl;
for(i=1; i<=9; i++)
{
for(j=1; j<=i; ++j)
{
cout<<i<<"*"<<j<<"="<<i*j<<" ";
}
cout<<endl;
}
cout <<endl;
return 0;
}
运行结果:
知识点总结:结果很麻烦的程序,所以要找到窍门。运算式中各符号要分开写,才能输出算式。
学习心得:总之还要继续努力!