Detalii evaluare #49140422

Rezumat problemă

#2098 Meteo

Centrul de meteorologie dintr-o ţară îndepărtată, aflată aproape de Polul Nord, doreşte să stabilească modul în care încălzirea globală afectează temperaturile din acea ţară. Ei notează pe parcursul a N zile consecutive temperaturile maxime zilnice şi sunt interesaţi să determine cea mai lungă perioadă continuă de timp în care temperaturile înregistrate în zile consecutive au alternat ca semn.

Detalii

Problema Meteo Operații I/O meteo.in/meteo.out
Limita timp 0.1 secunde Limita memorie Total: 2 MB / Stivă 1 MB
Id soluție #49140422 Utilizator Eduard Darabanti (EdyD99)
Fișier meteo.cpp Dimensiune 5.81 KB
Data încărcării 16 Februarie 2024, 16:20 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

meteo.cpp:66:2: error: stray '#' in program
 }#include <bits/stdc++.h>

  ^
meteo.cpp:98:2: error: stray '#' in program
 }#include <bits/stdc++.h>

  ^
meteo.cpp:130:2: error: stray '#' in program
 }#include <bits/stdc++.h>

  ^
meteo.cpp:162:2: error: stray '#' in program
 }#include <bits/stdc++.h>

  ^
meteo.cpp:194:2: error: stray '#' in program
 }#include <bits/stdc++.h>

  ^
meteo.cpp:226:2: error: stray '#' in program
 }#include <bits/stdc++.h>

  ^
meteo.cpp: In function 'int main()':
meteo.cpp:9:5: error: reference to 'cin' is ambiguous
     cin >> n;

     ^
meteo.cpp:3:10: note: candidates are: std::ifstream cin
 ifstream cin("meteo.in");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
meteo.cpp:11:9: error: reference to 'cin' is ambiguous
         cin >> a[i];

         ^
meteo.cpp:3:10: note: candidates are: std::ifstream cin
 ifstream cin("meteo.in");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
meteo.cpp:25:18: error: reference to 'cout' is ambiguous
     if(lmax==-1) cout << 0;

                  ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp:28:9: error: reference to 'cout' is ambiguous
         cout << lmax << endl;

         ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp:30:13: error: reference to 'cout' is ambiguous
             cout << a[i] << ' ';

             ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp: At global scope:
meteo.cpp:36:13: error: redefinition of 'std::ifstream cin'
 ifstream cin("meteo.in");

             ^
meteo.cpp:3:10: error: 'std::ifstream cin' previously declared here
 ifstream cin("meteo.in");

          ^
meteo.cpp:37:14: error: redefinition of 'std::ofstream cout'
 ofstream cout("meteo.out");

              ^
meteo.cpp:4:10: error: 'std::ofstream cout' previously declared here
 ofstream cout("meteo.out");

          ^
meteo.cpp:38:11: error: redefinition of 'int a [1001]'
 int a[1001];

           ^
meteo.cpp:5:5: error: 'int a [1001]' previously declared here
 int a[1001];

     ^
meteo.cpp: In function 'int main()':
meteo.cpp:39:5: error: redefinition of 'int main()'
 int main()

     ^
meteo.cpp:6:5: error: 'int main()' previously defined here
 int main()

     ^
meteo.cpp:42:5: error: reference to 'cin' is ambiguous
     cin >> n;

     ^
meteo.cpp:3:10: note: candidates are: std::ifstream cin
 ifstream cin("meteo.in");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
meteo.cpp:44:9: error: reference to 'cin' is ambiguous
         cin >> a[i];

         ^
meteo.cpp:3:10: note: candidates are: std::ifstream cin
 ifstream cin("meteo.in");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
meteo.cpp:58:18: error: reference to 'cout' is ambiguous
     if(lmax==-1) cout << 0;

                  ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp:61:9: error: reference to 'cout' is ambiguous
         cout << lmax << endl;

         ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp:63:13: error: reference to 'cout' is ambiguous
             cout << a[i] << ' ';

             ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp: At global scope:
meteo.cpp:66:3: error: 'include' does not name a type
 }#include <bits/stdc++.h>

   ^
meteo.cpp:68:13: error: redefinition of 'std::ifstream cin'
 ifstream cin("meteo.in");

             ^
meteo.cpp:3:10: error: 'std::ifstream cin' previously declared here
 ifstream cin("meteo.in");

          ^
meteo.cpp:69:14: error: redefinition of 'std::ofstream cout'
 ofstream cout("meteo.out");

              ^
meteo.cpp:4:10: error: 'std::ofstream cout' previously declared here
 ofstream cout("meteo.out");

          ^
meteo.cpp:70:11: error: redefinition of 'int a [1001]'
 int a[1001];

           ^
meteo.cpp:5:5: error: 'int a [1001]' previously declared here
 int a[1001];

     ^
meteo.cpp: In function 'int main()':
meteo.cpp:71:5: error: redefinition of 'int main()'
 int main()

     ^
meteo.cpp:6:5: error: 'int main()' previously defined here
 int main()

     ^
meteo.cpp:74:5: error: reference to 'cin' is ambiguous
     cin >> n;

     ^
meteo.cpp:3:10: note: candidates are: std::ifstream cin
 ifstream cin("meteo.in");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
meteo.cpp:76:9: error: reference to 'cin' is ambiguous
         cin >> a[i];

         ^
meteo.cpp:3:10: note: candidates are: std::ifstream cin
 ifstream cin("meteo.in");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
meteo.cpp:90:18: error: reference to 'cout' is ambiguous
     if(lmax==-1) cout << 0;

                  ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp:93:9: error: reference to 'cout' is ambiguous
         cout << lmax << endl;

         ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp:95:13: error: reference to 'cout' is ambiguous
             cout << a[i] << ' ';

             ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp: At global scope:
meteo.cpp:98:3: error: 'include' does not name a type
 }#include <bits/stdc++.h>

   ^
meteo.cpp:100:13: error: redefinition of 'std::ifstream cin'
 ifstream cin("meteo.in");

             ^
meteo.cpp:3:10: error: 'std::ifstream cin' previously declared here
 ifstream cin("meteo.in");

          ^
meteo.cpp:101:14: error: redefinition of 'std::ofstream cout'
 ofstream cout("meteo.out");

              ^
meteo.cpp:4:10: error: 'std::ofstream cout' previously declared here
 ofstream cout("meteo.out");

          ^
meteo.cpp:102:11: error: redefinition of 'int a [1001]'
 int a[1001];

           ^
meteo.cpp:5:5: error: 'int a [1001]' previously declared here
 int a[1001];

     ^
meteo.cpp: In function 'int main()':
meteo.cpp:103:5: error: redefinition of 'int main()'
 int main()

     ^
meteo.cpp:6:5: error: 'int main()' previously defined here
 int main()

     ^
meteo.cpp:106:5: error: reference to 'cin' is ambiguous
     cin >> n;

     ^
meteo.cpp:3:10: note: candidates are: std::ifstream cin
 ifstream cin("meteo.in");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
meteo.cpp:108:9: error: reference to 'cin' is ambiguous
         cin >> a[i];

         ^
meteo.cpp:3:10: note: candidates are: std::ifstream cin
 ifstream cin("meteo.in");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
meteo.cpp:122:18: error: reference to 'cout' is ambiguous
     if(lmax==-1) cout << 0;

                  ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp:125:9: error: reference to 'cout' is ambiguous
         cout << lmax << endl;

         ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp:127:13: error: reference to 'cout' is ambiguous
             cout << a[i] << ' ';

             ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp: At global scope:
meteo.cpp:130:3: error: 'include' does not name a type
 }#include <bits/stdc++.h>

   ^
meteo.cpp:132:13: error: redefinition of 'std::ifstream cin'
 ifstream cin("meteo.in");

             ^
meteo.cpp:3:10: error: 'std::ifstream cin' previously declared here
 ifstream cin("meteo.in");

          ^
meteo.cpp:133:14: error: redefinition of 'std::ofstream cout'
 ofstream cout("meteo.out");

              ^
meteo.cpp:4:10: error: 'std::ofstream cout' previously declared here
 ofstream cout("meteo.out");

          ^
meteo.cpp:134:11: error: redefinition of 'int a [1001]'
 int a[1001];

           ^
meteo.cpp:5:5: error: 'int a [1001]' previously declared here
 int a[1001];

     ^
meteo.cpp: In function 'int main()':
meteo.cpp:135:5: error: redefinition of 'int main()'
 int main()

     ^
meteo.cpp:6:5: error: 'int main()' previously defined here
 int main()

     ^
meteo.cpp:138:5: error: reference to 'cin' is ambiguous
     cin >> n;

     ^
meteo.cpp:3:10: note: candidates are: std::ifstream cin
 ifstream cin("meteo.in");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
meteo.cpp:140:9: error: reference to 'cin' is ambiguous
         cin >> a[i];

         ^
meteo.cpp:3:10: note: candidates are: std::ifstream cin
 ifstream cin("meteo.in");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
meteo.cpp:154:18: error: reference to 'cout' is ambiguous
     if(lmax==-1) cout << 0;

                  ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp:157:9: error: reference to 'cout' is ambiguous
         cout << lmax << endl;

         ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp:159:13: error: reference to 'cout' is ambiguous
             cout << a[i] << ' ';

             ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp: At global scope:
meteo.cpp:162:3: error: 'include' does not name a type
 }#include <bits/stdc++.h>

   ^
meteo.cpp:164:13: error: redefinition of 'std::ifstream cin'
 ifstream cin("meteo.in");

             ^
meteo.cpp:3:10: error: 'std::ifstream cin' previously declared here
 ifstream cin("meteo.in");

          ^
meteo.cpp:165:14: error: redefinition of 'std::ofstream cout'
 ofstream cout("meteo.out");

              ^
meteo.cpp:4:10: error: 'std::ofstream cout' previously declared here
 ofstream cout("meteo.out");

          ^
meteo.cpp:166:11: error: redefinition of 'int a [1001]'
 int a[1001];

           ^
meteo.cpp:5:5: error: 'int a [1001]' previously declared here
 int a[1001];

     ^
meteo.cpp: In function 'int main()':
meteo.cpp:167:5: error: redefinition of 'int main()'
 int main()

     ^
meteo.cpp:6:5: error: 'int main()' previously defined here
 int main()

     ^
meteo.cpp:170:5: error: reference to 'cin' is ambiguous
     cin >> n;

     ^
meteo.cpp:3:10: note: candidates are: std::ifstream cin
 ifstream cin("meteo.in");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
meteo.cpp:172:9: error: reference to 'cin' is ambiguous
         cin >> a[i];

         ^
meteo.cpp:3:10: note: candidates are: std::ifstream cin
 ifstream cin("meteo.in");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
meteo.cpp:186:18: error: reference to 'cout' is ambiguous
     if(lmax==-1) cout << 0;

                  ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp:189:9: error: reference to 'cout' is ambiguous
         cout << lmax << endl;

         ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp:191:13: error: reference to 'cout' is ambiguous
             cout << a[i] << ' ';

             ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp: At global scope:
meteo.cpp:194:3: error: 'include' does not name a type
 }#include <bits/stdc++.h>

   ^
meteo.cpp:196:13: error: redefinition of 'std::ifstream cin'
 ifstream cin("meteo.in");

             ^
meteo.cpp:3:10: error: 'std::ifstream cin' previously declared here
 ifstream cin("meteo.in");

          ^
meteo.cpp:197:14: error: redefinition of 'std::ofstream cout'
 ofstream cout("meteo.out");

              ^
meteo.cpp:4:10: error: 'std::ofstream cout' previously declared here
 ofstream cout("meteo.out");

          ^
meteo.cpp:198:11: error: redefinition of 'int a [1001]'
 int a[1001];

           ^
meteo.cpp:5:5: error: 'int a [1001]' previously declared here
 int a[1001];

     ^
meteo.cpp: In function 'int main()':
meteo.cpp:199:5: error: redefinition of 'int main()'
 int main()

     ^
meteo.cpp:6:5: error: 'int main()' previously defined here
 int main()

     ^
meteo.cpp:202:5: error: reference to 'cin' is ambiguous
     cin >> n;

     ^
meteo.cpp:3:10: note: candidates are: std::ifstream cin
 ifstream cin("meteo.in");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
meteo.cpp:204:9: error: reference to 'cin' is ambiguous
         cin >> a[i];

         ^
meteo.cpp:3:10: note: candidates are: std::ifstream cin
 ifstream cin("meteo.in");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
meteo.cpp:218:18: error: reference to 'cout' is ambiguous
     if(lmax==-1) cout << 0;

                  ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp:221:9: error: reference to 'cout' is ambiguous
         cout << lmax << endl;

         ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp:223:13: error: reference to 'cout' is ambiguous
             cout << a[i] << ' ';

             ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp: At global scope:
meteo.cpp:226:3: error: 'include' does not name a type
 }#include <bits/stdc++.h>

   ^
meteo.cpp:228:13: error: redefinition of 'std::ifstream cin'
 ifstream cin("meteo.in");

             ^
meteo.cpp:3:10: error: 'std::ifstream cin' previously declared here
 ifstream cin("meteo.in");

          ^
meteo.cpp:229:14: error: redefinition of 'std::ofstream cout'
 ofstream cout("meteo.out");

              ^
meteo.cpp:4:10: error: 'std::ofstream cout' previously declared here
 ofstream cout("meteo.out");

          ^
meteo.cpp:230:11: error: redefinition of 'int a [1001]'
 int a[1001];

           ^
meteo.cpp:5:5: error: 'int a [1001]' previously declared here
 int a[1001];

     ^
meteo.cpp: In function 'int main()':
meteo.cpp:231:5: error: redefinition of 'int main()'
 int main()

     ^
meteo.cpp:6:5: error: 'int main()' previously defined here
 int main()

     ^
meteo.cpp:234:5: error: reference to 'cin' is ambiguous
     cin >> n;

     ^
meteo.cpp:3:10: note: candidates are: std::ifstream cin
 ifstream cin("meteo.in");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
meteo.cpp:236:9: error: reference to 'cin' is ambiguous
         cin >> a[i];

         ^
meteo.cpp:3:10: note: candidates are: std::ifstream cin
 ifstream cin("meteo.in");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
meteo.cpp:250:18: error: reference to 'cout' is ambiguous
     if(lmax==-1) cout << 0;

                  ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp:253:9: error: reference to 'cout' is ambiguous
         cout << lmax << endl;

         ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
meteo.cpp:255:13: error: reference to 'cout' is ambiguous
             cout << a[i] << ' ';

             ^
meteo.cpp:4:10: note: candidates are: std::ofstream cout
 ofstream cout("meteo.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from meteo.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema Meteo face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.