c C++СÎÊÌâ - C/C++ / C++ ÓïÑÔ
#include<stdio.h>
#include<malloc.h>
#include<iostream.h>
#define MAX 4
#define null 0
typedef struct ArcNode{
int adjvex;
struct ArcNode *nextarc;
}ArcNode;
typedef struct VNode{
char data;
ArcNode *firstarc;
}VNode,AdjList[MAX];
typedef struct{
AdjList vertices;
int vexnum,arcnum;
}ALGraph;
void insertv(ALGraph &Alg)
{
for(int i=0;i<Alg.vexnum;i++)
{
cout<<"ÊäÈë:";//¸ÄΪprintf("ÊäÈë\n");Ôõô²»¶ÔÄØ£¿
cin>>Alg.vertices[i].data;//¸ÄΪÕâ¸öscanf("%c",&Alg.vertices[i].data);Ôõô²»¶ÔÄØ
Alg.vertices[i].firstarc=null;
}
}
void main()
{
ALGraph alg;
printf("ÊäÈë½ÚµãÊýÓë±ßÊý\n");
scanf("%d%d",&alg.vexnum,&alg.arcnum);
insertv(alg);
}
²»Ó¦¸Ã°¡£¬Ê²Ã´´íÎó£¿
ÊäÈë´ÎÊý²»Ò»Ñù£¬Èç¹ûÊÇcinÔòΪAlg.vexnum´ÎÊäÈ룬Èç¹ûÊÇscanf Ôò²»ÊÇ
ÒòΪscanf¶ÁÈ¡×Ö·ûµÄʱºò»á³å»º³åÇø¶ÁÈ¡'\n'×Ö·û£¬ËùÒԲŻá³öÏÖÂ¥Ö÷Ëù˵µÄÎÊÌ⣬
¶øcinÔò²»»á¶ÁÈ¡'\n'×Ö·û¡£
ÎÊÌâµÄ½â¾öÊÇ£ºÔÚ¶ÁÈ¡×Ö·ûµÄʱºò×ö'\n'Åжϣ¬Èç¹ûÈ¡µ½ÁË'\n'×Ö·û£¬ÔòÉáÈ¥£¬ÖØжÁÈ¡
¡£¡£¡£¡£
Õý½â
Ïà¹ØÎÊ´ð£º
´ó¼ÒºÃ£º
ÎÒÏëʵÏÖ¼ì²âµ½²åÈëSD¿¨ºó×Ô¶¯½«SD¿¨¸ñʽ»¯µÄ¹¦ÄÜ£¬²»ÖªC/C++ÖÐÓÐûÓиñʽ»¯UÅ̵ĺ¯Êý£¿
ÁíÍ⣬ÎÒ²»ÏëʹÓÃSHFormatDrive£¬ÒòΪÕâ¸öº¯Êý»áµ¯³öÊÇ·ñÒª¸ñʽ»¯µÄÌáʾ¿ò£¬ÎÒÐèÒªµÄÊÇϵͳ×Ô¶¯¸ñʽ»¯£¬¶ø²Ù×÷Õß² ......
ÔÚ¸ùĿ¼/libÖдæ·ÅÒ»¸ölog.c£¬log.h£¬²¢ÓÃÏÂÃæµÄÓï¾ä£º
gcc -c log.c
ar crv liblog.a log.o
±àÒë³öÒ»¸öliblog.a¾²Ì¬¿â£¬È»ºóÔÚÎļþ¼Ð£º/testfileÖд´½¨Ò»¸ötest.cºÍtestc.c£¬test.cÖÐÒýÓÃÁËtestc.cÖж¨ÒåµÄ·½·¨ ......
ͦ·±Ëö£¬Ö®Ç°·¢µÄÌû×Ó£¬·Öֵ̫µÍÏÖÔÚÖØ·¢Ò»¸ö¡£»¶Ó¸÷λ´óÏÀ~~
#include "stdlib.h"
#include "math.h"
#include "stdio.h"
float objfx(float x[]);
void constraint(float x[] ......
A±í ÓÐÁ½¸ö×Ö¶Î
id ΨһÊý×ÖÓò
InfoTxt text ÀàÐÍ
ÎÒÏÖÔÚÒª°Ñ id ²»ÊÇ14 µÄËùÓÐ InfoTxt×ֶΠÎı¾ºóÃæ ¶¼¼ÓÉÏ 'aaa'
°´ÏÂÃæÖ´ÐÐÏÂÀ´ Ö»Óбí×îºóÒ»ÐмÓÉÏÁË 'aaa' ......