#include #define NUMERO 234567 int main() { FILE *f, *g; int nTel, sec; float somma=0, euro; if ((f=fopen("Bolletta","r"))&&(g=fopen("Totale","w"))) { while ( fscanf(f,"%d %d %f",&nTel,&sec,&euro)!=EOF ) { if ( nTel==NUMERO ) somma+=euro; } fprintf(g,"Il totale e': %f\n",somma); } return 0; }