65,210
社区成员
发帖
与我相关
我的任务
分享1>------ Build started: Project: what, Configuration: Debug Win32 ------
1>Compiling...
1>data.c
1>f:\abc\what\what\data.c(27) : error C2143: syntax error : missing ';' before 'type'
1>f:\abc\what\what\data.c(28) : error C2143: syntax error : missing ';' before 'type'
1>f:\abc\what\what\data.c(29) : error C2065: 'i' : undeclared identifier
1>f:\abc\what\what\data.c(29) : error C2065: 'i' : undeclared identifier
1>f:\abc\what\what\data.c(29) : error C2065: 'i' : undeclared identifier
1>f:\abc\what\what\data.c(30) : error C2065: 'j' : undeclared identifier
1>f:\abc\what\what\data.c(30) : error C2065: 'j' : undeclared identifier
1>f:\abc\what\what\data.c(30) : error C2065: 'j' : undeclared identifier
1>f:\abc\what\what\data.c(31) : error C2065: 'i' : undeclared identifier
1>f:\abc\what\what\data.c(31) : error C2065: 'j' : undeclared identifier
1>f:\abc\what\what\data.c(34) : error C2143: syntax error : missing ';' before 'type'
1>f:\abc\what\what\data.c(35) : error C2143: syntax error : missing ';' before 'type'
1>f:\abc\what\what\data.c(36) : error C2143: syntax error : missing ';' before 'type'
1>f:\abc\what\what\data.c(37) : error C2065: 'i' : undeclared identifier
1>f:\abc\what\what\data.c(37) : error C2065: 'i' : undeclared identifier
1>f:\abc\what\what\data.c(37) : error C2065: 'i' : undeclared identifier
1>f:\abc\what\what\data.c(39) : error C2065: 'true' : undeclared identifier
1>f:\abc\what\what\data.c(40) : error C2065: 'tempa' : undeclared identifier
1>f:\abc\what\what\data.c(41) : error C2065: 'tempb' : undeclared identifier
1>f:\abc\what\what\data.c(42) : error C2065: 'tempa' : undeclared identifier
1>f:\abc\what\what\data.c(42) : error C2065: 'tempb' : undeclared identifier
1>f:\abc\what\what\data.c(43) : error C2065: 'tempa' : undeclared identifier
1>f:\abc\what\what\data.c(43) : error C2065: 'tempa' : undeclared identifier
1>f:\abc\what\what\data.c(43) : error C2065: 'tempb' : undeclared identifier
1>f:\abc\what\what\data.c(44) : error C2065: 'tempb' : undeclared identifier
1>f:\abc\what\what\data.c(44) : error C2065: 'tempa' : undeclared identifier
1>f:\abc\what\what\data.c(44) : error C2065: 'tempb' : undeclared identifier
1>f:\abc\what\what\data.c(45) : error C2065: 'tempa' : undeclared identifier
1>f:\abc\what\what\data.c(45) : error C2065: 'tempa' : undeclared identifier
1>f:\abc\what\what\data.c(45) : error C2065: 'tempb' : undeclared identifier
1>f:\abc\what\what\data.c(47) : error C2065: 'tempa' : undeclared identifier
1>f:\abc\what\what\data.c(47) : error C2065: 'tempb' : undeclared identifier
1>f:\abc\what\what\data.c(47) : error C2065: 'tempa' : undeclared identifier
1>f:\abc\what\what\data.c(47) : error C2065: 'tempb' : undeclared identifier
1>f:\abc\what\what\data.c(48) : error C2065: 'tempa' : undeclared identifier
1>f:\abc\what\what\data.c(48) : error C2065: 'tempb' : undeclared identifier
1>f:\abc\what\what\data.c(52) : error C2065: 'i' : undeclared identifier
1>f:\abc\what\what\data.c(52) : error C2065: 'tempa' : undeclared identifier
1>f:\abc\what\what\data.c(53) : error C2065: 'i' : undeclared identifier
1>f:\abc\what\what\data.c(53) : error C2065: 'tempb' : undeclared identifier
1>f:\abc\what\what\data.c(54) : error C2143: syntax error : missing ';' before 'type'
1>f:\abc\what\what\data.c(55) : error C2065: 'UsedValue' : undeclared identifier
1>f:\abc\what\what\data.c(55) : warning C4022: 'memset' : pointer mismatch for actual parameter 1
1>f:\abc\what\what\data.c(55) : error C2065: 'UsedValue' : undeclared identifier
1>f:\abc\what\what\data.c(56) : error C2143: syntax error : missing ';' before 'type'
1>f:\abc\what\what\data.c(56) : error C2143: syntax error : missing ';' before 'type'
1>f:\abc\what\what\data.c(56) : error C2143: syntax error : missing ')' before 'type'
1>f:\abc\what\what\data.c(56) : error C2143: syntax error : missing ';' before 'type'
1>f:\abc\what\what\data.c(56) : error C2065: 'j' : undeclared identifier
1>f:\abc\what\what\data.c(56) : warning C4552: '<' : operator has no effect; expected operator with side-effect
1>f:\abc\what\what\data.c(56) : error C2059: syntax error : ')'
1>f:\abc\what\what\data.c(56) : error C2065: 'j' : undeclared identifier
1>f:\abc\what\what\data.c(56) : error C2143: syntax error : missing ';' before '{'
1>f:\abc\what\what\data.c(60) : error C2065: 'UsedValue' : undeclared identifier
1>f:\abc\what\what\data.c(60) : error C2109: subscript requires array or pointer type
1>f:\abc\what\what\data.c(61) : error C2065: 'UsedValue' : undeclared identifier
1>f:\abc\what\what\data.c(61) : error C2109: subscript requires array or pointer type
1>f:\abc\what\what\data.c(65) : error C2065: 'i' : undeclared identifier
1>f:\abc\what\what\data.c(65) : error C2065: 'j' : undeclared identifier
1>f:\abc\what\what\data.c(65) : error C2065: 'tempa' : undeclared identifier
1>f:\abc\what\what\data.c(66) : error C2065: 'i' : undeclared identifier
1>f:\abc\what\what\data.c(66) : error C2065: 'j' : undeclared identifier
1>f:\abc\what\what\data.c(66) : error C2065: 'tempb' : undeclared identifier
1>Build log was saved at "file://f:\abc\what\what\Debug\BuildLog.htm"
1>what - 61 error(s), 2 warning(s)#include "data.h"
#include <time.h>
#include <stdlib.h>
#include <memory.h>
#define SIZE 1000 //最大变量的个数
#define CURSIZE 100
int variable,domain;
double density,relaxation;
double res,nvalue;
struct consistency var[SIZE];
int IsUsed[CURSIZE][CURSIZE];
void IniData(int V,int DOM,double DEN,double REL)
{
variable=V;
density=DEN;
domain=DOM;
relaxation=REL;
res=variable*(variable-1)/2*density;
nvalue=variable*variable*REL;
}
void GenerateCon(int V,int DOM,double DEN,double REL)
{
IniData(V,DOM,DEN,REL);
memset(IsUsed,0,sizeof(IsUsed));
int i;
int j;
for( i=0;i<CURSIZE;++i){
for(j=0;j<CURSIZE;++j){
IsUsed[i][j]=0;
}
};
int tempa;
int tempb;
int i;
for(i=0;i<res;++i){
srand((unsigned)time(NULL));
while(true){
tempa=rand()%variable;
tempb=rand()%variable;
if(tempa>tempb){
tempa=tempa^tempb;
tempb=tempa^tempb;
tempa=tempa^tempb;
}
if(!IsUsed[tempa][tempb]&&(tempa!=tempb)){
IsUsed[tempa][tempb]=1;
break;
}
}
var[i].x1=tempa;
var[i].x2=tempb;
int UsedValue[CURSIZE][CURSIZE];
memset(UsedValue,0,sizeof(UsedValue));
for(int j=0;j<nvalue;++j){
while(1){
int tempa=rand()%domain;
int tempb=rand()%domain;
if(!UsedValue[tempa][tempb]&&tempa!=tempb){
UsedValue[tempa][tempb]=1;
break;
}
}
var[i].value[j].x1_cost=tempa;
var[i].value[j].x2_cost=tempb;
}
}
}
void GenerateCon(int V,int DOM,double DEN,double REL)
{
IniData(V,DOM,DEN,REL);
memset(IsUsed,0,sizeof(IsUsed));
int i;
int j;
int tempa;
int tempb; //c语言,变量声明必须都放前面……
for( i=0;i<CURSIZE;++i){
for(j=0;j<CURSIZE;++j){
IsUsed[i][j]=0;
}
};
for(i=0;i<res;++i){
srand((unsigned)time(NULL));
while(true){
tempa=rand()%variable;
tempb=rand()%variable;
if(tempa>tempb){
tempa=tempa^tempb;
tempb=tempa^tempb;
tempa=tempa^tempb;
}
if(!IsUsed[tempa][tempb]&&(tempa!=tempb)){
IsUsed[tempa][tempb]=1;
break;
}
}
var[i].x1=tempa;
var[i].x2=tempb;
int UsedValue[CURSIZE][CURSIZE];
memset(UsedValue,0,sizeof(UsedValue));
for(int j=0;j<nvalue;++j){
while(1){
int tempa=rand()%domain;
int tempb=rand()%domain;
if(!UsedValue[tempa][tempb]&&tempa!=tempb){
UsedValue[tempa][tempb]=1;
break;
}
}
var[i].value[j].x1_cost=tempa;
var[i].value[j].x2_cost=tempb;
}
}
}#ifndef DATA
#define DATA
#define SIZE 1000
struct cost{
int x1_cost;
int x2_cost;
};
struct consistency{
int x1;
int x2;
struct cost value[SIZE];
};
void IniData(int V,int DOM,double DEN,double REL);
void GenerateCon(int V,int DOM,double DEN,double REL);
#endif#include <stdio.h>
//#include "data.h"
int main ()
{
//GenerateCon(7,7,0.4,0.4);
printf("saldkjflsakdjf");
return 0;
}