Wrong Answer
/in/foo.cc: In function 'int main()': /in/foo.cc:8:15: warning: 'n' is used uninitialized in this function [-Wuninitialized] for(int i=1;i<n;i++) ~^~
代码
#include<iostream>
using namespace std;
int main()
{
int n;
int sum=0;
int x,y,w;
for(int i=1;i<n;i++)
{
cin>>x>>y>>w;
sum+=w;
}
cout<<sum;
return 0;
}