Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Main.cpp
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- /*
- * File: main.cpp
- * Author: alulab14
- *
- * Created on 24 de agosto de 2016, 10:26 AM
- */
- #include <cstdlib>
- #include <cstdio>
- #include "auxiliar.h"
- using namespace std;
- int main(int argc, char** argv) { //Nombre ciudad, Codigo ciudad, Datos climatologicos
- char c;
- int codigo;
- imprimirCabecera();
- while (1) {
- //Cada iteracion correspondera a una ciudad(Una linea))
- while ((((c = getchar()) != ' ') && (c!=EOF) )|| (scanf("%d", &codigo) != 1)) { //Mientras el caracter no se vacio o haya un numero, el scanf limipia los espaciones en blanco
- putchar(c);
- }
- if (c==EOF) break;
- //n = scanf("%d", &codigo);
- printf("\ncodigo = %d\t", codigo);
- //procesarDatosClimatiocs();
- printf("\n======\n");
- }
- }
- ----------------------
- auxiliar.h
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- /*
- * File: auxiliar.h
- * Author: alulab14
- *
- * Created on 24 de agosto de 2016, 11:21 AM
- */
- #ifndef AUXILIAR_H
- #define AUXILIAR_H
- #ifdef __cplusplus
- extern "C" {
- #endif
- #ifdef __cplusplus
- }
- #endif
- void imprimirCabecera();
- #endif /* AUXILIAR_H */
- -----------------------
- auxiliar.cpp
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- #include <stdio.h>
- void imprimirCabecera(){
- printf("%55s\n","REGISTRO CLIMATICO DEL PAIS");
- printf("===============================================================================\n");
- printf("%8s REGISTRO %8s %12s %16s %12s %16s", "", "CODIGO", "FECHA", "TEMPERATURA", "HUMEDAD", "PRECIPITACIONES");
- }
- void procesarDatosClimaticos(){
- float valor;
- char c;
- int dd, mm, aaaa, tamFecha;
- int hayValor, hayTemp, hayHumedad, hayPrecip;
- float tempC, tempF, humedad, precip, volumen;
- int finLineaCiudad;
- while(1){
- finLineaCiudad = 0;
- //Cada iteracion corresponde al registro en la misma linea
- for(int i = 0; i< 3; i++){
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement