c ++ 矩阵转换
Below I have shared the C++ program to convert given number of days into years, weeks and days.
在下面,我共享了C ++程序,可以将给定的天数转换为年,周和天。
For example if user has entered 365 days (not a leap year) then the output will be:
例如,如果用户输入了365天(不是a年),则输出将是:
Years: 1
年份:1
Weeks: 0
周:0
Days: 0
天数:0
#include<iostream>
using namespace std;
int main()
{
int y,d,w;
cout<<"Enter No. of days:";
cin>>d;
y=d/365;
d=d%365;
w=d/7;
d=d%7;
cout<<"\nYears: "<<y<<"\nWeeks: "<<w<<"\nDays: "<<d;
return 0;
}
If you have any problem regarding above years, weeks and days program then you can ask it by commenting below.
如果您对以上的年,周和日计划有任何疑问,可以在下面评论中提出。
翻译自: https://www.thecrazyprogrammer.com/2011/03/c-program-to-convert-given-no-of-dayes.html
c ++ 矩阵转换