Advertisement
xlujiax

Untitled

Aug 24th, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. Main.cpp
  2.  
  3.  
  4. /*
  5. * To change this license header, choose License Headers in Project Properties.
  6. * To change this template file, choose Tools | Templates
  7. * and open the template in the editor.
  8. */
  9.  
  10. /*
  11. * File: main.cpp
  12. * Author: alulab14
  13. *
  14. * Created on 24 de agosto de 2016, 10:26 AM
  15. */
  16.  
  17. #include <cstdlib>
  18. #include <cstdio>
  19. #include "auxiliar.h"
  20. using namespace std;
  21.  
  22.  
  23. int main(int argc, char** argv) { //Nombre ciudad, Codigo ciudad, Datos climatologicos
  24. char c;
  25. int codigo;
  26. imprimirCabecera();
  27. while (1) {
  28. //Cada iteracion correspondera a una ciudad(Una linea))
  29. 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
  30. putchar(c);
  31. }
  32. if (c==EOF) break;
  33.  
  34. //n = scanf("%d", &codigo);
  35. printf("\ncodigo = %d\t", codigo);
  36. //procesarDatosClimatiocs();
  37. printf("\n======\n");
  38. }
  39. }
  40.  
  41. ----------------------
  42. auxiliar.h
  43.  
  44. /*
  45. * To change this license header, choose License Headers in Project Properties.
  46. * To change this template file, choose Tools | Templates
  47. * and open the template in the editor.
  48. */
  49.  
  50. /*
  51. * File: auxiliar.h
  52. * Author: alulab14
  53. *
  54. * Created on 24 de agosto de 2016, 11:21 AM
  55. */
  56.  
  57. #ifndef AUXILIAR_H
  58. #define AUXILIAR_H
  59.  
  60. #ifdef __cplusplus
  61. extern "C" {
  62. #endif
  63.  
  64.  
  65.  
  66.  
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70.  
  71. void imprimirCabecera();
  72.  
  73. #endif /* AUXILIAR_H */
  74.  
  75. -----------------------
  76.  
  77. auxiliar.cpp
  78. /*
  79. * To change this license header, choose License Headers in Project Properties.
  80. * To change this template file, choose Tools | Templates
  81. * and open the template in the editor.
  82. */
  83.  
  84. #include <stdio.h>
  85.  
  86. void imprimirCabecera(){
  87. printf("%55s\n","REGISTRO CLIMATICO DEL PAIS");
  88. printf("===============================================================================\n");
  89. printf("%8s REGISTRO %8s %12s %16s %12s %16s", "", "CODIGO", "FECHA", "TEMPERATURA", "HUMEDAD", "PRECIPITACIONES");
  90. }
  91.  
  92. void procesarDatosClimaticos(){
  93. float valor;
  94. char c;
  95. int dd, mm, aaaa, tamFecha;
  96. int hayValor, hayTemp, hayHumedad, hayPrecip;
  97. float tempC, tempF, humedad, precip, volumen;
  98. int finLineaCiudad;
  99.  
  100. while(1){
  101. finLineaCiudad = 0;
  102. //Cada iteracion corresponde al registro en la misma linea
  103. for(int i = 0; i< 3; i++){
  104.  
  105. }
  106. }
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement