c ++ 矩阵转换_C ++程序将天转换成年,周和天

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 ++ 矩阵转换

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值