C³ÌÐò£ºÅжÏÁ´±íÊÇ·ñÓл·
/*
ÕâÊǸö³£¼ûµÄÃæÊÔÌâŶ£¬×ÜÖ®ÎÒÃæÊÔµÄʱºòÓöµ½¹ý£¬ µ±Ê±Ã»ÓдðÉÏÀ´
»ØÈ¥ºóÏë³öÀ´ÏÂÃæµÄ·½·¨Ò»£¬¸Ã·¨»¹Óиö¸½¼ÓÓŵ㣬¿ÉÒÔÅжϳöÁ´±íÔÚÄĸöµØ·½Ðγɻ·µÄ£¨¼´Èç¹ûÏë²ð¿ªÕâ¸ö»·£¬´ÓÄĸöµØ·½¶Ï¿ª£©¡£
ºóÀ´ÖªµÀ»¹Óиö¾µäËã·¨£¬¼´Ê¹ÓÃÁ½¸öÖ¸Õ룬һ¿ìÒ»ÂýÏòǰÊÔ̽£¬Èç¹û×îÖÕÖØºÏÔòÁ´±íÓл·£¬¹ûÈ»ÓÅÃÀµÄËã·¨¡£
*/
#include <stdio.h>
typedef struct list {
int data;
struct list *next;
} LIST;
/* Method 1: check the occurrence of p->next from head to p */
int check_circle_1(LIST *head) {
LIST *p = head, *q= NULL;
if (p == NULL)
return 0;
while (p->next) {
/* check whether p points to itself */
if (p->next == p) {
return 1;
}
/* check the occurrence of p->next in head to p */
q = head;
while (q != p) {
if (q == p->next) {
return 1;
}
q = q->next;
Ïà¹ØÎĵµ£º
3.ÄÚ¹¦Ìâ
¡¡¡¡ÊÔÌâ1£º·Ö±ð¸ø³öBOOL£¬int£¬float£¬Ö¸Õë±äÁ¿ Óë“ÁãÖµ”±È½ÏµÄ if Óï¾ä£¨¼ÙÉè±äÁ¿ÃûΪvar£©
¡¡¡¡½â´ð£º
¡¡¡¡¡¡BOOLÐͱäÁ¿£ºif(!var)
¡¡¡¡¡¡intÐͱäÁ¿£º if(var==0)
¡¡¡¡¡¡floatÐͱäÁ¿£º
¡¡¡¡¡¡const float EPSINON = 0.00001;
¡¡¡¡¡ ......
#include <stdio.h>
#include <string.h> /* ³ÌÐò¶à´Îµ÷ÓÃbiodkey()£¬Ó¦°üº¬Í·Îļþbios.h */
#include <bios.h><br>/* ³ÌÐò¶à´Îµ÷ÓÃclrscr()£¬Ó¦°üº¬Í·Îļþconio.h */
#include <conio.h>
#define MAX 100
#define PAGE 2
#define PRINT1 printf("------------------------------ ......
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.spri ......
ת×Ô£ºhttp://dev.yesky.com/12/3067012.shtml
¶¯Ì¬Á¬½Ó¿âµÄ´´½¨²½Ö裺
¡¡¡¡Ò»¡¢´´½¨Non-MFC DLL¶¯Ì¬Á´½Ó¿â
¡¡¡¡1¡¢´ò¿ªFile —> New —> ProjectÑ¡ÏѡÔñWin32 Dynamic-Link Library —>sample project
¡¡¡¡—>¹¤³ÌÃû£ºDllDemo
¡¡¡¡2¡¢Ð½¨Ò»¸ö.hÎļþDllDemo.h
ÒÔÏÂÊÇÒýÓÃÆ¬¶Î£º
......
//ijˮÍõµÄ·¢ÌûÊý³¬¹ý×ÜÌùÊýµÄÒ»°ë£¬ÕÒ³öÖ®
int find(int *ID, int N)
{
int candidate;
int nTimes, i;
for (i = nTimes = 0; i < N; i++)
{
if (nTimes == 0)
{
candidate = ID[i];
nTimes = 1;
}
else if (candidate == ID[i])
{
nTimes++;
}
else
{
nTimes--;
......