warum soll dadie gebannt werden?
Bei Funktionen bin ich noch nicht angekommen... Noch immer im 1.Kapitel ...
bzw. bin ich mit dem 1.Kapitel jetzt durch und mache eine kleine Pause, bevor ich an "Elementare arithmetische Operationen" rangehe...
hab Hunger.
Nur noch ne kleine Frage:
Bei
Code:
#include <stdio.h>
main()
{
char buf[10];
int erg, erg2, a, b, c, d;
a = atoi(fgets(buf,10,stdin));
b = atoi(fgets(buf,10,stdin));
c = atoi(fgets(buf,10,stdin));
d = atoi(fgets(buf,10,stdin));
erg = (a + b) * (c + d);
printf("%10d",erg);
printf("\n");
a = atoi(fgets(buf,10,stdin));
b = atoi(fgets(buf,10,stdin));
c = atoi(fgets(buf,10,stdin));
erg = (a - b) * (c + a + b);
printf("%10d",erg);
printf("\n");
a = atoi(fgets(buf,10,stdin));
b = atoi(fgets(buf,10,stdin));
erg2 = (erg + a) * (erg - b);
printf("%10d",erg2);
printf("\n");
system("pause");
}
könnte ich stattdessen auch
Code:
#include <stdio.h>
main()
{
char buf[10];
int erg, a, b, c, d;
a = atoi(fgets(buf,10,stdin));
b = atoi(fgets(buf,10,stdin));
c = atoi(fgets(buf,10,stdin));
d = atoi(fgets(buf,10,stdin));
erg = (a + b) * (c + d);
printf("%10d",erg);
printf("\n");
a = atoi(fgets(buf,10,stdin));
b = atoi(fgets(buf,10,stdin));
c = atoi(fgets(buf,10,stdin));
erg = (a - b) * (c + a + b);
printf("%10d",erg);
printf("\n");
a = atoi(fgets(buf,10,stdin));
b = atoi(fgets(buf,10,stdin));
erg = (erg + a) * (erg - b);
printf("%10d",erg );
printf("\n");
system("pause");
}
schreiben?