// SnakeMatrix.cpp : Defines the entry point for the console application.// Create by Xianyi.Ye, May 4,2010#include "stdafx.h"#include <iostream.h>/*Question: Print a Sanke Matrix as followingi/j1234561 129102526243811242735671223284161
列印出所有的“水仙花數”,所謂“水仙花數”是指一個三位元,其各位元字立方和等於該數 本身。例如:153是一個“水仙花數”,因為153=1的三次方+5的三次方+3的三次方。1.程式分析:利用for迴圈控制100-999個數,每個數分解出個位,十位,百位。using System;using System.Collections.Generic;using System.Text;namespace EX100_13{ class Program { static
轉自 :http://blog.csdn.net/andylin02/archive/2008/11/14/3298409.aspxusing System;namespace NMCounter{ //run main class class CRunMain { public static int Main() { COperator objOpr = null; string strOpr;
題目:一個數如果恰好等於它的因子之和,這個數就稱為“完數”。例如6=1+2+3.編程// 找出1000以內的所有完數using System;using System.Collections.Generic;using System.Text;namespace Sf_13{ class Program { static void Main(string[] args) { int [] k = new int [11
Thinking in C++ C++編程思想 C++入門書籍,不多介紹 http://www.laixp.cn/soft/sort01/sort02/down-12215.html C++ Primer 5 th 也是一本入門書籍,很經典,初學者多看 http://www.laixp.cn/soft/sort01/sort02/down-11801.html http://www.laixp.cn/soft/sort01/sort02/down-11800.
Requirement:編寫一程式,把M×N矩陣a的元素逐列按降序排列。假設M、N不超過10。分別編寫求一維數組元素值最大和元素值最小的函數,主函數中初始化一個二維數組a[10][10],調用定義的兩函數輸出每行、每列的最大值 代碼:// MatrixSort.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include iostream.h>void bubble_sort(