範例碼(一):C/C++ 語言 99 乘法表。

#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>

int main(int argc, char *argv[])
{
	int x,y;
	for(x=1; x < 10 ; ++x)
	{
		for(y=1; y <= x ; y++)
		{
			if(y == 1)
			{
			printf("%d * %d = %d",y,x,(x*y));
			}
			else
			{
			printf("\t%d * %d = %d",y,x,(x*y));
			}
		}
		printf("\n");
	}
	
	return 0;
}

執行結果:

201304101356    

arrow
arrow
    文章標籤
    C 語言 九九乘法表
    全站熱搜

    mitblog 發表在 痞客邦 留言(0) 人氣()