Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

C Ö®±­

1.ÓÐn¸öÕûÊý£¬Ê¹Ç°Ãæ¸÷Êý˳ÐòÏòºóÒÆm¸öλÖã¬×îºóm¸öÊý±ä³É×îÇ°Ãæm¸öÊý¡£
#include<stdio.h>
int f(int *);
int main()
{
int *p,a[10];
for(p=a;p<a+10;p++)
scanf("%d",p);
f(a);
for(p=a;p<a+10;p++)
printf("%d ",*p);
return 0;
}
int f(int *a)
{
int i,*p,b[10];
for(p=a;p<a+10;p++)
{
if(p-a<10-3)
b[p-a+3]=*p;
else
b[p-a-10+3]=*p;
}
for(i=0,p=b;p<b+10;i++,p++)
a[i]=*p;
return 0;
}

2.ÓÐn¸öÈËΧ³ÉһȦ£¬Ë³ÐòÅźš£´ÓµÚ1¸öÈË¿ªÊ¼±¨Êý£¨´Ó1µ½3±¨Êý£©£¬·²±¨µ½3µÄÈËÍ˳öȦ×Ó£¬ÎÊ×îºóÁôϵÄÊÇÔ­À´µÚ¼¸ºÅµÄÄÇλ¡£
#include<stdio.h>
int main()
{
int *p,*q,r=1,i,t=0,n,a[100];
for(i=0;i<100;i++)
a[i]=i+1;
p=a;
printf("input the number of people:");
scanf("%d",&n);
while(t!=n-1)
{
if(p-a==n) p=q;
if(r==3&&*p!=0)
{
*p=0;
r=1;
t++;
}
if(*p!=0) r++;
for(i=0;i<n;i++)
{
if(a[i]!=0)
{
q=&a[i];
break;
}
}
p++;
}
printf("the final one is No.%d\n",*q);
return 0;
}


Ïà¹ØÎĵµ£º

B/SºÍC/S


c/sÊǿͻ§¶ËºÍ·þÎñÆ÷£¬b/sÊÇä¯ÀÀÆ÷ºÍ·þÎñÆ÷¡£
c/sÔÚ¿Í»§¶ËÒª°²×°Èí¼þµÄ£¬b/sÖ»ÒªÓÐIE¾Í¿ÉÒÔä¯ÀÀ¡£
c/sµÄÀ©Õ¹Éý¼¶±È½ÏÀ§ÄÑ£¬b/s¾ÍºÜÈÝÒ׵ġ£
c/sµÄ°²È«ÐÔºÃһЩ£¬b/s¾ÍûÓÐc/sµÄ¸ß¡£
c/sÒ»°ãÓÃÔÚ¾ÖÓòÍø£¬b/sÒ»°ãÓÃÔÚ¹ãÓòÍø¡£
------------------------------------------------
C/SÔËÓÃÔÚÓÐרÓÃÐԵij¡ºÏ¡£±ÈÈç ......

(ת)C/C++ÖеÄÈÕÆÚºÍʱ¼ä time_tÓëstruct tmת»»

(ת)C/C++ÖеÄÈÕÆÚºÍʱ¼ä time_tÓëstruct tmת»»
ͻ񻣼
±¾ÎÄ´Ó½éÉÜ»ù´¡¸ÅÄîÈëÊÖ£¬Ì½ÌÖÁËÔÚC/C++ÖжÔÈÕÆÚºÍʱ¼ä²Ù×÷ËùÓõ½µÄÊý¾Ý½á¹¹ºÍº¯Êý£¬²¢¶Ô¼ÆÊ±¡¢Ê±¼äµÄ»ñÈ¡¡¢Ê±¼äµÄ¼ÆËãºÍÏÔʾ¸ñʽµÈ·½Ãæ½øÐÐÁ˲ûÊö¡£±¾ÎÄ»¹Í¨¹ý´óÁ¿µÄʵÀýÏòÄãչʾÁËtime.hÍ·ÎļþÖÐÉùÃ÷µÄ¸÷ÖÖº¯ÊýºÍÊý¾Ý½á¹¹µÄÏêϸʹÓ÷½·¨¡£
¹Ø¼ü×Ö£ºUTC£¨ÊÀ½ç±ê ......

C Runtime LibraryÏê½â

.¸ÅÂÛ
¡¡¡¡ÔËÐÐʱ¿âÊdzÌÐòÔÚÔËÐÐʱËùÐèÒªµÄ¿âÎļþ£¬Í¨³£ÔËÐÐʱ¿âÊÇÒÔLIB»òDLLÐÎʽÌṩµÄ¡£
    CÔËÐÐʱ¿âµ®ÉúÓÚ20ÊÀ¼Í70Äê´ú£¬µ±Ê±µÄ³ÌÐòÊÀ½ç»¹ºÜµ¥´¿£¬Ó¦ÓóÌÐò¶¼Êǵ¥Ï̵߳쬶àÈÎÎñ»ò¶àÏ̻߳úÖÆÔÚ´Ëʱ»¹ÊôÓÚйÛÄî¡£ËùÒÔÕâ¸öʱÆÚµÄCÔËÐÐʱ¿â¶¼Êǵ¥Ï̵߳ġ£
¡¡¡¡Ëæ×ŲÙ×÷ϵͳ¶àÏ̼߳¼ÊõµÄ·¢Õ¹£¬×î³õµÄCÔ ......

Ò»¸öC++µ÷ÓÃCµÄÀý×Ó

//cExample.h
#ifndef C_EXAMPLE_H
#define C_EXAMPLE_H
#ifdef __cplusplus
extern "C"
{
#endif
int add(int x, int y);
#ifdef __cplusplus
}
#endif
#endif
---------------------------------
//cExample.c
#include"cExample.h"
int add(int x, int y)
{
 return x + y;
}
----------------- ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ