From 7d10e78c82afb830cec11a8eee658de44123f927 Mon Sep 17 00:00:00 2001 From: vaisse Date: Wed, 15 Oct 2025 16:53:33 +0200 Subject: [PATCH] exo2 fini --- exo1/a.out | Bin 15656 -> 0 bytes exo2/REPONSES.md | 178 +++++++++ exo2/a.out | Bin 0 -> 19864 bytes exo2/gmon.out | Bin 0 -> 2927 bytes exo2/nombres.txt | 999 +++++++++++++++++++++++++++++++++++++++++++++++ exo2/racine.c | 76 ++++ exo2/writefile.c | 27 ++ 7 files changed, 1280 insertions(+) delete mode 100755 exo1/a.out create mode 100644 exo2/REPONSES.md create mode 100755 exo2/a.out create mode 100644 exo2/gmon.out create mode 100644 exo2/nombres.txt create mode 100644 exo2/racine.c create mode 100644 exo2/writefile.c diff --git a/exo1/a.out b/exo1/a.out deleted file mode 100755 index dca755f0b433737d8aaa4c2b21b5af24ac02b768..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15656 zcmb<-^>JfjWMqH=W(GS35U)T0BH{p{7*?1<84L^z4h$9yd<+f@atyKzYzzzxEMPH+ zJWM@|7GQ>m!)Oi&mjNUU(zgY~U|?WCr)8k(U^K{0AR!P9(g$K=!vgFOQ5ekt^#@2F zD@Y2;hl#`JP^h6W8YT|X2bNL*X=Y$xK%wI;{e6CIgHH*#Qy) z(IC7;5yWF)K&R1y37keiDubVvq=59HyAQ^PxerFe+!+AXw*qP~I&A_noPmJ>MuY4C z2?ahaNdbi?h)oQJC66GeeYoP!02EOS3=A+D8XaJN8Za<0fYO?~Unm1p1H%E3TVV2x z42&pzCNw@stq21HIDdfj&n}6)4773b?2f%7iNE)XWhzc4kj3=9lHFb)!3h?L}!gu(V;Q*VdEoL(H}fZ_(5 zIbt}>nS;X|eFg>wC1eM}*af8}#SHQBnZ^0ZM#k~QB}FCqISjdpIXU^s4Dscs^vvRt)S?hy=bZe!)R4raoK%MR`1IWTJg9x~5T#fZGB7YP zFfuSRFf%YRuz*Qu_5_Q%GBCi33x*vNr?G)bV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~q#j#JdGK`ntw@xCAl8yZiV%Ir_x= zySW9shQxxX69vYgfza&*JJ+D-+peVl}wWy?$K@TpJRGOKSqMMn*pqH6fl3G;209KfhSe(J2mr|Km zT$u}@ONt;eWvNBQnfZArocJOJy`t2dM34q3t01QYWMXCsgI-B$MG1pmT4r7*gI-ZS zD4-eiQZwSyiV|~E<1ZR61&j@%JsB7nzWx8757Q58U%+TsI|N$oVz@sT+O~k{ zhqXW8G{_PL2Jn71klnEM46Gdx4c(Ii(+_LUz-U+y^!S*1mw!p!5kAhZ5-Nrw^KbVEPrH z`d~C@9ssHpOhKjL`($RK>4()vF#0-L0}ZAhY#0Lr!+bRTu=*QD!`jg>_2}+j3e^t_ zfAHWxNHJ_b8;FgBVc`c8T8pM1*8YLfpg9YeS`dwH|86w>51{tK=p!IaNEqFIP`d~@ z|Kr;42QvcQ{>uyu41CZ$1X2U*U%>X)q1y-J!)Q?Zg&#>jtp9NXx=#|O4rDe6!}u`z zH8gL-q8Zk%gzvKiB~GXsWc{#o@C6!vF#WLoPX|CNMHv_vG(eh=Fw9;U{S!?;tpD-? zs^0=hFNg`#2cwx7A>}8`epvfd0kqi=+|~r?LSUFam +[3] 100.0 0.00 1332.01 main [3] + 0.00 1332.01 1/1 racineCarreeTab [2] +----------------------------------------------- + + This table describes the call tree of the program, and was sorted by + the total amount of time spent in each function and its children. + + Each entry in this table consists of several lines. The line with the + index number at the left hand margin lists the current function. + The lines above it list the functions that called this function, + and the lines below it list the functions this one called. + This line lists: + index A unique number given to each element of the table. + Index numbers are sorted numerically. + The index number is printed next to every function name so + it is easier to look up where the function is in the table. + + % time This is the percentage of the `total' time that was spent + in this function and its children. Note that due to + different viewpoints, functions excluded by options, etc, + these numbers will NOT add up to 100%. + + self This is the total amount of time spent in this function. + + children This is the total amount of time propagated into this + function by its children. + + called This is the number of times the function was called. + If the function called itself recursively, the number + only includes non-recursive calls, and is followed by + a `+' and the number of recursive calls. + + name The name of the current function. The index number is + printed after it. If the function is a member of a + cycle, the cycle number is printed between the + function's name and the index number. + + + For the function's parents, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the function into this parent. + + children This is the amount of time that was propagated from + the function's children into this parent. + + called This is the number of times this parent called the + function `/' the total number of times the function + was called. Recursive calls to the function are not + included in the number after the `/'. + + name This is the name of the parent. The parent's index + number is printed after it. If the parent is a + member of a cycle, the cycle number is printed between + the name and the index number. + + If the parents of the function cannot be determined, the word + `' is printed in the `name' field, and all the other + fields are blank. + + For the function's children, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the child into the function. + + children This is the amount of time that was propagated from the + child's children to the function. + + called This is the number of times the function called + this child `/' the total number of times the child + was called. Recursive calls by the child are not + listed in the number after the `/'. + + name This is the name of the child. The child's index + number is printed after it. If the child is a + member of a cycle, the cycle number is printed + between the name and the index number. + + If there are any cycles (circles) in the call graph, there is an + entry for the cycle-as-a-whole. This entry shows who called the + cycle (as parents) and the members of the cycle (as children.) + The `+' recursive calls entry shows the number of function calls that + were internal to the cycle, and the calls entry for each member shows, + for that member, how many times it was called from other members of + the cycle. + + +Copyright (C) 2012-2025 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. + + +Index by function name diff --git a/exo2/a.out b/exo2/a.out new file mode 100755 index 0000000000000000000000000000000000000000..9e2c094cb74b37c0014b6835ae4aa3f8cc510240 GIT binary patch literal 19864 zcmb<-^>JfjWMqH=W(GS35buBhM8p9?F+{jP84L^z4h$9y{0t5ZsthU&YzzzxEMPH+ zJWM@|_F#sH!)Oi&mjNUU()R|$U|?WCr)8k(U^K{0AR!P9(g$K=!#AK7z-R`jKS26e zK^mZZm^h4P1bKvkfdNLt#i9OVPylIWU_hs3pzep!$ofD=9?*s8J79}S&tQV^7eHy4 zJ`fkA?*dfc1*kq4{Q%?<1_lNg4fQTK4nX130d)^L4T}#LjjrzmR3AF60&yk-j0V{O z5(3d6{6`7IV_-n1(Sr-57Nj!xX-Nu*jqW}eALc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*=HVzu& z0T}=rKZnsXpj9ns*crqGkB%}hFo1fnAobCpjvI8Z^=cQU}8zGhl2Goy@?% z02=Ft*$*4vhS9LH9p-+RIv8ERz`y_+JBRUMe0eIV`d0|lV%2~he3i$e)$ z^g?+I44{!yP?*B>D?s(ZXz-dZxN1ao2vx=~6U}~D`v688gB*@UKTHTTM1X8RtQ`lV zVe>#R_2}+j3bh{={@_JqAjQxHU?)IqBn%5bn9y1@{jl~lj0UaMgQ*44==SeM(=VY2 zQpLakqd7pHg9w31bo)W=*Dpx<5B=O1^zcX5e-<>DiyIFiMYxz-S1JhQMeDjE2By z2#kin$P5A5*t^VUqd +#include + +#define LIMIT 1000 +#define BUF_LIM 512 + +long racineCarree(long n){ + for(long i=0; i<(n/2); i++){ + if((i*i)==n){ + return i; + } + } + return -1; +} + +long* racineCarreeTab(long* tab, int count){ + long* rst = (long*) malloc(LIMIT*sizeof(long)); + for(long i=0; i\n"); + printf("USAGE:./a.out \n"); + return EXIT_FAILURE; + } + + if(f!=NULL){ + while(fgets(buffer, BUF_LIM*sizeof(char), f)){ + tab[count] = strtol(buffer, NULL, 10); + count++; + } + fclose(f); + hasfile = 1; + } else { + for(int i=1; i +#include + +#define LIMIT 999 +#define BUF_LIM 512 + +int main(void){ + FILE* f = fopen("nombres.txt", "w"); + int r; + char* buffer = (char*) malloc(BUF_LIM*sizeof(char)); + + if(f!=NULL){ + for(int i=0; i