囧,c++已经开了那么久了,从来没练过,一直在搞ACM,今天心血来潮写了个……其实是课程设计的时候无聊搞的

#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
class paopao
{
public:
    int x1, x2;
    void gett();
    void putt();
};
void paopao::gett()
{
    cin>>x1>>x2;
}
void paopao::putt()
{
    cout<<sqrt(x1*x1+x2*x2)<<endl;
}
int main()
{
    paopao pao;
    pao.gett();
    pao.putt();
    return 0;
}

 

posted on 2012-04-17 19:32  狸の舞  阅读(156)  评论(0编辑  收藏  举报