Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- #include <stdlib.h>
- int main()
- {
- int a=0,pocet=0;
- FILE *fr,*fw;
- fr=fopen("ZNAMKY.txt","r");
- if (fr==NULL)
- {
- printf("nepodarilo sa otvorit subor ZNAMKY.TXT");
- getch();
- exit(1);
- }
- while(a!=-1)
- {
- fscanf(fr,"%d",&a);
- if(a>5)
- pocet++;
- }
- fclose(fr);
- fw=fopen("LUKAC.TXT","w");
- if(fw==NULL)
- {
- printf("Nepodarilo sa otvorit subor LUKAC.TXT.");
- getch();
- exit(1);
- }
- if(a=5)
- {
- printf ("najhorsia znamka je %d.",a);
- fprintf (fw,"najhorsia znamka je %d.",a);
- }
- else
- {
- printf("Neclasifikovany");
- fprintf(fw,"Neklasifikovany");
- }
- fclose(fw);
- getch();
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement