Untitled
unknown
c_cpp
17 days ago
545 B
2
Indexable
Never
/*Esempio.txt 123 456 789 101112 */ #include <stdio.h> int main() { FILE * file = fopen("Esempio.txt", "r"); if(file != NULL) { char s[200]; fgets(s, sizeof(s), file); s=['3'][]['-4'][]['34'][]['6'][\0] int m = 6; char val = s[0]; int res = val - '0'; atoi() int somma = m + res; printf("%d", somma); fclose(file); } else { printf("Errore apertura file"); } return 0; }
Leave a Comment