Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
TBod
#include <stdio.h> #include <math.h> struct TBod { float iX; //male i znamena interni promenna struktury, pro lepsi orientaci float iY; }; // strednik zde musi byt !!! inline float vzdalenost(struct TBod aBod) { return sqrt((aBod.iX * aBod.iX) + (aBod.iY * aBod.iY)); } int main() { //https://www.geeksforgeeks.org/designated-initializers-c/ struct TBod bod = {.iY = 0, .iX = 0}; //T = strukTura (typ) printf("Ahoj z BPC-UDP\n"); printf("bod.iX = %f\n", bod.iX); printf("bod.iY = %f\n", bod.iY); if(scanf("%f%f", &bod.iX, &bod.iY) != 2) //antidebilní filtr { printf("Chybne parametry, konec programu.\n"); return 1; } printf("bod.iX = %f\n", bod.iX); printf("bod.iY = %f\n", bod.iY); float r = vzdalenost(bod); //bod je promenna typu struktura printf("r: %f\n", r); return 0; } #if 0 // Trolls start here.... ( ͡° ͜ʖ ͡°) ( ͡ಠ ʖ̯ ͡ಠ) ¯\_(ツ)_/¯ ( ཀ ʖ̯ ཀ) ( ಠ╭╮ಠ ) ( × ʖ̯ × ) ( ͡° ʖ̯ ͡°) ༼ つ ◕_◕ ༽つ (.)(.) (ಠ_ಠ) ╔╗╔╗╔╗╔╗╔╗ tak se citim celej zivot - feels bad man ║╚╝╚╝╚╝╚╝║ ( ཀ ʖ̯ ཀ) ╚╤══════╤╝ , je mi hodne ╔╗╔╗╔╗│─╔╗╔╗─│╔╗╔╗╔╗ ║╚╝╚╝║│─╚╝╚╝─│║╚╝╚╝║ my jsme uplně hotoví - to teda :c ╚╤══╤╝│──────│╚╤══╤╝ │╔╗╞╗│╔╗╔╗╔╗│╔╡╔╗│ ZDENOOOO, je tady Zdena? Neni porad pod korenem? Koren byl zabit... F │╚╝│╚╪╝╚╝╚╝╚╪╝│╚╝│ METLOOOO │╔╗│─│╔═╤╤═╗│─│╔╗│ Svarto,je ti něco? │╚╝│─│║─││─║│─│╚╝│ xdd ja uz nechapu ted xdddd │──│─│║─││─║│─│──│není mu nic ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ #endif
run
|
edit
|
history
|
help
0
Pole MAX a MIN
Stack
test
arraywithqueue
pokus
Simple c
array of structures
Herout (67) - 1
test1
euklejduv algoritmus