#1003
Baze1
Se dau două numere b1 b2
, reprezentând două baze de numeraţie şi două şiruri de cifre x y
, reprezentând două numere: x
în baza b1
, y
în baza b2
. Determinaţi suma numerelor x
şi y
în baza 10
.
Problema | Baze1 | Operații I/O |
baze1.in /baze1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #10153754 | Utilizator | |
Fișier | baze1.cpp | Dimensiune | 559 B |
Data încărcării | 17 August 2018, 20:19 | Scor / rezultat | Eroare de compilare |
baze1.cpp:1:9: error: #include expects "FILENAME" or <FILENAME> #include <fstream> ^ baze1.cpp:2:9: error: #include expects "FILENAME" or <FILENAME> #include <cstring> ^ baze1.cpp:3:1: error: stray '\302' in program using namespace std; ^ baze1.cpp:3:1: error: stray '\240' in program baze1.cpp:3:1: error: stray '\302' in program baze1.cpp:3:1: error: stray '\240' in program baze1.cpp:4:1: error: stray '\302' in program int b1,b2,nr1,nr2,val,i; ^ baze1.cpp:4:1: error: stray '\240' in program baze1.cpp:5:1: error: stray '\302' in program char s1[25],s2[25],ch; ^ baze1.cpp:5:1: error: stray '\240' in program baze1.cpp:6:1: error: stray '\302' in program int main() ^ baze1.cpp:6:1: error: stray '\240' in program baze1.cpp:8:1: error: stray '\302' in program ifstream f("baze1.in"); ^ baze1.cpp:8:1: error: stray '\240' in program baze1.cpp:8:1: error: stray '\302' in program baze1.cpp:8:1: error: stray '\240' in program baze1.cpp:8:1: error: stray '\302' in program baze1.cpp:8:1: error: stray '\240' in program baze1.cpp:8:1: error: stray '\302' in program baze1.cpp:8:1: error: stray '\240' in program baze1.cpp:9:1: error: stray '\302' in program ofstream g("baze1.out"); ^ baze1.cpp:9:1: error: stray '\240' in program baze1.cpp:9:1: error: stray '\302' in program baze1.cpp:9:1: error: stray '\240' in program baze1.cpp:9:1: error: stray '\302' in program baze1.cpp:9:1: error: stray '\240' in program baze1.cpp:9:1: error: stray '\302' in program baze1.cpp:9:1: error: stray '\240' in program baze1.cpp:10:1: error: stray '\302' in program f>>b1>>b2; ^ baze1.cpp:10:1: error: stray '\240' in program baze1.cpp:10:1: error: stray '\302' in program baze1.cpp:10:1: error: stray '\240' in program baze1.cpp:10:1: error: stray '\302' in program baze1.cpp:10:1: error: stray '\240' in program baze1.cpp:11:1: error: stray '\302' in program f>>s1>>s2; ^ baze1.cpp:11:1: error: stray '\240' in program baze1.cpp:11:1: error: stray '\302' in program baze1.cpp:11:1: error: stray '\240' in program baze1.cpp:11:1: error: stray '\302' in program baze1.cpp:11:1: error: stray '\240' in program baze1.cpp:12:1: error: stray '\302' in program for(i=0;i<strlen(s1);i++) ^ baze1.cpp:12:1: error: stray '\240' in program baze1.cpp:12:1: error: stray '\302' in program baze1.cpp:12:1: error: stray '\240' in program baze1.cpp:12:1: error: stray '\302' in program baze1.cpp:12:1: error: stray '\240' in program baze1.cpp:13:1: error: stray '\302' in program { ^ baze1.cpp:13:1: error: stray '\240' in program baze1.cpp:13:1: error: stray '\302' in program baze1.cpp:13:1: error: stray '\240' in program baze1.cpp:13:1: error: stray '\302' in program baze1.cpp:13:1: error: stray '\240' in program baze1.cpp:13:1: error: stray '\302' in program baze1.cpp:13:1: error: stray '\240' in program baze1.cpp:14:1: error: stray '\302' in program val=s1[i]-'0'; ^ baze1.cpp:14:1: error: stray '\240' in program baze1.cpp:14:1: error: stray '\302' in program baze1.cpp:14:1: error: stray '\240' in program baze1.cpp:14:1: error: stray '\302' in program baze1.cpp:14:1: error: stray '\240' in program baze1.cpp:14:1: error: stray '\302' in program baze1.cpp:14:1: error: stray '\240' in program baze1.cpp:14:1: error: stray '\302' in program baze1.cpp:14:1: error: stray '\240' in program baze1.cpp:14:1: error: stray '\302' in program baze1.cpp:14:1: error: stray '\240' in program baze1.cpp:14:1: error: stray '\302' in program baze1.cpp:14:1: error: stray '\240' in program baze1.cpp:14:1: error: stray '\302' in program baze1.cpp:14:1: error: stray '\240' in program baze1.cpp:15:1: error: stray '\302' in program nr1=nr1*b1+val; ^ baze1.cpp:15:1: error: stray '\240' in program baze1.cpp:15:1: error: stray '\302' in program baze1.cpp:15:1: error: stray '\240' in program baze1.cpp:15:1: error: stray '\302' in program baze1.cpp:15:1: error: stray '\240' in program baze1.cpp:15:1: error: stray '\302' in program baze1.cpp:15:1: error: stray '\240' in program baze1.cpp:15:1: error: stray '\302' in program baze1.cpp:15:1: error: stray '\240' in program baze1.cpp:15:1: error: stray '\302' in program baze1.cpp:15:1: error: stray '\240' in program baze1.cpp:15:1: error: stray '\302' in program baze1.cpp:15:1: error: stray '\240' in program baze1.cpp:15:1: error: stray '\302' in program baze1.cpp:15:1: error: stray '\240' in program baze1.cpp:16:1: error: stray '\302' in program } ^ baze1.cpp:16:1: error: stray '\240' in program baze1.cpp:16:1: error: stray '\302' in program baze1.cpp:16:1: error: stray '\240' in program baze1.cpp:16:1: error: stray '\302' in program baze1.cpp:16:1: error: stray '\240' in program baze1.cpp:16:1: error: stray '\302' in program baze1.cpp:16:1: error: stray '\240' in program baze1.cpp:17:1: error: stray '\302' in program for(i=0;i<strlen(s2);i++) ^ baze1.cpp:17:1: error: stray '\240' in program baze1.cpp:17:1: error: stray '\302' in program baze1.cpp:17:1: error: stray '\240' in program baze1.cpp:17:1: error: stray '\302' in program baze1.cpp:17:1: error: stray '\240' in program baze1.cpp:17:1: error: stray '\302' in program baze1.cpp:17:1: error: stray '\240' in program baze1.cpp:18:1: error: stray '\302' in program { ^ baze1.cpp:18:1: error: stray '\240' in program baze1.cpp:18:1: error: stray '\302' in program baze1.cpp:18:1: error: stray '\240' in program baze1.cpp:18:1: error: stray '\302' in program baze1.cpp:18:1: error: stray '\240' in program baze1.cpp:18:1: error: stray '\302' in program baze1.cpp:18:1: error: stray '\240' in program baze1.cpp:19:1: error: stray '\302' in program val=s2[i]-'0'; ^ baze1.cpp:19:1: error: stray '\240' in program baze1.cpp:19:1: error: stray '\302' in program baze1.cpp:19:1: error: stray '\240' in program baze1.cpp:19:1: error: stray '\302' in program baze1.cpp:19:1: error: stray '\240' in program baze1.cpp:19:1: error: stray '\302' in program baze1.cpp:19:1: error: stray '\240' in program baze1.cpp:19:1: error: stray '\302' in program baze1.cpp:19:1: error: stray '\240' in program baze1.cpp:19:1: error: stray '\302' in program baze1.cpp:19:1: error: stray '\240' in program baze1.cpp:19:1: error: stray '\302' in program baze1.cpp:19:1: error: stray '\240' in program baze1.cpp:19:1: error: stray '\302' in program baze1.cpp:19:1: error: stray '\240' in program baze1.cpp:20:1: error: stray '\302' in program nr2=nr2*b2+val; ^ baze1.cpp:20:1: error: stray '\240' in program baze1.cpp:20:1: error: stray '\302' in program baze1.cpp:20:1: error: stray '\240' in program baze1.cpp:20:1: error: stray '\302' in program baze1.cpp:20:1: error: stray '\240' in program baze1.cpp:20:1: error: stray '\302' in program baze1.cpp:20:1: error: stray '\240' in program baze1.cpp:20:1: error: stray '\302' in program baze1.cpp:20:1: error: stray '\240' in program baze1.cpp:20:1: error: stray '\302' in program baze1.cpp:20:1: error: stray '\240' in program baze1.cpp:20:1: error: stray '\302' in program baze1.cpp:20:1: error: stray '\240' in program baze1.cpp:20:1: error: stray '\302' in program baze1.cpp:20:1: error: stray '\240' in program baze1.cpp:21:1: error: stray '\302' in program } ^ baze1.cpp:21:1: error: stray '\240' in program baze1.cpp:21:1: error: stray '\302' in program baze1.cpp:21:1: error: stray '\240' in program baze1.cpp:21:1: error: stray '\302' in program baze1.cpp:21:1: error: stray '\240' in program baze1.cpp:21:1: error: stray '\302' in program baze1.cpp:21:1: error: stray '\240' in program baze1.cpp:22:1: error: stray '\302' in program g<<nr1+nr2; ^ baze1.cpp:22:1: error: stray '\240' in program baze1.cpp:22:1: error: stray '\302' in program baze1.cpp:22:1: error: stray '\240' in program baze1.cpp:22:1: error: stray '\302' in program baze1.cpp:22:1: error: stray '\240' in program baze1.cpp:22:1: error: stray '\302' in program baze1.cpp:22:1: error: stray '\240' in program baze1.cpp:23:1: error: stray '\302' in program f.close(); ^ baze1.cpp:23:1: error: stray '\240' in program baze1.cpp:23:1: error: stray '\302' in program baze1.cpp:23:1: error: stray '\240' in program baze1.cpp:23:1: error: stray '\302' in program baze1.cpp:23:1: error: stray '\240' in program baze1.cpp:23:1: error: stray '\302' in program baze1.cpp:23:1: error: stray '\240' in program baze1.cpp:24:1: error: stray '\302' in program g.close(); ^ baze1.cpp:24:1: error: stray '\240' in program baze1.cpp:24:1: error: stray '\302' in program baze1.cpp:24:1: error: stray '\240' in program baze1.cpp:24:1: error: stray '\302' in program baze1.cpp:24:1: error: stray '\240' in program baze1.cpp:24:1: error: stray '\302' in program baze1.cpp:24:1: error: stray '\240' in program baze1.cpp:25:1: error: stray '\302' in program return 0; ^ baze1.cpp:25:1: error: stray '\240' in program baze1.cpp:25:1: error: stray '\302' in program baze1.cpp:25:1: error: stray '\240' in program baze1.cpp:25:1: error: stray '\302' in program baze1.cpp:25:1: error: stray '\240' in program baze1.cpp:25:1: error: stray '\302' in program baze1.cpp:25:1: error: stray '\240' in program baze1.cpp:25:1: error: stray '\302' in program baze1.cpp:25:1: error: stray '\240' in program baze1.cpp: In function 'int main()': baze1.cpp:8:7: error: 'ifstream' was not declared in this scope ifstream f("baze1.in"); ^ baze1.cpp:8:17: error: expected ';' before 'f' ifstream f("baze1.in"); ^ baze1.cpp:9:7: error: 'ofstream' was not declared in this scope ofstream g("baze1.out"); ^ baze1.cpp:9:17: error: expected ';' before 'g' ofstream g("baze1.out"); ^ baze1.cpp:10:7: error: 'f' was not declared in this scope f>>b1>>b2; ^ baze1.cpp:12:26: error: 'strlen' was not declared in this scope for(i=0;i<strlen(s1);i++) ^ baze1.cpp:17:28: error: 'strlen' was not declared in this scope for(i=0;i<strlen(s2);i++) ^ baze1.cpp:22:9: error: 'g' was not declared in this scope g<<nr1+nr2; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Baze1 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ă.