蓝桥算法训练 求平方和 ALGO-239

问题描述

  请用函数重载实现整型和浮点习型的两个数的平方和计算

输入格式

  测试数据的输入一定会满足的格式。
  2 2(2行2列,第1行整型,第2行浮点型)

输出格式

  要求用户的输出满足的格式。
  2 1(2行1列,第1行整型,第2行浮点型)

样例输入

一个满足题目要求的输入范例。

例:

2 2
3 4
3.1 4.1

样例输出

与上面的样例输入对应的输出。
例:
25
26.42

数据规模和约定

  输入数据中每一个数的范围。
  例:0<n,m<100, 0<=矩阵中的每个数<=1000。
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#include <deque>
#include <cmath>
#include <map>

using namespace std;
typedef long long ll;

const double inf=1e20;
const int maxn=2e5+10;
const int mod=1e9+7;

void pow2(int a,int b){
    cout<<a*a+b*b<<endl;
}
void pow2(double c,double d){
    cout<<c*c+d*d;
}
int main(){
    int a,b;
    double c,d;
    cin>>a>>b;
    cin>>c>>d;
    pow2(a,b);
    pow2(c,d);
    return 0;
}

这题的意思简直是脑筋急转弯,

猜你喜欢

转载自www.cnblogs.com/wz-archer/p/12623114.html