la putain de sa mere je me fait chiez sa race
This commit is contained in:
parent
71fcc57319
commit
57621beca2
17
DEV1.1/TP08/alpha.c
Normal file
17
DEV1.1/TP08/alpha.c
Normal file
@ -0,0 +1,17 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
char min, maj;
|
||||
char *p = NULL;
|
||||
|
||||
for(min = 'a', maj = 'A'; maj <= 'Z'; min++, maj++) {
|
||||
p = (p == &min) ? &maj : &min;
|
||||
putchar(*p);
|
||||
}
|
||||
putchar('\n');
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
9233654589353407584
|
||||
|
||||
100000000010010010000111111011010101000100010000101101000110000
|
22
DEV1.1/TP08/carto.c
Normal file
22
DEV1.1/TP08/carto.c
Normal file
@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
float a = 1;
|
||||
double b = 1;
|
||||
long double c = 1;
|
||||
char d = '1';
|
||||
short int e = 1;
|
||||
int f = 1;
|
||||
long long unsigned int g = 1;
|
||||
|
||||
printf("%p \n",&a );
|
||||
printf("%p \n",&b );
|
||||
printf("%p \n",&c );
|
||||
printf("%p \n",&d );
|
||||
printf("%p \n",&e );
|
||||
printf("%p \n",&f );
|
||||
printf("%p \n",&g );
|
||||
return 0;
|
||||
}
|
11
DEV1.1/TP08/conversion.c
Normal file
11
DEV1.1/TP08/conversion.c
Normal file
@ -0,0 +1,11 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
long long int n = 4614256656552045848LL;
|
||||
double* p = (double*) &n;
|
||||
printf("π = %f\n", *p);
|
||||
long long int m = *p*2;
|
||||
printf("%lld\n", m );
|
||||
return EXIT_SUCCESS;
|
||||
}
|
12
DEV1.1/TP08/extension.c
Normal file
12
DEV1.1/TP08/extension.c
Normal file
@ -0,0 +1,12 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(void){
|
||||
|
||||
printf()
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
20
DEV1.1/TP08/initiales.c
Normal file
20
DEV1.1/TP08/initiales.c
Normal file
@ -0,0 +1,20 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
if (argc<2){
|
||||
printf("argument manquant");
|
||||
return 1;
|
||||
}
|
||||
{
|
||||
/* code */
|
||||
}
|
||||
for (int i = 1; i < argc; i++)
|
||||
{
|
||||
printf("%c",argv[i][0]);
|
||||
}
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
32
DEV1.1/TP08/lecture.c
Normal file
32
DEV1.1/TP08/lecture.c
Normal file
@ -0,0 +1,32 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(void){
|
||||
char pass[10]= "password1";
|
||||
int i;
|
||||
char out;
|
||||
char string[26];
|
||||
printf("Rentrez le mot de passe(max 26 charactere): \n");
|
||||
for(i=0;i<26;i++){
|
||||
out = getchar();
|
||||
if(out=='\n'){
|
||||
break;
|
||||
}
|
||||
else{
|
||||
string[i]=out;
|
||||
}
|
||||
|
||||
}
|
||||
for(i=0;i<strlen(pass);i++){
|
||||
if (string[i]!=pass[i])
|
||||
{
|
||||
printf("Mauvais mot de passe acces refusé.\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
printf("Mot de passe correct\n");
|
||||
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
32
DEV1.1/TP08/multiplication.c
Normal file
32
DEV1.1/TP08/multiplication.c
Normal file
@ -0,0 +1,32 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
if (argc<=2)
|
||||
{
|
||||
printf("il manque des arguments. Il en faut 2, il y en a %d.\n",argc-1);
|
||||
return 1;
|
||||
}
|
||||
for (int i = 0; i < strlen(argv[1]); ++i)
|
||||
{
|
||||
if(argv[1][i]=='.')
|
||||
{
|
||||
printf("Le premier argument n'est pas un reel.\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < strlen(argv[2]); ++i)
|
||||
{
|
||||
if(argv[2][i]=='.')
|
||||
{
|
||||
printf("Le deuxieme argument n'est pas un reel.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
long x = strtol(argv[1],NULL,10);
|
||||
long y = strtol(argv[2],NULL,10);
|
||||
printf("%ld \n", x*y);
|
||||
return 0;
|
||||
}
|
37
DEV1.1/TP08/stats.c
Normal file
37
DEV1.1/TP08/stats.c
Normal file
@ -0,0 +1,37 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
char txt[200];
|
||||
char dejavu[255]={' '};
|
||||
int dejavuuu=0;
|
||||
printf("ecriver ici: \n");
|
||||
fgets(txt,200,stdin);
|
||||
int nbE=0;
|
||||
int nbC=0;
|
||||
for (int i = 0; i < strlen(txt); ++i)
|
||||
{
|
||||
if(txt[i]=='e'||txt[i]=='E')
|
||||
{
|
||||
nbE++;
|
||||
}
|
||||
dejavuuu=0;
|
||||
for (int j = 0; j < strlen(dejavu); ++j)
|
||||
{
|
||||
if (txt[i]==dejavu[j])
|
||||
{
|
||||
dejavuuu++;
|
||||
}
|
||||
}
|
||||
if (dejavuuu==0)
|
||||
{
|
||||
nbC++;
|
||||
dejavu[nbC-1]=txt[i];
|
||||
}
|
||||
}
|
||||
printf("Il y a %d nombre de E ou e dans le texte entrée.\nIl y a %d nombre de charactere dans le texte.\n",nbE,nbC-1);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user