Ò»¸ö¼òµ¥µÄ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¸öÈËΧ³ÉһȦ£¬
Ïà¹ØÎÊ´ð£º
ÓÐÒ»10*10¾ØÕ󣬳ýÈ¥µÚÒ»¸öµã£¨0£¬0£©ºÍ×îºóÒ»µã£¨9£¬9£©£¬»¹Óа˸öµãΪ1£¬ÆäËû¶¼Îª0£¬ÒªÇóÓöþάÊý×é±íʾ¡£°Ë¸öµãÊÇËæ»úÉú³ÉµÄ£¬±àдÏà¹Ø³ÌÐò±íʾ¾ØÕóËùÓпÉÄÜÇé¿ö¡£
ÕæÐÄÇó½Ì¸÷λ¸ßÊÖ£¬°¥£¡±¾ÈËÌ«²ËÁË£¡ºÇºÇ£¡
......
ͦ·±Ëö£¬Ö®Ç°·¢µÄÌû×Ó£¬·Öֵ̫µÍÏÖÔÚÖØ·¢Ò»¸ö¡£»¶Ó¸÷λ´óÏÀ~~
#include "stdlib.h"
#include "math.h"
#include "stdio.h"
float objfx(float x[]);
void constraint(float x[] ......
ÎÒ¸Õ°ÑÌ·ºÆÇ¿µÄµÚÈý°æµÄÊéѧÍ꣬ÎÒÖªµÀµÄÓÐC++£¬CºÍÖ¸Õë CȱÏݺÍÏÝÚå Cר¼Ò±ä³É£¬»¹ÓÐÊý¾Ý½á¹¹£¬ÎÒÏëÎÊÎÊÎÒÓ¦¸ÃÒÔʲô˳ÐòÀ´Ñ§ÄØ
CȱÏݺÍÏÝÚå Cר¼Ò±à³Ì
Êǽø½×µÄ£¬²»Óü±×Å¿´
ÖÁÓÚ
CºÍÖ¸Õë
Äã²»Àí½âÖ ......
A±í ÓÐÁ½¸ö×Ö¶Î
id ΨһÊý×ÖÓò
InfoTxt text ÀàÐÍ
ÎÒÏÖÔÚÒª°Ñ id ²»ÊÇ14 µÄËùÓÐ InfoTxt×ֶΠÎı¾ºóÃæ ¶¼¼ÓÉÏ 'aaa'
°´ÏÂÃæÖ´ÐÐÏÂÀ´ Ö»Óбí×îºóÒ»ÐмÓÉÏÁË 'aaa' ......