Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <array>
- #include <fstream>
- #include "archivos.h"
- using namespace std;
- struct archivo_t {
- int dia;
- int hora;
- int lat;
- int longitud;
- double temp;
- };
- struct array_t {
- double temp = 0;
- int count = 0;
- };
- int main()
- {
- array<array_t,181> arr; int norte = 0, norte_c = 0, sur = 0, sur_c = 0;
- archivo_t R;
- ifstream medidas ("medidas.dat", ios::binary);
- while(leerEspecial(medidas, R))
- {
- arr.at(R.lat+90).temp += R.temp;
- arr.at(R.lat+90).count++;
- if (R.lat > 0)
- {
- norte = norte + R.temp
- norte_c++;
- }
- else if (R.lat < 0)
- {
- sur = sur + R.temp;
- sur_c++;
- }
- }
- if (norte/norte_c > sur/sur_c)
- cout << "el norte es mas calido" << endl;
- else if (norte/norte_c < sur/sur_c)
- cout << "el sur es mas calido" << endl;
- else
- cout << "son igual de calidos" << endl;
- medidas.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement