ÊýѧÅÅÁÐ×éºÏËã·¨ P(N,M) C(N,M)
yeah£¬×éºÏµÄÒ²³öÀ´ÁË£¬ÔÙÒ»Æð·¢Ò»¸ö
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication32
{
class Program
{
static int s = 0;
static void Main(string[] args)
{
Console.WriteLine("ÊäÈëÒªÅÅÁеÄÊý×Ö");
string strs = Console.ReadLine();
List<string> list = new List<string>();
int a = 5;
Console.WriteLine("ÊäÈëÒªÅÅÁеĸöÊý");
int b = Int32.Parse(Console.ReadLine());
Compages(strs, "", list, b);
Console.WriteLine("_______________________________________");
for (int i = 0; i < list.Count; i++)
{
Console.WriteLine(list[i]);
}
Console.WriteLine("¹²£º"+s+"¸ö");
Console.Read();
}
/// <summary>
/// ÊýѧÅÅÁÐËã·¨P(N,M)
/// </summary>
/// <param name="num">ÐèÒªÅÅÁеÄ×Ö·û´®</param>
/// <param name="curnum"></param>
/// <param name="list">ÅÅÁгöµÄ×Ö·û´®¼¯ºÏ</param>
/// <param name="n">ÐèÒªÅÅÁеĸöÊý</param>
public static void Compute( string num,string curnum,List<string> list,int n)
{
for (int i = 0; i < num.Length; i++)
{
curnum+= num[i].ToString();
if (curnum.Length == n)
{
list.Add(curnum);
s++;
}
else
{
string temp = num.Remove(i, 1);
Compute(temp,curnum,list,n);
}
curnum = curnum.Remove(curnum.Length - 1, 1);
}
}
/// <summary>
/// Êýѧ×éºÏËã·¨ C(n,m)
/// </summary>
/// <param name="num">Òª×éºÏµ
Ïà¹ØÎĵµ£º
#include "mex.h"
#define DWORD long
#define NUMBER_OF_STRUCTS (sizeof(friends)/sizeof(struct phonebook))
#define NUMBER_OF_FIELDS (sizeof(field_names)/sizeof(*field_names))
void mexFunction(int nlhs,
mxArray * plhs[] , int nrhs,const mxArray * pahs[])
{
typedef struc ......
ÔÚC/C++ÖÐÎÒÃÇÓÐʱΪÁ˽ÚÊ¡ÄÚ´æÕ¼Óÿռ䣬ÐèҪʹÓõ½Î»Óò£¬ÈçÏÂËùʾ´úÂ룺
struct SDummy
{
int A : 2;
int B : 8;
int C : 12;
int D : 10;
};
ÔÚ¼ÆËã»úÄÚ´æ°º¹óµÄÇé¿öÏ£¬Î»Óò²»·¦ÎªÒ»ÖÖÓÐЧµÄ½ÚÊ¡ÄÚ´æÕ¼ÓÿռäÓÖÈôúÂëÊéд±È½ÏͨË×Ò׶®µÄ·½·¨¡£µ«ÊÇÔÚÏÖ½ñÄÚ´æÏà ......
ÓдÎÒ»¸öͬÊÂÎÊÎÒ
swc ^= swc;
ÊÇʲôÒâ˼,ÎÒÒ²²»ÖªµÀ,²éÁËÏÂ,Òâ˼Ӧ¸ÃÊǽ«swc±äÁ¿Çå0£¬ÒÉ»óµÄÊÇΪʲô¾Í²»ÄÜд³É swc = 0; ÄØ?²»Ã÷°×
˳±ã¼Ç¼ÏÂÆäËûµÄ²Ù×÷,Åöµ½ÐµÄÔÙ×·¼Ó:
swc = ~swc; //±äÁ¿È¡·´ ......
ÕâƪÎÄÕÂÖмǼ±¾È˶ÔһЩC/C++»ù´¡¸ÅÄîµÄÀí½â£¬Ö÷Òª°üÀ¨ÒÔϼ¸¸ö·½ÃæÄÚÈÝ£º
1¡¢ÀàÐÍת»»
1¡¢ÀàÐÍת»»
ÔÚCºÍC++µÄÒ»¸ö±í´ïʽÖÐÍùÍù»á°üº¬¼¸ÖÖ²»Í¬µÄÊý¾ÝÀàÐÍ£¬ÒªÈÃÕâЩÊý¾ÝÀàÐÍÖ®¼ä¿ÉÒÔ½øÐÐÔËË㣬±ØÐëÈÃËûÃÇÖ®ÖеÄһЩ»òÈ«²¿½øÐÐÀàÐÍת»»£¬ÕâÖÖת»»ÓÐÁ½ÖÖÐÎʽ£¬Ò»ÖÖÊDZàÒëÆ÷×Ô¶¯½øÐеģ¬½ÐÒþʽÀàÐÍת»»£¬ÁíÒ»ÖÖÊDZà³ÌÖÐÇ ......