/in/foo.c:1:10: error: #include expects "FILENAME" or <FILENAME>
#include #include using namespace std;
^
/in/foo.c:10:1: error: unknown type name 'bool'
bool cmp(date x,date y)
^
/in/foo.c:10:10: error: unknown type name 'date'
bool cmp(date x,date y)
^
/in/foo.c:10:17: error: unknown type name 'date'
bool cmp(date x,date y)
^
/in/foo.c: In function 'main':
/in/foo.c:26:12: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
while(~scanf("%d/%d/%d",&a[k].month,&a[k].day,&a[k].year))//取反判断是否到文件末尾,或者这样写 while(cin >> a[k].month >> a[k].day >> a[k].year;)
^
/in/foo.c:26:12: warning: incompatible implicit declaration of built-in function 'scanf'
/in/foo.c:26:12: note: include '<stdio.h>' or provide a declaration of 'scanf'
/in/foo.c:28:5: warning: implicit declaration of function 'sort' [-Wimplicit-function-declaration]
sort(a,a + k,cmp);//结构体排序
^
/in/foo.c:28:18: error: 'cmp' undeclared (first use in this function)
sort(a,a + k,cmp);//结构体排序
^
/in/foo.c:28:18: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:30:8: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
printf("%02d/%02d/%d\n",a[i].month,a[i].day,a[i].year);//0是标识,可以补充前导零;2是宽度,表示最少位数
^
/in/foo.c:30:8: warning: incompatible implicit declaration of built-in function 'printf'
/in/foo.c:30:8: note: include '<stdio.h>' or provide a declaration of 'printf'