ここで私のコードに問題があります。プログラムは秒/年をカウントすることになっています。うるう年は直せましたが平年は直せませんでした。誰かがそれを修正できることを願っています。(mainに呼ばれる関数です)
ノート
- h=時間
- d=日
- あなたがた=年
- m=月
- s= 秒
- t= 合計秒数
- t2=うるう年
#include <iostream>
using namespace std;
void max_s()
{
unsigned long long s=1;
int h=s*60;
int d=h*24;
int m=30;
int ye=12;
long long t=s*h*d*m*ye;
long long t2=t+86400;
bool y,n;
y=true;
n=false;
cout<<"leapyear? 'y' for yes 'n' for no "<<endl;
cin>>y||n;
if(y=true)
{
cout<<"leapyear:"<<t2<<endl;
}
else
{
n=false;
cout<<t;
cout<<"seconds/year "<<endl;
}
}