vgsfjij
This commit is contained in:
22
DEV1.1S/TP02/complexes.c
Normal file
22
DEV1.1S/TP02/complexes.c
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
int main(void){
|
||||
struct crocs{
|
||||
double x;
|
||||
double y;
|
||||
double i = sqrt(-1);
|
||||
double z = x+y*i;
|
||||
}
|
||||
double val1;
|
||||
double val2;
|
||||
double res;
|
||||
double eee;
|
||||
printf("Donnez une valeur : ");
|
||||
scanf("%f", &val1);
|
||||
printf("Donnez une deuxième valeur : ");
|
||||
scanf("%f", &val2);
|
||||
struct crocs cars = {val1;val2;eee;res}
|
||||
printf("%f", res);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
14
DEV1.1S/TP02/date.c
Normal file
14
DEV1.1S/TP02/date.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
int main(void){
|
||||
time_t temps= time(NULL);
|
||||
struct tm* date = localtime(&temps);
|
||||
printf("%d", date->tm_year+1900);
|
||||
printf("-");
|
||||
printf("%d", date->tm_mon+1);
|
||||
printf("-");
|
||||
printf("%d\n", date->tm_mday);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
14
DEV1.1S/TP02/groupe.c
Normal file
14
DEV1.1S/TP02/groupe.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <grp.h>
|
||||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
int main(void){
|
||||
int i = 0;
|
||||
struct group* groupe = getgrnam("students22");
|
||||
while(groupe->gr_mem[i] != NULL){
|
||||
printf("%s", groupe->gr_mem[i]);
|
||||
i++;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
15
DEV1.1S/TP02/tailles.c
Normal file
15
DEV1.1S/TP02/tailles.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
int main(void){
|
||||
struct tailles{
|
||||
char* a;
|
||||
char* b;
|
||||
char* c;
|
||||
};
|
||||
struct tailles chaine = {"e","ab","c"};
|
||||
int res = sizeof(chaine);
|
||||
printf("%d\n", res);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user