#941
Urare
În preajma Crăciunului toţi suntem sau redevenim copii.
Scrie un program care afişează pe ecran o urare pentru cei dragi ţie!
Problema | Urare | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51212573 | Utilizator | |
Fișier | urare.cpp | Dimensiune | 3.25 KB |
Data încărcării | 30 Mai 2024, 10:47 | Scor / rezultat | Eroare de compilare |
urare.cpp:92:10: error: expected ';' at end of member declaration bool Multime operator <(Multime b) ^ urare.cpp:92:29: error: 'Multime' is not a type bool Multime operator <(Multime b) ^ urare.cpp:92:38: error: ISO C++ forbids declaration of 'operator<' with no type [-fpermissive] bool Multime operator <(Multime b) ^ urare.cpp:108:11: error: expected ';' at end of member declaration bool Multime operator >(Multime b) ^ urare.cpp:108:11: error: redeclaration of 'bool Multime::Multime' urare.cpp:92:10: note: previous declaration 'bool Multime::Multime' bool Multime operator <(Multime b) ^ urare.cpp:108:30: error: 'Multime' is not a type bool Multime operator >(Multime b) ^ urare.cpp:108:39: error: ISO C++ forbids declaration of 'operator>' with no type [-fpermissive] bool Multime operator >(Multime b) ^ urare.cpp:124:10: error: expected ';' at end of member declaration bool Multime operator ==(Multime b) ^ urare.cpp:124:10: error: redeclaration of 'bool Multime::Multime' urare.cpp:92:10: note: previous declaration 'bool Multime::Multime' bool Multime operator <(Multime b) ^ urare.cpp:124:30: error: 'Multime' is not a type bool Multime operator ==(Multime b) ^ urare.cpp:124:39: error: ISO C++ forbids declaration of 'operator==' with no type [-fpermissive] bool Multime operator ==(Multime b) ^ urare.cpp: In member function 'Multime Multime::operator+(Multime)': urare.cpp:49:17: error: expected ';' before 'c' Multime c; ^ urare.cpp:49:18: warning: statement has no effect [-Wunused-value] Multime c; ^ urare.cpp:53:29: error: 'c' was not declared in this scope if(a[i]<b.a[j]) c.a[++k]=a[i++]; ^ urare.cpp:54:34: error: 'c' was not declared in this scope else if(a[i]>b.a[j]) c.a[++k]=b.a[j++]; ^ urare.cpp:55:18: error: 'c' was not declared in this scope else c.a[i++]=a[i++], j++; ^ urare.cpp:58:13: error: 'c' was not declared in this scope c.a[++k]=a[i++]; ^ urare.cpp:60:13: error: 'c' was not declared in this scope c.a[++k]=b.a[j++]; ^ urare.cpp:61:9: error: 'c' was not declared in this scope c.n=k; ^ urare.cpp: In member function 'Multime Multime::operator-(Multime)': urare.cpp:66:17: error: expected ';' before 'c' Multime c; ^ urare.cpp:66:18: warning: statement has no effect [-Wunused-value] Multime c; ^ urare.cpp:70:29: error: 'c' was not declared in this scope if(a[i]<b.a[j]) c.a[++k]=a[i++]; ^ urare.cpp:75:13: error: 'c' was not declared in this scope c.a[++k]=a[i++]; ^ urare.cpp:76:9: error: 'c' was not declared in this scope c.n=k; ^ urare.cpp: In member function 'Multime Multime::operator*(Multime)': urare.cpp:81:17: error: expected ';' before 'c' Multime c; ^ urare.cpp:81:18: warning: statement has no effect [-Wunused-value] Multime c; ^ urare.cpp:87:18: error: 'c' was not declared in this scope else c.a[i++]=a[i++], j++; ^ urare.cpp:89:9: error: 'c' was not declared in this scope c.n=k; ^ urare.cpp: In member function 'int Multime::operator<(int)': urare.cpp:94:16: error: request for member 'n' in 'b', which is of non-class type 'int' if(n>b.n) return 0; ^ urare.cpp:98:31: error: request for member 'n' in 'b', which is of non-class type 'int' for(int j=1; j<=b.n; ++j) ^ urare.cpp:99:28: error: request for member 'a' in 'b', which is of non-class type 'int' if(a[i]==b.a[i]) ^ urare.cpp: In member function 'int Multime::operator>(int)': urare.cpp:110:16: error: request for member 'n' in 'b', which is of non-class type 'int' if(n<b.n) return 0; ^ urare.cpp:111:27: error: request for member 'n' in 'b', which is of non-class type 'int' for(int i=1; i<=b.n; ++i) ^ urare.cpp:115:22: error: request for member 'a' in 'b', which is of non-class type 'int' if(b.a[i]==a[i]) ^ urare.cpp: In member function 'int Multime::operator==(int)': urare.cpp:126:17: error: request for member 'n' in 'b', which is of non-class type 'int' if(n!=b.n) return 0; ^ urare.cpp:129:24: error: request for member 'a' in 'b', which is of non-class type 'int' if(a[i]!=b.a[i]) return 0; ^ urare.cpp: In member function 'Multime Multime::operator+(Multime)': urare.cpp:63:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ urare.cpp: In member function 'Multime Multime::operator*(Multime)': urare.cpp:91:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ urare.cpp: In member function 'Multime Multime::operator-(Multime)': urare.cpp:78:5: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Urare face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
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ă.