Új hozzászólás Aktív témák
-
Geresics
addikt
válasz
Geresics
#3954
üzenetére
Megoldásom:
#include <stdio.h>
struct koord
{
float x;
float y;
};
void main()
{
struct koord pont[10];
float tav[10];
int n, i, mem;
float max=0;
/* beolvasas */
printf("\nHany koordinatat szeretne rogziteni?");
scanf("%d",&n);
for (i=0; i<n; i++)
{
printf("\nAdja meg az x%d koordinatat: ", i+1);
scanf("%f",&pont[i].x);
printf("\nAdja meg az y%d koordinatat: ", i+1);
scanf("%f",&pont[i].y);
tav[i]==(sqrt(pont[i].x*pont[i].x)+(pont[i].y*pont[i].y));
}
for (i=0; i<n; i++)
if ((pont[i].x)>max)
{
max=pont[i].x;
mem=i;
}
else if ((pont[i].y)>max)
{
max=pont[i].y;
mem=i;
}
/* kiíratás */
printf("\nA legtavolabbi koordinata az origotol: %f, %f", pont[mem].x, pont[mem].y);
}
Új hozzászólás Aktív témák
● olvasd el a téma összefoglalót!
● ha kódot szúrsz be, használd a PROGRAMKÓD formázási funkciót!
- Apple iPhone 15 128GB, Kártyafüggetlen, 1 Év Garanciával
- Lenovo T14 Gen2 (i7-1165G7, 24GB DDR4, 512GB SSD, Iris Xe)
- ÚJ! BONTATLAN! ASUS RT-AC68U router
- Ubiquiti Unifi AP Wireless Access Point SWX-UAP falitartóval
- Precision 5560 27% 15.6" 4K+ IPS érintő i7-11850H T1200 32GB 1TB NVMe ujjlolv IR kam gar
- Samsung A06 mobiltelefon
- HIBÁTLAN iPhone 12 mini 64GB Black -1 ÉV GARANCIA - Kártyafüggetlen, MS3818, 100% Akksi
- BESZÁMÍTÁS! MSI A620M R5 7600 32GB DDR5 512GB SSD RTX 3060TI 8GB Zalman Z1 Plus XFX 650W
- Nvidia Quadro P4000 // Nvidia Quadro P5000 --- Budapest MPL Foxpost
- Dell Latitude 5420 14" Touchscreen i5-1135G7 16GB 256GB 1 év garancia
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: BroadBit Hungary Kft.
Város: Budakeszi

