using System.Net; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Primitives; public static int kyljeRuut(int p1x, int p1y, int p2x, int p2y){ int dx=p2x-p1x; int dy=p2y-p1y; return dx*dx+dy*dy; } public static async Task Run(HttpRequest req, ILogger log) { int x1=int.Parse(req.Query["x1"]); int y1=int.Parse(req.Query["y1"]); int x2=int.Parse(req.Query["x2"]); int y2=int.Parse(req.Query["y2"]); int x3=int.Parse(req.Query["x3"]); int y3=int.Parse(req.Query["y3"]); int k1=kyljeRuut(x1, y1, x2, y2); int k2=kyljeRuut(x2, y2, x3, y3); int k3=kyljeRuut(x3, y3, x1, y1); int pikim=k1; int lyhem1=k2; int lyhem2=k3; if(k2>pikim){pikim=k2; lyhem1=k1;} if(k3>pikim){pikim=k3; lyhem1=k1; lyhem2=k2;} if(pikim==lyhem1+lyhem2){return new OkObjectResult("täisnurk");} if(pikimlyhem1+lyhem2){return new OkObjectResult("nürinurk");} return new OkObjectResult("xxx"); }