我正在學習 c,所以我在溫度記錄器中作業,我完成了程式,但現在我試圖讓它更漂亮,系統顯示一個措施串列,每個日期有 4 個措施,這是代碼的輸出:
Fecha Hora Medición
20/09/2022 06:30 200.0 °C
20/09/2022 12:30 200.0 °C
20/09/2022 18:30 200.0 °C
20/09/2022 22:30 200.0 °C
21/09/2022 06:30 190.0 °C
21/09/2022 12:30 190.0 °C
21/09/2022 18:30 190.0 °C
21/09/2022 22:30 190.0 °C
23/09/2022 06:30 190.0 °C
23/09/2022 12:30 190.0 °C
23/09/2022 18:30 190.0 °C
23/09/2022 22:30 190.0 °C
25/09/2022 06:30 150.0 °C
25/09/2022 12:30 150.0 °C
25/09/2022 18:30 150.0 °C
25/09/2022 22:30 150.0 °C
Pulse una tecla cualquiera para salir...
這是顯示值的代碼:
void listado(void){
struct s_mediciones medicion;
FILE *mediciones;
if((mediciones=fopen("mediciones.txt","r"))==NULL){
printf("\nError al abrir/crear el archivo.");
getch();
exit(1);
}
system("cls");
printf("Fecha Hora Medici%cn\n", 162);
fread( &medicion, sizeof(medicion), 1, mediciones);
while (!feof(mediciones)){
printf("s ", medicion.fecha_med);
printf("%1s ", medicion.hora_med);
printf("%9.1f
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/518361.html
標籤:C
