compilation error!哥哥姐姐求解~
Getting complication error information failed!这是我的代码
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
struct WoodenStick
{
int length;
int weight;
};
bool cmp(const WoodenStick &w1, const WoodenStick &w2)
{
if (w1.length < w2.length&&w1.weight < w2.weight)
return true;
else
return false;
}
void TimeSaving(int n, WoodenStick w[], bool b[])
{
memset(b, false, sizeof(b));
b[0] = false;
int t = 0;
for (int i = 0; i < n; i++)
{
for (int i = t; i < n; i++)
if (b[i] == false)
{
t = i + 1;
break;
}
for (int i = t; i < n; i++)
{
if (w[i].length >= w[t-1].length&&w[i].weight >= w[t-1].weight)
{
b[i] = true;
}
}
}
}
int main()
{
WoodenStick ws[100];
bool b[100];
int n,TestTimes;
cin >> TestTimes;
for (int i = 0; i < TestTimes; i++)
{
int time = 0;
cin >> n;
for (int i = 0; i < n; i++)
cin >> ws[i].length >> ws[i].weight;
sort(ws, ws + n, cmp);
TimeSaving(n, ws, b);
for (int i = 0; i < n; i++)
if (b[i] == false)
time++;
cout << time << endl;
}
system("pause");
return 0;
}
求各位哥哥姐姐帮我看看