Ò»¸ö¼òµ¥µÄcÓÎÏ·
13¸öÈËΧ³ÉһȦ£¬´ÓµÚÒ»¸öÈË¿ªÊ¼Ë³Ðò±¨ºÅ1£¬2£¬3¡£·²±¨µ½3ÕßÍ˳öȦ×Ó£¬ÕÒ³ö×îºóÁôÔÚȦ×ÓÖеÄÈËÔÀ´µÄÐòºÅ
½á¹ûÓ¦¸ÃÊÇ13 ¿ÉÎҵijÌÐòµÄ½á¹ûÊÇ11 Ï£ÍûºÃÐÄÈË°ï¸ÄÒ»ÏÂ
#include <stdio.h>
#include <stdlib.h>
int onlyone(int a[])
{
int i,k = 0;
for(i = 1;i <= 13;i++)
if(a[i] == 0)
k++;
if(k > 1)
return 0;
else if(k ==1)
return 1;
}
int main()
{
int a[13] = {0};
int i = 1,k = 0;
while(!onlyone(a))
{
if(a[i] == 0)
k++;
if(k == 3)
{
a[i] = 1;
k = 0;
}
i++;
if(i == 14)
i = 1;
}
printf("%d",i);
system("pause");
return 0;
}
for(i = 1;i <= 13;i++)
if(a[i] == 0)
k++; (´Ë´¦ÓÐa[13]³öÏÖ£¬ËùÒÔ˵Êý×éÔ½½ç£¡)
»¹ÓиöÎÊÌ⣺ʲôʱºò³ÌÐòÌø³öwhile(!onlyone(a))£¡Ó¦¸ÃÔÚֻʣÏÂÒ»¸öÈ˵Äʱºò£¬ÄÇ´Ëʱi
ÊÇʲôÊý£¿ËüÊÇ×îºóһλÍ˳öµÄÈË£¬¾¹ýi++ºóӦΪ9£¡Ò²¾ÍÊÇ˵×îºóһλÍ˳öµÄÊǵڰËλ£¡×îºó¿ÉÒÔ¸ÄΪ£º
for(i=1;i <=13;i++)
{
if(a[i]==0)
{printf("%d\n",i);
break;
}
}
/*
13¸öÈËΧ³ÉһȦ£¬
Ïà¹ØÎÊ´ð£º
ÈçÌ⣬C/C++ÖеÄexeclÔõôµ÷ÓÃдºÃµÄjava³ÌÐò£¬
execl("/opt/java1.5/bin/java","MyClass",NULL);
ÕâÑùµÄ²»ÐÐŶ¡£
²»»á.
ÔËÐÐjava³ÌÐò
ÕÒ¹¤¾ß²é¿´Ò»ÏÂÄǸö³ÌÐòµÄÃüÁîÐÐ
ËÑË÷Ï£ºjni ......
ͦ·±Ëö£¬Ö®Ç°·¢µÄÌû×Ó£¬·Öֵ̫µÍÏÖÔÚÖØ·¢Ò»¸ö¡£»¶Ó¸÷λ´óÏÀ~~
#include "stdlib.h"
#include "math.h"
#include "stdio.h"
float objfx(float x[]);
void constraint(float x[] ......
ÔھƵê¹ÜÀíϵͳÖÐ,ÓÐÒ»¸ö¶ÔÄÚµÄϵͳ,¹©Ç°Ì¨·þÎñÔ±ºÍ¾ÀíʹÓÃ
»¹ÓÐÒ»¸ö¾ÍÊǶÔÍâ,Èÿͻ§¿ÉÒÔÔÚÍøÉÏÔ¤¶©·¿¼ä,
ËüÃÇÖ®¼äÊÇÔõôͨѶµÄ.?µ±ÎÒÌá½»Ô¤¶©·¿¼äÐÅÏ¢µÄʱºò,
ÔÚ¶ÔÄÚµÄϵͳÖÐ,ÈçºÎÖªµÀÎÒÒѾÌá½»ÁËÐÅÏ¢¹ýÈ¥.Ê¹Ç ......
´ó¼ÒºÃ£¬ÎÒÊÇÐÂÊÖ£¬¸Õ¿ªÊ¼½Ó´¥C/S½á¹¹µÄ³ÌÐò£¬ÏëҪʵÏÖÒ»¸ö·ÖÒ³¹¦ÄÜ£¬´ó¼ÒÓÐûÓкõãµÄ·ÖÒ³¿Ø¼þ»òÕß³ÌÐòÖ®ÀàµÄ£¬µ±È»Ô´³ÌÐò¸üºÃ£¬·ñÔò˵˵Á÷³ÌÒ²¿ÉÒÔ£¬Ð¡Ãü±°¡£¬ÔÚÏߵȡ£¡£¡£¡£
´ó¼Ò°ï°ï棬лÁË£¡
×Ô¼ºÐ´Ñ½£¡
......
СµÜ×î½üÔÚÁ˽â¹ØÓÚtiny c µÄÎÊÌâ¡£ÔÚlinuxÏÂ×¼±¸°²×°¡£µ«°²×°Íê³ÉºóÅöµ½ÁËһЩÎÊÌ⡣ϣÍû´ó¼ÒÄܹ»°ïæ½â¾ö¡£ÒÔÏÂÊÇ°²×°Íê³ÉºóµÄÖ´Ðв½Öè¡£
[student@localhost ~]$ tcc -v
tcc version 0.9.25
[student@localhos ......