割り当てに特定の制限があるため、このコードでは多くのことを変更できません。コードは次のとおりです。
#include <iostream>
#include<cstdlib>
#include<cstring>
using namespace std;
struct MyTime { int hours, minutes, seconds; };
int DetermineElapsedTime(const MyTime *t1, const MyTime *t2);
const int hourSeconds = 3600;
const int minSeconds = 60;
int DetermineElapsedTime(const MyTime *t1, const MyTime *t2)
{//problem about static in next line
static MyTime ((long) (((t2.hours * hourSeconds) + (t2.minutes * minSeconds) + t2.seconds) -
((t1.hours * hourSeconds) + (t1.minutes * minSeconds) + t1.seconds)));
return(MyTime);
}
すべてではありませんが、プライマリ入力から他の入力までの時間を何らかの方法で計算する必要があります。setfill も使用する必要があります。
とにかく、静的の前に一次式が必要であるというエラーを修正する方法を知っている人はいますか?