You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
python/TangDou/AcWing/MiniPath/POJ上的奇奇怪怪的CompileError.md

1.0 KiB

【C语言语法】 POJ上奇奇怪怪的Compile error

收集中,因为老在POJ上莫名奇妙地CE,所以记录一下出现过的错误

1.不能用万能头文件<bits/stdc++.h>

懒癌克星

2.不支持以{}的形式为结构体赋值:

typedef struct{
   int x,y,z;
   int step;
}pos;
 
pos S;  
queue <pos> q;
 
//以下三种方式都不行
S={i,j,k,0};      
S=pos{i,j,k,0};      
q.push({new_x,new_y,new_z,new_step});

3.需要加<string>头文件才能实现对string类型的某些操作

string类型判断两个字符串是否相等可以直接用==

但是在poj上没加<string>头文件会CE,我自己的编译器上不会,不知道是什么原因

4.不能以变量作为数组的size

 while(cin>>N&&N){
        string s[N+1];
 }

显示:

5.不能用distance作为函数名

貌似与xutility中的一个函数重名了?