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;
Ïà¹ØÎĵµ£º
#include<stdio.h>
#include<math.h>
float x1,x2,disc,p,q;
int main()
{
void greater_than_zero(float,float);
void equal_to_zero(float,float);
void smaller_than_zero(float,float);
float a,b,c;
printf("\ninput a,b,c:");
scanf("%f,%f,%f",&a,&b,&c) ......
µÚ¶þÕ Êý¾ÝÀàÐÍ
Ò»¡¢Êý¾ÝÀàÐÍ·ÖÀà
1 ÁªºÏÀàÐÍ
2 º¯ÊýÀàÐÍ
3 ÊýÁ¿ÀàÐÍ
3.1ËãÊõÀàÐÍ
¢Ù »ù±¾Êý¾ÝÀàÐÍ
ÕûÐÍ£¨°üÀ¨char£©
¸¡µãÐÍ ......
ת×Ô£º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
ÒÔÏÂÊÇÒýÓÃƬ¶Î£º
......
µÚ¶þÕ Õ÷·þ¿É²âÐÔÄÑÌâ
2.1 ¿É²âÐÔÎÊÌâÏê½â£¨1£©
µ¥Ôª²âÊÔЧÒæÌرð¸ß£¬·½·¨Ò²ºÜ¼òµ¥£¬µ«È´³¢ÊÔµÄÆóÒµºÜ¶à£¬³É¹¦ÊµÊ©µÄÆóÒµºÜÉÙ£¬ÎªÊ²Ã´ÄØ£¿Ö÷ÒªÔÒò¾ÍÊÇÄÑÓÚÍ»ÆƿɲâÐÔÎÊÌâ¡£“¿É²â”Õâ¸ö´Ê£¬Òâ˼ÒѾºÜÃ÷°×ÁË£¬Èç¹û²»“¿É²â”µÄ»°£¬ÄǾÍÊDz»Äܲ⣬û·¨²â£¬¾ÍÊÇ× ......
//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--;
......