首页 > 其他分享 >4.28打卡

4.28打卡

时间:2023-04-28 20:38:19浏览次数:30  
标签:return cout fun2 int 4.28 打卡 include

#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int fun2(int m){
    return m*m;
}
int fun1(int x,int y){
    return fun2(x)+fun2(y);
}
int main()
{
    int a,b;
    cout<<"please enter two integers(a and b):";
    cin>>a>>b;
    cout<<"the sum of square of a and b: "<<fun1(a,b)<<endl;
    return 0;
}

 

标签:return,cout,fun2,int,4.28,打卡,include
From: https://www.cnblogs.com/Sunyiran/p/17356527.html

相关文章

  • 每日总结 4.28
    今天进行了一天的课程,进行了较少的代码编写。Stringtime=request.getParameter("time");d.buhuo(name,sum,mphone);d.gx(mer,time,mphone,name);response.setContentType("text/html;charset=utf-8");PrintWriter......
  • 4.28
    #include<iostream>usingnamespacestd;#include<string>classmother{public:   mother()   {       cout<<"mother\n";   }};classdaughter:publicmother{public:   daughter()   {       cout<<"......
  • 2023.4.28——软件工程日报
    所花时间(包括上课):6h代码量(行):0行博客量(篇):1篇今天,上午学习,下午学习并开会。我了解到的知识点:1.了解了一些数据库的知识;2.了解了一些python的知识;3.了解了一些英语知识;5.了解了一些Javaweb的知识;4.了解了一些数学建模的知识;6.了解了一些计算机网络的知识;......
  • 打卡15
    3.2亲密数 思路很简单,先遍历1-3000,把因子算一下,加一下,然后再算和的质因数和,看是否相等即可,时间复杂度不是很高 流程也很简单#include<bits/stdc++.h>usingnamespacestd;intf(intx)//求一个数的因子和{ intsum=0; for(inti=1;i<=x/2;i++) { if(x%i==0)sum+=i; } re......
  • c++打卡练习(19)
    1.问题描述相传国际象棋是古印度舍罕王的宰相达依尔发明的。舍罕王十分喜爱象棋,决定让宰相自己选择何种赏赐。这位聪明的宰相指着8x8共64格的象棋棋盘说:陛下,请您赏给我一些麦子吧。就在棋盘的第1格中放1粒,第2格放2粒,第3格放4粒,以后每一格都比前一格增加一倍,依此放完棋盘上64格,我......
  • 4.28
    #include<stdio.h>main(){intm,n,number=0;printf("红球白球黑球\n");printf("......................\n");for(m=0;m<=3;m++)for(n=0;n<=3;n++)if(8-m-n<=6)printf("%2d:%d%d%d\n",++number,m,n,8-m-n);}......
  • 打卡 C++类与对象定义一个日期类 N天以后 - C/C++ 操作符重载
    改造练习13-1(日复一日)中的Date类并提交,使其可以与一个整数n相加或相减,得到该日期N天后/前的日期。提示:请参考题目(日复一日)中的Date类实现;注意考虑闰月;整数n的取值范围为[1,10000]。裁判测试程序样例: #include<iostream>#include<string>#include<assert.h>usingn......
  • 第十二天打卡
    问题: 算法设计:根据问题可以计算出每个颜色球的取值范围红球为M<3,白球为N<3,黑球为8-M-N<6流程图: 源代码:#include<stdio.h>intmain(){ intm,n,number=0; for(m=0;m<=3;m++) for(n=0;n<=3;n++) if(8-m-n<=6) printf("%2d:%d%d%d\n",++number,m,n,8-m-n); return0;......
  • 第十一天打卡
    一、问题描述编写一个计算个人所得税的程序,要求输入收入金额后,能够输出应缴的个人所得税。二、设计思路1.利用结构体记录不同起始征税点、结束点和税率;2.利用函数计算各个阶段的税;3.输出结果。三、四、代码实现 ......
  • 打卡10
    位反序数设N是一个四位数,它的9倍恰好是其反序数,求N。反序数就是将整数的数字倒过来形成的整数。例如:1234的反序数是4321。#include<stdio.h>intmain(){ inti; for(i=1002;i<1111;i++)/*穷举四位数可能的值*/ if(i%10*1000+i/10%10*100+i/100%10*10+i/1000==i*9)/*判断反序数......