2010年9月24日 星期五

2010/9/24 九九乘法表

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
          
            int[,] arr1 =new int[10,10];
         
            for (int i = 1; i <= 9; i++)
            {
                for (int j = 1; j <= 9; j++)
                {
                    arr1[i, j] = i * j;
                  
                }
            }

            for (int a = 1; a <= 9; a++)
            {
                for (int b = 1; b <= 9; b++)
                {
                    Console.WriteLine(a + "*" + b + "=" + arr1[a, b]);
                }
            }

2010年9月17日 星期五

2010/09/17 c++ 1+....+100=

#include <iostream>
using namespace std;
int main()
{
    int add=0;
    for (int b=1;b<=100;b++)
    add=add+b;
    printf ("%d",add);
    system("pause");
}