[Collection] compilation errors

// the record about their own convenience troubleshooting qwq

 

1.  name lookup of '变量名' changed [enabled by default]3.

[ If nested local variable with the same name in the local scope will appear this error, which means that there has been redefined ]
2.reference to "xx" is ambiguous
[ Variable names defined function name may be a function library ]
[A] chestnuts
 1
//印象这鬼一样的排版emmmm
#include<bits/stdc++.h> 2 using namespace std; 3 int a[1000]; 4 int root,maxroot,n,m,x,y,MAX,sum; 5 int main() 6 { 7 ios::sync_with_stdio(false); 8 cin>>n>>m; 9 for(int i=1;i<=m;i++) 10 { 11 cin>>x>>y; 12 a[y]=x; 13 } 14 for(int i=1;i<=n;i++) 15 { 16 if(a[i]==0){root=i;break; 17 } 18 }cout<<root<<endl; 19 for(int i=1;i<=n;i++) 20 { 21 sum=0; 22 for(int j=1;j<=n;j++) 23 { 24 if(a[j]==i)sum++; 25 } 26 IF (SUM> MAX) MAX {= SUM; maxroot = i; // Police milo is his! max! ** Why max variable when the problem will be the title of it? ** Because the function library contains max function, use it to cause ambiguity Gan ah! 27 } 28 } COUT maxroot << << endl; 29 for ( int I = . 1 ; I <= n-; I ++ ) 30 { 31 is IF (A [I] == maxroot) COUT I << << " " ; 32 } 33 }

 

3.[Error] statement has no effect

[ Literal translation should be: an assignment is invalid!

Should be assigned to a global variable, this problem occurs]



 

Guess you like

Origin www.cnblogs.com/phemiku/p/10966277.html