佛大小胖


私信TA

用户名:20200310507

访问量:342

签 名:

等  级
排  名 15611
经  验 789
参赛次数 0
文章发表 3
年  龄 0
在职情况 学生
学  校 佛山科学技术学院
专  业

  自我简介:

解题思路:

注意事项:

参考代码://该代码不需考虑正负值,极其方便!!!!!

#include<iostream>

#include<cstring>

#include<algorithm>

using namespace std;

 

int main()

{

    void LY(float x1, float y1, float x2,float y2);

    float x1, x2, y1, y2;

    cin>>x1>>y1;

    cin>>x2>>y2;

    LY(x1,y1,x2,y2);


    return 0;

}


void LY(float x1, float y1, float x2,float y2)

{

    if(x2 - x1 == 0) cout<<"INF"<<endl;

    else cout<<(y2-y1)/(x2-x1)<<endl;

}



 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区