c++整数运算(1)

2023-12-24 05:45:19

#include<iostream>
#include<iomanip>
using?namespace?std;
int?main()
{
????int?m,n;
????cin>>m>>n;
????int?cnt?=?0;
????for(int?i?=?n;m-n<n;i++)
????{
????????if(m-n>n)
????????{
????????????cnt++;
????????????m?=?m-n;
????????}
????}
????cout<<cnt<<endl<<n-m;
????return?0;

}

?

#include<iostream>
#include<iomanip>
using?namespace?std;
int?main()
{
????int?m,n;
????cin>>m>>n;
????cout<<(m+n)*2<<endl<<n*m;
????return?0;

}

?

#include<iostream>
#include<iomanip>
using?namespace?std;
int?main()
{
????int?n;
????cin>>n;
????cout<<n*24<<endl<<n*24*60;?
????return?0;

}

?

#include<iostream>
#include<iomanip>
using?namespace?std;
int?main()
{
????int?n,a,x;
????cin>>n>>a>>x;
????cout<<n-a*x;?
????return?0;

}

?

#include<iostream>
#include<iomanip>
using?namespace?std;
int?main()
{
????int?x,y,n;
????cin>>x>>y>>n;
????cout<<n-(x+y);?
????return?0;

}

?

#include<iostream>
#include<iomanip>
using?namespace?std;
int?main()
{
????int?n;
????cin>>n;
????cout<<n*3;?
????return?0;

}

?

#include<iostream>
#include<iomanip>
using?namespace?std;
int?main()
{
????int?n,m;
????cin>>n>>m;
????cout<<(m-n)*30;?
????return?0;

}

?

#include<iostream>
#include<iomanip>
using?namespace?std;
int?main()
{
????int?m,n,s;
????cin>>m>>n>>s;
????cout<<s/n*m;?
????return?0;

}

?

#include?<iostream>
#include?<cstring>
using?namespace?std;
int?main()
{
????int?a,b,c,d,e;
????cin>>a>>b>>c>>d;
????e?=?(c*60+d)-(a*60+b);
????cout<<e/60<<"?"<<e%60;
????
????return?0;
}

文章来源:https://blog.csdn.net/lybr513208/article/details/135176485
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。