Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Author: 曹北健(37509)
- Result: AC Submission_id: 4148175
- Created at: Sat Mar 12 2022 10:34:40 GMT+0800 (China Standard Time)
- Problem: 5395 Time: 14 Memory: 1680
- */
- #include <stdio.h>
- int main(){
- double x[1024], y[1024], maxslope = -1e12, slope0;
- int n, i, j;
- scanf("%d", &n);
- for(i = 0;i < n;i++){
- scanf("%lf%lf", &x[i], &y[i]);
- }
- for(i = 0;i < n;i++){
- for(j = i + 1;j < n;j++){
- slope0 = (y[j] - y[i]) / (x[j] - x[i]);
- if(slope0 > maxslope){
- maxslope = slope0;
- }
- }
- }
- printf("%.3f\n", maxslope);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment