Ajout des travaux effectuer

This commit is contained in:
2024-12-09 11:53:11 +01:00
parent 05fac8d3ae
commit c4e97e13da
558 changed files with 67900 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,54 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
struct nbrcomplex{
float x;
float y;
};
typedef struct nbrcomplex complex;
void afficher(complex z){
printf("%f + %fi\n", z.x, z.y);
}
float module(complex z){
float res = sqrt(pow(z.x, 2)+pow(z.y, 2));
float resrac = pow(res, 0.5);
return resrac;
}
complex inverse(complex z){
complex a;
a.x = z.x/pow(module(z), 2);
a.y = z.y/pow(module(z), 2);
return a;
}
complex conjugue(complex z){
complex b;
b.x = z.x;
b.y = -z.y;
return b;
}
int main(int argc, char const* argv[]){
complex z = {3,8};
complex a, b, c;
afficher(z);
a = z;
module(a);
printf("|z| = %f\n", a);
b = conjugue(z);
afficher(b);
printf("conjugue = %f\n", b);
c = inverse(z);
afficher(c);
return EXIT_SUCCESS;
}

View File

@@ -0,0 +1,16 @@
#include <stdio.h>
#include <stdlib.h>
#include <pwd.h>
struct id_s {
int UID;
char name;
};
typedef struct id_s id;
int main(int argc, char const* argv[]){
int x = getpwuid();
char y = getpwnam();
id r = {, };
}

View File

@@ -0,0 +1,17 @@
#include <stdio.h>
#include <stdlib.h>
struct taille{
int a;
int b;
int c;
/*char a;
char b;
char c;*/
};
typedef struct taille e;
int main(int argc, char const* argv[]){
printf("%d\n",sizeof(e));
}

Binary file not shown.

View File

@@ -0,0 +1,13 @@
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
int main(int argc, char** argv) {
time_t times = time(NULL);
struct tm * timeI = localtime(&times);
printf("Heure locale : %02d:%02d:%02d", timeI->tm_hour, timeI->tm_min, timeI->tm_sec);
printf("\n");
printf("Date locale : %04d/%02d/%02d",timeI->tm_year+1900,timeI->tm_mon,timeI->tm_mday);
printf("\n");
return EXIT_SUCCESS;
}