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

View File

@@ -0,0 +1,42 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char const *argv[])
{
FILE *f;
f=fopen("top10","r");
int zone_int[1];
int zone_char[3];
int i = 0;
int j;
char name[3];
int score;
char rep_n;
int rep_s;
printf("Entrez pseudo : ");
while(i<3){
name[i] = getchar();
i++;
}
printf("Entrez score : ");
scanf("%d", score);
if(f != NULL){
for(i=0 ; i<10 ; i++){
fread(zone_int, 4, 1, f);
fread(zone_char, 3, 1, f);
if(zone_int[0] <= score){
rep_n = zone_int[1];
rep_s = zone_char[3];
zone_int[0] = score;
zone_char[3] = name[3];
name[3] = rep_n;
score = rep_s;
}
printf("%09d", zone_int[0]);
printf("%c%c%c", zone_char[0], zone_char[1], zone_char[2]);
}
}
fclose(f);
return 0;
}

View File

@@ -0,0 +1,17 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char const *argv[])
{
FILE *f;
FILE *l;
f=fopen(argv[1],"r");
l=fopen(argv[2],"w");
char t[40];
fgets(t,40,f);
fputs(t,l);
fclose(l);
fclose(f);
return 0;
}

Binary file not shown.

View File

@@ -0,0 +1,26 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char const *argv[])
{
int time = 0;
FILE* f;
f=fopen("compteur","r");
if(f == NULL){
f=fopen("compteur","w");
fwrite(&time,1,4,f);
time = 1;
printf("Nombres de fois ouvert : inexistant\n");
fclose(f);
}
else{
fread(&time,1,4,f);
f=fopen("compteur","w");
time++;
fwrite(&time,1,4,f);
printf("Nombres de fois ouvert : %d\n", time);
fclose(f);
}
return 0;
}

View File

@@ -0,0 +1,27 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char const *argv[])
{
FILE* f;
int i;
int n = 0;
int y;
char c[100];
f=fopen(argv[1],"r");
while(feof(f)==1){
for(i=0;i<y;i++){
if( c[i] ='\n'){
printf("\n");
n=n+10;
}else{
printf("%07d ",n);
fread(&c,3,1,f);
printf("%c ", c[i]);
}
}
}
fclose(f);
return 0;
}

View File

@@ -0,0 +1,37 @@
#include <stdio.h>
#include <stdlib.h>
#include <graph.h>
int main(int argc, char const *argv[])
{
FILE* f;
f = fopen("image.bin","r");
int i, j;
int largeur, hauteur;
couleur c;
fread(&largeur,4,1,f);
fread(&hauteur,4,1,f);
printf("%d\n",largeur);
printf("%d\n",hauteur);
InitialiserGraphique();
CreerFenetre(10, 10, largeur, hauteur);
fseek(f,8*largeur/2*hauteur,SEEK_CUR);
for(i=largeur/2;i<largeur;i++){
fseek(f,8*hauteur/2,SEEK_CUR);
for(j=hauteur/2;j<hauteur;j++){
fread(&c,sizeof(unsigned long),1,f);
ChoisirCouleurDessin(c);
DessinerPixel(i, j);
}
}
Touche();
FermerGraphique();
fclose(f);
return 0;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
plus que 3 (Répétition, Reproduction, Recherche).

Binary file not shown.

View File

@@ -0,0 +1,21 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char const *argv[])
{
int s;
char b[3];
int i;
FILE* f;
f=fopen("top10","r");
printf("|Hall of Fame|\n");
for(i=0;i<10;i++){
fread(&s,4,1,f);
fread(&b,3,1,f);
printf("%09d %s\n", s, b);
}
fclose(f);
return 0;
}

View File

View File

Binary file not shown.