From 1904ba3ae3d58e05531e6acb86658ee894837c83 Mon Sep 17 00:00:00 2001 From: Peter Sabol Date: Fri, 18 Mar 2022 15:37:22 +0100 Subject: [PATCH] fugnuje --- du3/Makefile | 1 + du3/program | Bin 5694 -> 5402 bytes du3/program.c | 59 +++++++++++++++++++++----------------------------- 3 files changed, 26 insertions(+), 34 deletions(-) create mode 100644 du3/Makefile diff --git a/du3/Makefile b/du3/Makefile new file mode 100644 index 0000000..0ea6a29 --- /dev/null +++ b/du3/Makefile @@ -0,0 +1 @@ +gcc -std=c11 -lm program.c -o program \ No newline at end of file diff --git a/du3/program b/du3/program index 14d0d4bd61760b6d26c55b8c67f5bd3001ff49e8..7214f89fe3c3f295f9534bcd9f34528614fa5cea 100755 GIT binary patch delta 2461 zcmZ8jZERCj7(Vy*w!PiD?zU^8W6N6BZY*TLAQNXcbl{8;F-|@;M%)aH&WsOPfoP^> zmVpx%hDQW+CXARE6MmQ=W`ESi3IzX%#u!K-0Y%frk?;|TiRkrt?(N0Jo4k9^^SLl%^HFiUCi3xU5aE7h1XDj!l~3zjeD3^8@7DJf*Mt?pp%m=EEYQ4Hy7l#q!n00iU;&SpT_M3HdpQ3K^f`u6-#T+Md z7G}6ql=xHNg*Vm@U&~&<*|~aU%0Nd_$A>iinYAfDSm8UlUQ0aq2n^=2i0q%9UFx0u z1Z)NJ`eV)Tui2^SIW0-0dEtD1bR=CbCWx?KPG}7oOY;LYpViZB_mXyK#f}QgRxb=7 zg|lwTl=FA;J)`4MOcH$8I6)%!gHVGYldr;LGL1jfT)#OuWuT|$_9XqB7<}W5Ioy%d z&vhg-8V_isBWVn4$-?n}OmlcoQp3iqyc4`;W3^{r6?Oe^T;*zQK++ftao}&$>;S)r?L6W>RQ(qCW%-JCj=LS&PWhoXHai9V zyO4{e0ewhaR_0bm&-gV>v_RAax-74FTO$Uni`79U#8q7VoSdgu)sAH~9iuD4D6$fq zSG@|HIn1K`hJ|IIb0b;rXmTsdz z=4Ow^C%VCv+yi=aWE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5|j&ybR$P`D9?tF$Gx@Y3wVEoo^i?J1*Yx` zcppN~Z$X~@zY4r5lsONW*alRI>k#FS_thGF?3wK&9(VA#XV-zJp-v@oDF1{gf9>G4 zgU2{3Dc@`h>)Afu)?Ru*T-tmFp+C-HCh~Y5sze=yX9az!Gz?w^6{Vz#%pKE6^kC52 z(WphJuZ6IEoLexT=I=ZfZt{v@$sw-;#PV#Fm^+kQuM+d*7lP|jVy*abDsu;|Jh>DVP6INQ#0&;=)f9m zegWKBYVREPlj0Jv^WEVC2cPjLf%z9UV#mY$MaTA(?Ae}jV4g2f+x@Ks=J~+>@f~9x zu(SP(f%#wflM>$#tdfR8g99^uhr^!j-Rsbk-wVw15=F$v?2BftoRyEq15vzHY-#Gy z!)-e{@icP(0Y$gcdX!HnIia3K996m=GxhG2*%e9YG0V*6^hmx};3C$OGAtt&ShMcS zb@2QElFlokyx{4$v}OB*yb{Lp>2x1V97yL)avHTKYj)!TX}7wiBe=C$Z{8N-i;mp~ zRi0*scbd>ww*|MhHG$>O*pER%-yGh)DHztbx3uhN?$kSjo5Ia>XFuOWb9uY9|K)9| zw_$Cd+pzSWsBR_lnf-yTUcuX`eEumt2{ksV7a)v_VP9TLzI7)TZ%EUaGajz=SkBZF zkxYz_T5U64qh>rgP4{!JLmUFMAcJu!4MDs|PaH&_ahEPt*)LWPd?lOqa%{UOed{vQcoQ7r%f diff --git a/du3/program.c b/du3/program.c index 97c7a45..1e4791c 100644 --- a/du3/program.c +++ b/du3/program.c @@ -1,55 +1,29 @@ #include #include #include +#define LINE_SIZE 100 + //#include -/*int main() -{ - float a[100],sum=0,x; - int n,i; - printf("\nEnter the value of X :: "); - scanf("%f",&x); - // printf("\nEnter degree of the polynomial X :: "); - //scanf("%d",&n); - printf("\nEnter coefficient's of the polynomial X :: \n"); - for(i=n;i>=0;i--) - { - printf("\nEnter Coefficient of [ X^%d ] :: ",i); - scanf("%f",&a[i]); - } - - for(i=n;i>0;i--) - { - sum=(sum+a[i])*x; - } - - sum=sum+a[0]; - - printf("\nValue of the polynomial is = [ %f ]\n",sum); - - return 0; -} -*/ - -void main() { +/*void main() { int degree,x; int coeff[10], i; int sum = 0; + // Getting the value of the variable + printf("\nEnter the value of x: "); + scanf("%d",&x); + // Getting the degreee of the polynomial printf("\nEnter the degree of the polynomial: "); scanf("%d",°ree); - // Getting the coefficients of all terms of the polynomial + // Getting the coefficients of all terms of the polynomial printf("\nEnter the coeffients from lower order to higher order: \n"); for(i=0; i<=degree; i++) { scanf("%d",&coeff[i]); } - // Getting the value of the variable - printf("\nEnter the value of x: "); - scanf("%d",&x); - // Applying Horner's rule sum = coeff[degree]; for(i=degree-1; i>=0; i--) { @@ -58,4 +32,21 @@ void main() { // Printing result printf("\nResult: %d",sum); +} + +*/ + +int main(){ + int pole[LINE_SIZE]; + int n=0; + char*vstup; + char riadok[LINE_SIZE]; + do { + vstup=fgets(riadok,LINE_SIZE,stdin); + n++; + }while(*vstup!='\n'); + //printf("%s",*vstup); + for(int i=0;n>i;i++){ + printf("%s",vstup); + } } \ No newline at end of file