Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
#include <stdio.h>
int main()
{
FILE *f;
f = fopen("zahlen.txt", "r");
if(f == NULL)
{
printf("Datei konnte nicht geoeffnet werden");
return 1;
}
fclose(f);
return 0;
}
#include <stdio.h>
int main()
{
FILE *f;
int hauptzahl;
f = fopen("zahlen.txt", "r");
if(f == NULL)
{
printf("Datei konnte nicht geoeffnet werden");
return 1;
}
if(1 != fscanf(f, "%d", &hauptzahl))
{
printf("Einlesefehler");
return 2;
}
fclose(f);
return 0;
}
while(!feof(f))
{
}
summe = 0;
while(!feof(f))
{
if(2 == fscanf(f, "%d*%d", &zahl1, &zahl2))
summe += (zahl1 * zahl2);
}
#include <stdio.h>
int main()
{
FILE *f;
int hauptzahl, summe, zahl1, zahl2;
f = fopen("zahlen.txt", "r");
if(f == NULL)
{
printf("Datei konnte nicht geoeffnet werden");
return 1;
}
if(1 != fscanf(f, "%d", &hauptzahl))
{
printf("Einlesefehler");
return 2;
}
summe = 0;
while(!feof(f))
{
if(2 == fscanf(f, "%d*%d", &zahl1, &zahl2))
summe += (zahl1 * zahl2);
}
fclose(f);
return 0;
}
#include <stdio.h>
int main()
{
FILE *f;
FILE *ft;
int hauptzahl, summe,zahl, zahl1, zahl2,zahl3;
f = fopen("zahlen.txt", "r");
ft = fopen("zahlen.txt","r");
if(f == NULL)
{
printf("Datei konnte nicht geoeffnet werden");
return 1;
}
if(1 != fscanf(f, "%d", &hauptzahl))
{
printf("Einlesefehler");
return 2;
}
summe = 0;
while(!feof(f))
{
if(2 == fscanf(f, "%d*%d", &zahl1, &zahl2))
summe += (zahl1 * zahl2);
}
printf("Die Summe ist %d\n",summe);
fscanf (ft, "%d", &zahl);
printf( "Zahl ist %d \n", zahl);
if(ft == NULL)
{
printf("Datei konnte nicht geoeffnet werden");
return 1;
}
if(1 != fscanf(ft, "%d", &hauptzahl))
{
printf("Einlesefehler");
return 2;
}
if (zahl > summe)
{
printf("Summe ist kleiner als die Produkte");
}
if (zahl < summe)
{
printf("Summe ist groesser als die Produkte");
}
if (zahl == summe)
{
printf("Summe ist gleich gross wie die Produkte");
}
fclose(f);
fclose(ft);
return 0;
}
#include <stdio.h>
int main()
{
FILE *f;
int hauptzahl, summe, zahl1, zahl2;
f = fopen("zahlen.txt", "r");
if(f == NULL)
{
printf("Datei konnte nicht geoeffnet werden");
return 1;
}
if(1 != fscanf(f, "%d", &hauptzahl))
{
printf("Einlesefehler");
return 2;
}
summe = 0;
while(!feof(f))
{
if(2 == fscanf(f, "%d*%d", &zahl1, &zahl2))
summe += (zahl1 * zahl2);
}
if(hauptzahl == summe)
printf("OK\n");
else
printf("Nicht gleich\n");
fclose(f);
return 0;
}
100
5*5
5*15