Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
/*Integrare polinomi da file di testo, dove il file di testo ha come primo numero il numero di polinomi, ogni polinomio ha come primo numero il grado e i coefficienti dal termine noto fino al grado massimo.*/ #include
#include
#define FILE_PATH "/home/aurelio/Desktop/informatica/filetxt/polinomi.txt" #define STRLEN 1024 #define N_RETT 10000 #define INF -2.0 #define SUP 2.0 typedef int* pint; typedef float* pfloat; typedef FILE* pfile; typedef char* pchar; double integrale(float inf, float sup, unsigned n_r, pfloat pcoeff, unsigned grado) { double dx,sum,y,x,xi; unsigned i,i_coeff; dx=(double)(sup-inf)/n_r; for(i=sum=0,x=inf;i
0) printf("+%.2fx^%d",pcoeff[i_coeff],i_coeff); break; } } printf("\n"); integ=integrale(INF,SUP,N_RETT,pcoeff,grado); printf("L'integrale del polinomio %d valutato da %f a %f risulta %f\n",i_pol+1,INF,SUP,integ); free(pcoeff); } return EXIT_SUCCESS; fclose(pf); err_file: printf("Errore file non trovato\n"); return EXIT_FAILURE; err_mem: printf("Errore memoria insufficiente\n"); return EXIT_FAILURE; }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)